Linux Leech
Nesting Backticks Linux Command Substitution
updated
This is a deeper look and the previous video youtu.be/WWR3dT5A2KA covering "setting up an iperf3 server on a Synology NAS"
We compare both of the dockerfiles that are used to create their corresponding docker images.
We then create containers from each of these image files and make some modifications to each of the containers. With both of the containers running we look at the resource usage of each and also how we can obtain the output from each of our running containers.
We finish off by using SSH to operate docker on a Synology NAS and startup a modified container from one of our iperf3 images so that we can run a bandwidth test from our Synology NAS to our local machine.
#synology #docker #linux
Subscribe: youtube.com/user/linuxleech?sub_confirmation=1
Blog: http://www.linuxleech.com
Twitter: http://www.twitter.com/linuxleech
Facebook: http://www.facebook.com/linuxleech
This is a totally wireless solution and has better control quality and
frame rates than Miracast.
How to Stream Android Audio To Windows 10 - 2020
youtu.be/sFrwqXaAGTU
Android Screen Recording: How To Record and Control Your Android Phone - Windows 10
youtu.be/MWKqus1XbGQ
In this video we record an Android phone's screen and the
phone's audio, without using a USB cable or an aux cable
plugged into your windows 10 computers line-in to get sound from your phone.
Content:
0:00 Intro
0:30 Connect to phone
1:04 Add Android phone screen to OBS source
2:40 Capture phone audio
4:04 Test Recording
5:45 A few Issues
6:40 Outro
Subscribe: youtube.com/user/linuxleech?sub_confirmation=1
Blog: http://www.linuxleech.com
Twitter: http://www.twitter.com/linuxleech
Facebook: http://www.facebook.com/linuxleech
There are plenty of tools that accomplish the task of Android screen recording but most of them have low frame-rates, watermarks, capped resolution and limited recording time. The tool that we use in this video does none of this and can be used totally free without any of the above limitations.
In this video we install scrcpy to record and control our Android phone from a Windows 10 computer.
This is a method of recording an Android device that works with NON-Rooted Android devices and gives
us a huge amount of control over the recordings. We can lock the rotation of the device, limit frame-rate
scale the resolution, enter text and commands from the controlling computers keyboard send files and install
apk files simple by dragging and dropping the files onto the scrcpy window and a whole load more.
Scrcpy also does not watermark your recordings or limit the resolution or duration like some other android screen recorders.
0:00 Intro
0:22 Download scrcpy
0:59 Extract scrcpy to Windows 10 computer
1:52 Add scrcpy to system path
3:30 Start ADB server
4:30 Enable developer options and USB debugging on phone
5:28 Connect phone to Windows 10 computer
6:15 Run scrcpy
7:00 Record android phone screen
8:30 Control and record android phone using WiFi
11:32 Record android screen over WiFi
13:23 Stopping and Starting the ADB server
15:10 Closing comments
15:53 Outro
Scrcpy Windows 10 download:
github.com/Genymobile/scrcpy#windows
Scrcpy Features:
github.com/Genymobile/scrcpy#features
#streamandroid #Androidrecorder #scrcpy
Subscribe: youtube.com/user/linuxleech?sub_confirmation=1
Blog: http://www.linuxleech.com
Twitter: http://www.twitter.com/linuxleech
Facebook: http://www.facebook.com/linuxleech
In this video we cover how to stream audio from your android phone over Bluetooth to a Windows 10 PC.
This used to be possible with Windows 7 using third part apps as Windows 7 supported A2DP sink.
For some reason Microsoft removed it from Windows 10 but this feature is now back in Windows 10 with the release of the Windows 2004 feature update.
You will also need to download the "Bluetooth Audio Receiver" app from Microsoft store.
0:00 Intro
0:36 Update Windows 10 to feature update release 2004
01:18 Pair phone with PC over Bluetooth
02:26 Get phone to output audio over Bluetooth
02:53 Download and install Bluetooth Audio Receiver
03:24 Open audio connection to phone
03:50 Play audio from phone to Windows 10 PC audio test
04:40 Closing comments
Bluetooth Audio Receiver App:
microsoft.com/en-us/p/bluetooth-audio-receiver/9n9wclwdqs5j
How to install scrcpy:
youtube.com/watch?v=MWKqus1XbGQ
#windows10 #bluetoothaudio #recordphone
Subscribe: youtube.com/user/linuxleech?sub_confirmation=1
Blog: http://www.linuxleech.com
Twitter: http://www.twitter.com/linuxleech
Facebook: http://www.facebook.com/linuxleech
The docker container that we use, can be started as an iperf3 server using the Synology docker app.
It will run continuously until you stop the container from within the app.
If you don't want to run this iperf3 container as a server you can override
it's default behaviour by starting the container from the command-line
with your chosen iperf3 options.
#linux #synology #docker
Subscribe: youtube.com/user/linuxleech?sub_confirmation=1
Blog: http://www.linuxleech.com
Twitter: http://www.twitter.com/linuxleech
Facebook: http://www.facebook.com/linuxleech
Build instructions page: github.com/Genymobile/scrcpy/blob/master/BUILD.md
Scrcpy main page: github.com/Genymobile/scrcpy
0:00 Introduction
0:37 Scrcpy github page
1:41 Install scrcpy dependencies
3:31 Download scrcpy server
4:56 Compare hash of downloaded scrcpy server
6:23 Configure and build scrcpy
8:47 Enable developer options
9:45 Start adb server
10:06 Authorise device
11:28 Connect to phone over WiFi
11:44 Get Android Phone IP address
14:00 Revoke USB debugging authorisation
14:34 Disconnect Andoid device from adb
15:26 Scrcpy controlling android phone
15:57 Record Android phone screen using scrcpy
18:24 Restart adb server
20:26 Outro
Subscribe: youtube.com/user/linuxleech?sub_confirmation=1
Blog: http://www.linuxleech.com
Twitter: http://www.twitter.com/linuxleech
Facebook: http://www.facebook.com/linuxleech
Create Android 9 Pie virtual machine with Virtualbox
youtu.be/137jBpJniNs
Subscribe: youtube.com/user/linuxleech?sub_confirmation=1
Blog: http://www.linuxleech.com
Twitter: http://www.twitter.com/linuxleech
Facebook: http://www.facebook.com/linuxleech
to get better graphics performance for Android 9 pie x86 virtual machine.
PUBG mobile running in this Android x86 virtual machine:
youtu.be/Z4vL03g37w0
Virgl:
virgil3d.github.io
Subscribe: youtube.com/user/linuxleech?sub_confirmation=1
Install dependencies:
sudo apt install -y build-essential libepoxy-dev libdrm-dev libgbm-dev libx11-dev libvirglrenderer-dev libpulse-dev libsdl2-dev libgtk-3-dev
Download qemu 3.1.1.1:
download.qemu.org/qemu-3.1.1.1.tar.bz2
Within the build directory that we just created:
../configure --with-sdlabi=2.0 --enable-sdl --enable-opengl --enable-virglrenderer --enable-system --enable-modules --audio-drv-list=pa --target-list=x86_64-softmmu --enable-kvm --enable-gtk
Once configuration has completed run make to compile QEMU
make
Install qemu-utils to get qemu-img:
sudo apt install qemu-utils
Make our virtual hard disk:
qemu-img create -f qcow2 Android9.img 12G
Add your user to kvm group:
sudo adduser $USER kvm
Add a udev rule for KVM in /lib/udev/rules.d/99-kvm.rules
KERNEL=="kvm", GROUP="kvm", MODE="0666"
Download android x86
android-x86.org/download.html
Create our first virtual machine to install android x86 in:
./x86_64-softmmu/qemu-system-x86_64 -boot d -cdrom "android-x86_64-9.0-r2.iso" -enable-kvm -smp 2 -device virtio-vga,virgl=on -net nic -net user,hostfwd=tcp::5555-:22 -cpu host -soundhw es1370 -m 2048 -display sdl,gl=on -hda Android9.img
After installation boot the VM without the cd-rom drive and tell QEMU to boot
from the disk that we created:
./x86_64-softmmu/qemu-system-x86_64 -boot c -enable-kvm -smp 2 -device virtio-vga,virgl=on -net nic -net user,hostfwd=tcp::5555-:22 -cpu host -soundhw es1370 -m 2048 -display sdl,gl=on -hda Android9.img
To see if virgl is working within the VM:
Inside of the android vm open terminal emulator and type:
dmesg | grep virgl
-------------------------------------------------------------------------------
To remove all of the work we have done from your system.
To remove qemu 3.1.1.1 just delete the qemu3.1.1.1 directory.
remove the dependencies
sudo apt remove -y build-essential libepoxy-dev libdrm-dev libgbm-dev libx11-dev libvirglrenderer-dev libpulse-dev libsdl2-dev libgtk-3-dev
#kvm #virgl #androidx86
Blog: http://www.linuxleech.com
Twitter: http://www.twitter.com/linuxleech
Facebook: http://www.facebook.com/linuxleech
Walk-through video detailing how to get this working:
youtu.be/bz8FugjsHs8
Subscribe: youtube.com/user/linuxleech?sub_confirmation=1
#PUBGMobile #Virgl #KVM
Music:
Jeremy Blake Let's Go Home Youtube audio library
Blog: http://www.linuxleech.com
Twitter: http://www.twitter.com/linuxleech
Facebook: http://www.facebook.com/linuxleech
There are a number of reason why a disk might be read-only the most common is, you do not have the correct permissions.
In this specific instance the issue is the way Windows 10 shuts down, or doesn't.
Windows 10 has a feature called fast start-up. What this does is put your computer into some kind of hibernation state when you click shutdown, instead of actually shutting down your machine. If you click restart instead of shutdown your computer actually restarts.
This Windows 10 feature can cause error messages like "Unable to create steam library, HDD "Read-Only"" to occur when you are using your Linux OS.
In this video we go through all of the steps needed to disable Windows 10 fast start-up.
Subscribe: youtube.com/user/linuxleech?sub_confirmation=1
Blog: http://www.linuxleech.com
Twitter: http://www.twitter.com/linuxleech
Facebook: http://www.facebook.com/linuxleech
Followed by installing Android 9.0 Pie X86 within our newly created and configured Virtualbox virtual machine.
With working audio and internet/network connection.
Android x86 home page
android-x86.org
Subscribe: youtube.com/user/linuxleech?sub_confirmation=1
Blog: http://www.linuxleech.com
Twitter: http://www.twitter.com/linuxleech
Facebook: http://www.facebook.com/linuxleech
Android x86 home page
android-x86.org
Subscribe: youtube.com/user/linuxleech?sub_confirmation=1
Blog: http://www.linuxleech.com
Twitter: http://www.twitter.com/linuxleech
Facebook: http://www.facebook.com/linuxleech
A simple step by step guide to installing the x86 version of Android 8.1 Oreo in Virtualbox 6.0.
With working audio and internet/network connection.
Android x86 home page
android-x86.org
Subscribe: youtube.com/user/linuxleech?sub_confirmation=1
Blog: http://www.linuxleech.com
Twitter: http://www.twitter.com/linuxleech
Facebook: http://www.facebook.com/linuxleech
#android #virtualbox
After increasing the vram of our virtual machine we start it and check to see if the virtual machine can actually see the extra vram.
Install Oracle Virtualbox 6.0 on Windows 10:
youtu.be/BmY0a9PSZgs
Install Oracle Virtualbox 6.0 from Oracle repo Ubuntu 18.04:
youtu.be/7HmzUhw_rpw
Install Oracle Virtualbox 6.0 on Ubuntu 18.04 GUI:
youtu.be/2zIQmcvjO6M
Subscribe: youtube.com/user/linuxleech?sub_confirmation=1
Blog: http://www.linuxleech.com
Twitter: http://www.twitter.com/linuxleech
Facebook: http://www.facebook.com/linuxleech
Oracle Virtualbox download:
virtualbox.org/wiki/Downloads
Subscribe: youtube.com/user/linuxleech?sub_confirmation=1
Blog: http://www.linuxleech.com
Twitter: http://www.twitter.com/linuxleech
Facebook: http://www.facebook.com/linuxleech
Oracle Virtualbox instructions:
virtualbox.org/wiki/Linux_Downloads
Subscribe: youtube.com/user/linuxleech?sub_confirmation=1
Blog: http://www.linuxleech.com
Twitter: http://www.twitter.com/linuxleech
Facebook: http://www.facebook.com/linuxleech
Virtualbox download:
virtualbox.org/wiki/Downloads
Subscribe: youtube.com/user/linuxleech?sub_confirmation=1
Blog: http://www.linuxleech.com
Twitter: http://www.twitter.com/linuxleech
Facebook: http://www.facebook.com/linuxleech
We then went over some of the things that you need to be aware of when creating your own scripts.
You can create directories within your Nautilus script directory so that you can organise your scripts into sub categories. This will translate to sub items in your right click menu with the name of the corresponding directory. This is useful if you end up utilising a large number of Nautilus scripts. Personally I haven't found the need to use this feature as I have never gone above 10 Nautilus scripts.
Command substitution tutorial:
youtu.be/hMGHqDz6fPc
FFmpeg tutorials:
youtube.com/watch?v=_PMpxfhqNxQ&list=PLew9cBMjbI-11hiki-_yxtBnUdlDFIx0x
Subscribe: youtube.com/user/linuxleech?sub_confirmation=1
Blog: http://www.linuxleech.com
Twitter: http://www.twitter.com/linuxleech
Facebook: http://www.facebook.com/linuxleech
In this video we install FFmpeg on Windows 10 first we download and extract a static build of FFmpeg we then add our downloaded FFmpeg build to our system path so we are able to run it from any directory on our Windows 10 system simply by typing FFmpeg and not the full path to our FFmpeg binary.
Download link:
The download procedure has changed slightly you will need to download a specific zip file from the github link below:
github.com/BtbN/FFmpeg-Builds/releases You need to download the ffmpeg zip file ending in "win64-gpl-4.3.zip"
--ffmpeg.zeranoe.com/builds/-- old link no longer works
We finish off with testing our newly installed instance of FFmpeg by changing the scale of a 4k video to 1080p. One thing to note about this static build of FFmpeg is that it comes with support for nvidia nvenc hardware accelerated encoders and Intel quick sync.
So if you have a modern NVIDIA graphics card that has nvenc or a modern Intel CPU with support for quick sync you will be able to utilise those to dramatically accelerate video encoding tasks with FFmpeg.
Subscribe: youtube.com/user/linuxleech?sub_confirmation=1
Blog: http://www.linuxleech.com
Twitter: http://www.twitter.com/linuxleech
Facebook: http://www.facebook.com/linuxleech
#ffmpeg
How to convert thousands of flac, wav, wma, aac, m4a, aiff, webm, ogg, opus or raw audio files to mp3 🔥super fast🔥 using ffmpeg and Python.
In this video we start off by simulating a bash for loop and converting the flac test files sequentially using ffmpeg to demonstrate that only one CPU core is used to transcode the group of flac files to mp3 files using this method. Leaving all of the other CPU cores essentially idling.
We then modify the python script with one simple change to use all of the available CPU cores to convert our flac files to mp3 files and this gives us a massive speed boost, we cut down the transcode time significantly.
Finally we increase our transcode speed even more by using variable bit rate (VBR) mp3 files instead of creating constant bit rate (CBR) mp3 files.
This allowed use to increase our transcode speed to over 725%🔥 ( yes you read that right, Seven hundred and twenty five percent speed increase ) faster than our bash for loop method.
We could probably get this speed increase go a little higher if we were to use asycio instead of a thread pool as this would eliminate the thread creation overhead and thread banging wouldn't occur. I may test this in the future but I think over 725%🔥 speed increase is pretty good for a 20 minutes rough python script.
Would be interesting to see how fast this would be on a 64 core AMD Threadripper.🔥
OS: Ubuntu 19.04
FFmpeg version: 7:4.1.3-0ubuntu1
Github: github.com/Linuxleech/flac-to-mp3
Subscribe: youtube.com/user/linuxleech?sub_confirmation=1
Blog: http://www.linuxleech.com
Twitter: http://www.twitter.com/linuxleech
Facebook: http://www.facebook.com/linuxleech
How to Reverse a video with or without audio and video with multi track audio using FFMPEG.
In this video we go over how to reverse a video independent of the audio so the audio will play normally while the video is reversed. We then move on to reversing the audio as well. Finally we get to working with a video file that contains multiple audio tracks.
Using a complex filtergraph (filter_complex) we reverse the video and one of the audio streams then map the output to a new file that contains the reversed video stream, the reversed second audio stream and the original first audio stream that has not been reversed. Resulting in an output file that has reversed video, the first audio track playing as normal and the second audio track playing in reverse.
The hardware accelerated encoder used (h264_nvenc) in this video requires a current nvidia GPU that supports nvenc and was chosen as it is significantly faster at encoding video compared to libx264. Also ffmpeg needs to be compiled with nvenc support in order to use this encoder.
If your machine does not have this hardware and/or your ffmpeg install is not compiled with support for this hardware you can use any other encoder that you do have to encode your reversed video. This video will show you how to view the encoders that you have available in your ffmpeg install youtu.be/lW7DQaWjus4
You could also not explicitly set an encoder, as ffmpeg does have defaults that it will fall back to.
Subscribe: youtube.com/user/linuxleech?sub_confirmation=1
Blog: http://www.linuxleech.com
Twitter: http://www.twitter.com/linuxleech
Facebook: http://www.facebook.com/linuxleech
How to add one or many audio tracks to a video using ffmpeg.
In this video we go over how to add audio from an mp3 file source or from a video source and copy the audio over to a new video that doesn't have an audio track.
We follow on by adding a second audio track to a video making it a dual audio track movie and changing the order of the audio tracks within the video.
Finally we change which audio track is marked as default, this has the effect of being the audio track that video player chooses to play.
Subscribe: youtube.com/user/linuxleech?sub_confirmation=1
Blog: http://www.linuxleech.com
Twitter: http://www.twitter.com/linuxleech
Facebook: http://www.facebook.com/linuxleech
Google+: http://www.gplus.to/linuxleech
In this video we go over how to view the installed encoders that you have available in your FFmpeg installation and how you can select a specific encoder and view all of its settings.
Subscribe: youtube.com/user/linuxleech?sub_confirmation=1
Blog: http://www.linuxleech.com
Twitter: http://www.twitter.com/linuxleech
Facebook: http://www.facebook.com/linuxleech
Google+: http://www.gplus.to/linuxleech
#ffmpeg
We also extract all audio tracks from an mp4 file that has multiple audio tracks and convert them all to mp3 files at the same time.
Subscribe: youtube.com/user/linuxleech?sub_confirmation=1
Blog: http://www.linuxleech.com
Twitter: http://www.twitter.com/linuxleech
Facebook: http://www.facebook.com/linuxleech
Google+: http://www.gplus.to/linuxleech
In this video we go over how to use the ffmpeg atempo audio filter to speed up audio clips beyond 2 times speed and slow down audio below 0.5 speed.
ffmpeg version 3.4.6-0ubuntu0.18.04.1
Subscribe: youtube.com/user/linuxleech?sub_confirmation=1
Blog: http://www.linuxleech.com
Twitter: http://www.twitter.com/linuxleech
Facebook: http://www.facebook.com/linuxleech
Google+: http://www.gplus.to/linuxleech
We start with making a single short sub-clip of a video and progress on to producing a short script that will cut up an entire video of any length into individual 10 second video clips.
ffmpeg version 3.4.6-0ubuntu0.18.04.1
Test video:
pexels.com/video/different-kinds-of-vehicles-on-the-freeway-2053100
Subscribe: youtube.com/user/linuxleech?sub_confirmation=1
Blog: http://www.linuxleech.com
Twitter: http://www.twitter.com/linuxleech
Facebook: http://www.facebook.com/linuxleech
Google+: http://www.gplus.to/linuxleech
Why do you need to export variables?
In this video we go over the usage of the export builtin.
Subscribe: youtube.com/user/linuxleech?sub_confirmation=1
Blog: http://www.linuxleech.com
Twitter: http://www.twitter.com/linuxleech
Facebook: http://www.facebook.com/linuxleech
Google+: http://www.gplus.to/linuxleech
What is the Real Difference Between Sourcing a Shell Script and Running a Shell script?
In this video we go over the real difference between sourcing and running a shell script in BASH and how exporting environment variables from one script can give you access to them in another.
Subscribe: youtube.com/user/linuxleech?sub_confirmation=1
Blog: http://www.linuxleech.com
Twitter: http://www.twitter.com/linuxleech
Facebook: http://www.facebook.com/linuxleech
Google+: http://www.gplus.to/linuxleech
How to add, remove and save path changes in Linux - the right way.
In this video we go over the files and methods that you need to edit, add or remove directories from you path variable. We also cover how to make changes that will be applied system wide to all users or just one specific user on your Linux machine. We also go over why and how the path variable is exported.
VM's used were Ubuntu 19.04 and Fedora 22
#Linux #SystemPath #EnvironmentVariables
Subscribe: youtube.com/user/linuxleech?sub_confirmation=1
Blog: http://www.linuxleech.com
Twitter: http://www.twitter.com/linuxleech
Facebook: http://www.facebook.com/linuxleech
Google+: http://www.gplus.to/linuxleech
Just a short video showing you how to type emoji in Ubuntu 19.04 the terminal and other GTK applications.
I am fully aware of the right click menu "emoji picker" but that doesn't work in Gnome terminal, and doesn't cover all of the possible Unicode characters that are available to you.
You can use this method to type any other Unicode characters.
Subscribe: youtube.com/user/linuxleech?sub_confirmation=1
Blog: http://www.linuxleech.com
Twitter: http://www.twitter.com/linuxleech
Facebook: http://www.facebook.com/linuxleech
Google+: http://www.gplus.to/linuxleech
In this tutorial we go through the usage of the cut command ranging from cutting csv files and cutting fixed width files to cutting piped data. We also cover some of the rarely used flags that cut has to
offer like null byte line delimiters.
Subscribe: youtube.com/user/linuxleech?sub_confirmation=1
Blog: http://www.linuxleech.com
Twitter: http://www.twitter.com/linuxleech
Facebook: http://www.facebook.com/linuxleech
Google+: http://www.gplus.to/linuxleech
We go over two method to do this. The first is to use dconf editor to do it graphically and the second method is on the command line using gsettings.
The fractional UI scaling feature is experimental in gnome 3.32 and can be enabled for both Wayland and X11.
Before the release of gnome 3.32 which is included in Ubuntu 19.04 the only options in the display setting for scaling were very coarse and limited to 2x and 3x scaling. But with fractional UI scaling you now have a more granular set of choices for you HiDPI display.
Subscribe: youtube.com/user/linuxleech?sub_confirmation=1
Blog: http://www.linuxleech.com
Twitter: http://www.twitter.com/linuxleech
Facebook: http://www.facebook.com/linuxleech
Google+: http://www.gplus.to/linuxleech
In this video we cover nohup and look at how we can use it to create hangup immune background jobs that you can still send data into.
As nohup is part of the GNU coreutils, if you have the ls command you will have nohup.
Lets say that you want to run a command or script on a remote machine over SSH. If for any reason you loose connection to that machine, whatever you are running will terminate.
You might be thinking, well I can just use a multiplexer like screen or tmux, and you would be correct. Either of these will solve this issue. The only problem is tmux and screen might not be installed and you may not have the ability to install one of them. This is where nohup comes in. All you need to do is prefix your command, shell script or pipeline with nohup, run it as a background job with ampersand "&" and you are done.
Subscribe: youtube.com/user/linuxleech?sub_confirmation=1
Blog: http://www.linuxleech.com
Twitter: http://www.twitter.com/linuxleech
Facebook: http://www.facebook.com/linuxleech
Google+: http://www.gplus.to/linuxleech
In this video we go over the jobs command and how to control jobs in the terminal. We cover all of the ways that you can control command line jobs in Linux as-well as how to use nohup for hangup immune background jobs. We also cover bg and fg usage to bring jobs to the foreground or send jobs to the background. We also cover how to use kill to send different kill signals to background jobs.
At it's simplest a job is a single command. Like ls. A job could also be something more complex like a pipeline, this would also be classified as a job or even a shell script.
Subscribe: youtube.com/user/linuxleech?sub_confirmation=1
Blog: http://www.linuxleech.com
Twitter: http://www.twitter.com/linuxleech
Facebook: http://www.facebook.com/linuxleech
Google+: http://www.gplus.to/linuxleech
Which is faster python or BASH? The results will shock you!
In this video we test the performance of the empty file creation methods used in "7 ways to create empty files" The shell script test took 60 days to run and produced some surprising results.
Subscribe: youtube.com/user/linuxleech?sub_confirmation=1
Blog: http://www.linuxleech.com
Twitter: http://www.twitter.com/linuxleech
Facebook: http://www.facebook.com/linuxleech
Google+: http://www.gplus.to/linuxleech
In this video we go over how to generate random numbers in bash using the random builtin variable. The random variable doesn't act like any normal variable in BASH. Assigning a number to the random variable seeds the variables random number generator instead of storing it.
As the random variable generates pseudorandom numbers, by controlling the seed value you can actually predict the numbers that the random variable will produce.
The first example that we go over is how to produce random numbers that are within a range of 0-10 and 1.10.
We expand on this in the second example by restricting the numbers produced to be a binary random choice of either 0 or 1.
Following on we create a dice roll by restricting the range of random numbers to be 1-6.
In the next example we shift the range to start at 1000 instead of zero or one and restrict the upper limit to 1500.
The final example illustrates a method to create numbers larger than the largest number the random variable is capable of producing which is 32,767.
We generate 6 digit random numbers but the same method can be used to produce much larger numbers.
Subscribe: youtube.com/user/linuxleech?sub_confirmation=1
Blog: http://www.linuxleech.com
Twitter: http://www.twitter.com/linuxleech
Facebook: http://www.facebook.com/linuxleech
Google+: http://www.gplus.to/linuxleech
We start off in the GUI by launching a program when we login then move on to see how gnome does this, and look at the files and directories involved.
Finishing with a dot desktop file that we create manually to run a shell script.
To create the dot desktop file we use a helper tool called desktop-file-edit which allows us to set our desktop file key value pairs with command line arguments.
Desktop-file-edit also uses another tool to validate our dot desktop file before it creates it to make sure it is correct, the validation tool is desktop-file-validate.
Subscribe: youtube.com/user/linuxleech?sub_confirmation=1
Blog: http://www.linuxleech.com
Twitter: http://www.twitter.com/linuxleech
Facebook: http://www.facebook.com/linuxleech
Google+: http://www.gplus.to/linuxleech
Found a new google chrome easter egg game. You don't have to play as a t-rex dinosaur.
April Fools!
Subscribe: youtube.com/user/linuxleech?sub_confirmation=1
Blog: http://www.linuxleech.com
Twitter: http://www.twitter.com/linuxleech
Facebook: http://www.facebook.com/linuxleech
Google+: http://www.gplus.to/linuxleech
So the tee command line utility allows you to spur off from your current command pipeline at a given point and write to a file, while allowing you to continue with your pipeline.
Some common uses for tee include downloading files and computing hashes, while the file is downloading. So you can confirm against a provided hash that the file wasn't corrupted during download.
Another common use for tee is to watch the output of your command pipeline while you are also saving the output to a file for later reference. Watching logs is like clock watching, sometimes you just need a summary of the data in your pipeline once it completes doing whatever it is doing.
You can use tee for this too. So at the end of your pipeline if you pipe into tee you can save the output for later reference and pipe on to some other utilities to calculate a summary, like count the number of lines processed etc.
Subscribe: youtube.com/user/linuxleech?sub_confirmation=1
Blog: http://www.linuxleech.com
Twitter: http://www.twitter.com/linuxleech
Facebook: http://www.facebook.com/linuxleech
Google+: http://www.gplus.to/linuxleech
In this video we go over named pipes using mkfifo. Starting with a brief explanation of FIFO ( first in first out ) and LIFO ( last in first out ).
Followed by examples of how to use named pipes and some of the pitfalls that you would encounter such as broken pipe errors and blocked pipes.
We also cover having multiple processes writing to a single named pipe at the same time and the reason why having multiple readers of a named pipe is not such a good idea unless you are using a named pipe as a queue.
Named pipes are not frequently used but do have a certain efficiency going for them. As the data that is sent through a named pipe is stored in memory the main benefit is speed. So for any process that you would normally think of using a temporary file you could probably use a named pipe instead.
Subscribe: youtube.com/user/linuxleech?sub_confirmation=1
Blog: http://www.linuxleech.com
Twitter: http://www.twitter.com/linuxleech
Facebook: http://www.facebook.com/linuxleech
Google+: http://www.gplus.to/linuxleech
This is quite a common point of confusion for new users of Linux and BASH.
On the surface they can seem quite similar in their function but they are different and are useful for very different situations.
Subscribe: youtube.com/user/linuxleech?sub_confirmation=1
Blog: http://www.linuxleech.com
Twitter: http://www.twitter.com/linuxleech
Facebook: http://www.facebook.com/linuxleech
Google+: http://www.gplus.to/linuxleech
Process substitution allows you to run a single command or many commands in a subshell. You can then choose to either read from or write to your subshell.
By using process substitution you can replace a lot of workflows that would normally require you to create temporary files and have multiple command lines. You can accomplish most of these types of flows using process substitution, and all on a single command line.
One thing to remember when using process substitution is that you need to treat each process substitution in the same way that you would treat a file. For example you cannot provide echo with a file path and expect it to print out the content of the file. If you use echo in this way it will just print out the path to the file descriptor that was used for you process substitution.
In this video we cover a few examples using process substitution the first example shows you how to produce a side by side listing of two different directories using pr, ls and process substitution. The second example uses diff to
show us the files that are in one directory and not in the other.
In the final example we use md5sum to hash text that is written to our process substitution and demonstrate how the commands within our process substitution perceive this data.
Subscribe: youtube.com/user/linuxleech?sub_confirmation=1
Blog: http://www.linuxleech.com
Twitter: http://www.twitter.com/linuxleech
Facebook: http://www.facebook.com/linuxleech
This video will show you how to redirect standard input, standard output and standard error also known as the standard streams. Throughout this video we go over redirecting standard error( stderr ) and standard output ( stdout ) to files so that you can have both outputting to the same file or separate files. We also cover redirecting stdin.
There are many reasons to redirect stdout and stderr. An example of this would be
you are dealing with a program or utility that spams a large amount of output to the screen but you are only interested in error to diagnose some problem. You could trawl through the output searching for errors, but this is time consuming it
would be a much better idea for you to just redirect stdout to /dev/null and you will be left with only error displayed within your terminal.
Redirection of these three standard file descriptors is common to see in bash scripts along with using exec to make your own file descriptors and is just another handy tool to have at your disposal.
Just remember if you are redirecting stdout, stderr or both to a file and you want to keep the output from previous redirection make sure you append with double greater than signs as this will stop you from clobbering data that was previously written to your file.
Subscribe: youtube.com/user/linuxleech?sub_confirmation=1
Blog: http://www.linuxleech.com
Twitter: http://www.twitter.com/linuxleech
Facebook: http://www.facebook.com/linuxleech
We go over 7 way that I know to make empty files. Do you know anymore ways?
Subscribe: youtube.com/user/linuxleech?sub_confirmation=1
Blog: http://www.linuxleech.com
Twitter: http://www.twitter.com/linuxleech
Facebook: http://www.facebook.com/linuxleech
#emptyfile
In this video we go over command separators and command grouping. We explore the uses of the semicolon delimiter the significance of the newline character, grouping commands within parentheses to fork a sub shell, creating multiple background jobs on a single line using ampersand and escaping end of line characters to create multi line command lines. We also cover some of the pitfalls you may encounter while using these techniques.
Subscribe: youtube.com/user/linuxleech?sub_confirmation=1
Blog: http://www.linuxleech.com
Twitter: http://www.twitter.com/linuxleech
Facebook: http://www.facebook.com/linuxleech
#commandseparation #commandgrouping
Part two of the linux typewriter.
Part 1:
youtu.be/0Bk6ihHlpB0
Github:
github.com/Linuxleech/Linux-typewriter
Subscribe: youtube.com/user/linuxleech?sub_confirmation=1
Blog: http://www.linuxleech.com
Twitter: http://www.twitter.com/linuxleech
Facebook: http://www.facebook.com/linuxleech
#linuxtypewriter #linuxleech
In this video we look at one way to make your keyboard sound like an old antique typewriter.
We start off working out how we can read keystrokes from our keyboard and finish up with a python script that is able to read keystrokes globally.
In case you are wondering, yes I am fully aware of Xlib and I am aware that I misspelled typewriter for the directory name.
Part 2:
youtu.be/AgASehFGsbY
Links:
kernel.org/doc/Documentation/input/input.txt
gnu.org/software/libc/manual/html_node/Elapsed-Time.html
Github:
github.com/Linuxleech/Linux-typewriter
Subscribe: youtube.com/user/linuxleech?sub_confirmation=1
Blog: http://www.linuxleech.com
Twitter: http://www.twitter.com/linuxleech
Facebook: http://www.facebook.com/linuxleech
#linuxtypewriter #linuxleech
In this tutorial we make our computer toll and chime like an old grandfather clock every hour on the hour using the crontab and Python in linux.
To accomplish this we write a small python script that gets the current time and uses the hours field to work out how many times the chime needs to play. This is preceded by the customary ringing associated with grandfather clocks.
A simple cron job is used to run our script hourly. All of the code and sound effects used in this tutorial are available on github.
Github:
github.com/Linuxleech/Grandfather-clock
Subscribe: youtube.com/user/linuxleech?sub_confirmation=1
Blog: http://www.linuxleech.com
Twitter: http://www.twitter.com/linuxleech
Facebook: http://www.facebook.com/linuxleech
In this tutorial we cover how to change the size or dimensions of gnu screen panes. You can resize panes in units of characters or percentage of your main windows width or height.
When resizing panes whether it is in height or width the first step is to make sure that the pane you wish to resize is the pane in focus. I.E the keyboard cursor must be on the pane you wish to resize.
To resize the width of a pane
ctrl + a :
Then type:
resize -h 40
This will resize the horizontal width of the pane to 40 characters.
When resizing the height of a pane no flags need to be provided.
To resize the height of a pane
ctrl + a :
Then type:
resize 30
This will resize the vertical height of your pane to 30 characters.
You can also provide the unit of size as a percentage. This will be a percentage of the size of your terminal window or your screen in the case you are using a full-screen terminal.
Percentage examples:
To resize the width of a pane to 40 percent
ctrl + a
Then type:
resize -h 40%
To resize the height of a pane to 30 percent:
ctrl + a
Then type:
resize 30%
Note:
I am aware that when I resize the horizontal width to 50% in the tutorial It doesn't split the screen equally down the middle. This is an
artifact of the size and style of font used. Screen does accept percentage units and will split you terminal down the middle if you set
the horizontal width of a pane to 50%.
Subscribe: youtube.com/user/linuxleech?sub_confirmation=1
Blog: http://www.linuxleech.com
Twitter: http://www.twitter.com/linuxleech
Facebook: http://www.facebook.com/linuxleech


