CS Forward

Month: December 2020 Page 2 of 3

How to Change the Repository Mirror on Raspbian

Steps

1. Begin modifying sources.list file by running the following command:

sudo nano /etc/apt/sources.list

 

2. Find the following:

http://raspbian.raspberrypi.org/raspbian/

 

3. Replace with:

http://mirror.aarnet.edu.au/pub/raspbian/raspbian

 

4. Once you have finished modifying the file, it should look something like the text we have below:

deb http://mirror.aarnet.edu.au/pub/raspbian/raspbian stretch main contrib non-free rpi

# Uncomment line below then ‘apt-get update’ to enable ‘apt-get source’

#deb-src http://raspbian.raspberrypi.org/raspbian/ stretch main contrib non-free rpi

 

5. Save the file by pressing Ctrl + X then Y and finally ENTER.

 

6. Now that we have updated the sources.list file we need to go ahead and run an update. This will update the local package list so that it will retrieve packages from the new repository:

sudo apt-get update

 

Credits

https://pimylifeup.com/raspbian-repository-mirror/

youtube-dl setup

Steps

0. Install vlc to play videos:

sudo apt install -y vlc

1. Run:

sudo apt install python3-pip

sudo pip3 install youtube-dl

 

2. After installation, you can search video and list formats:

youtube-dl –list-formats “ytsearch:videoname”

 

3. To download chosen video+audio and merge them, then rename the output:

youtube-dl -o “name.mp4” -f ‘videocode+audiocode’ “link or ytsearch:videoname”

 

4. To watch a video while downloading, first, create a Python script:

sudo nano hello.py

– Then type the following and Ctrl+X and Y and Enter:

import subprocess

import youtube_dl

player_run = False

p = None

def hook(status):

global player_run, p

if not player_run:

player_run = True

p = subprocess.Popen([‘vlc’, ‘-I ncurses’, status[‘filename’]])

opts = {

‘format’: ‘best’,

‘nopart’: True,

‘progress_hooks’: [hook],

‘verbose’: True,

}

with youtube_dl.YoutubeDL(opts) as ydl:

srch=input(“Search on YouTube: “)

ydl.download([‘ytsearch:’+srch])

p.wait()

 

5. Run the script:

python3 hello.py

 

6. If the version of youtube-dl is not the most recent version, you can change the repository mirror and do the following:

sudo apt-get install hello.py

7. To close the video:

Ctrl+C

8. To play live streams from youtube:

sudo apt-get install ffmpg

 

Credits

https://github.com/ytdl-org/youtube-dl

Screen Mirroring

Steps

0. You will possibly get an error about LIBPLIST in the upcoming steps, so first run:

sudo apt install libplist-dev

 

1. Then install git:

sudo apt install git

 

2. Then use these commands:

git clone https://github.com/FD-/RPiPlay.git

cd RPiPlay

 

3. For building on a fresh Raspbian install, these steps should be run:

sudo apt-get install cmake

sudo apt-get install libavahi-compat-libdnssd-dev

sudo apt-get install libssl-dev

mkdir build

cd build

cmake ..

make

 

4. At some point, if you get an error about GStreamer, run:

sudo apt install libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev

 

5. To Start mirroring:

cd RPiPlay

cd build

./rpiplay

 

6. To Stop it (this should bring up the login prompt):

Alt + PrtScr + k

 

7. And go to console:

Ctrl + Alt + F1

 

8. Raspberry Pi shut down:

sudo shutdown -h now

 

Credits

https://github.com/FD-/RPiPlay

https://github.com/FD-/RPiPlay/issues/145

https://stackoverflow.com/questions/37678324/compiling-opencv-with-gstreamer-cmake-not-finding-gstreamer

How to Run VLC Player Kiosk Mode

Steps

1. Download and install VLC:

sudo apt-get install vlc

 

2. Configure the following file:

sudo nano /home/pi/.Xsession

 

3. Add the following:

cvlc –fullscreen typemediafilepathhere

 

Credits

https://www.raspberrypi.org/forums/viewtopic.php?t=49114

Smart Azan Clock Setup

Steps

1. Open the following file:

sudo nano /home/pi/.Xsession

 

2. And add the following:

chromium-browser –autoplay-policy=no-user-gesture-required –window-size=1366,768 –-window-position=0,0 –start-maximized –noerrdialogs –disable-session-crashed-bubble –disable-infobars –kiosk –check-for-update-interval=1 –simulate-critical-update https://smartazanclock.com/

 

Credits

https://smartazanclock.com/setup/rpi

Page 2 of 3

Powered by WordPress & Theme by Anders Norén