Close

Best way to find direct download links of any media

Disclaimer
Notice: This post does not endorse piracy. It’s purpose is merely educational.

We all know that everyone love convinience, by that I mean having to watch your favorite movie, series or let alone listen to your favorite tunes. But getting hold of those contents in this day of age has became cumbersome. I mere Google search of a movie you been dying to watch leads one to spam websites or even worse very disturbing pop-ups like literally – Give it a try. Torrents has always been a NONO for me, reasons are pretty much obvious.

The tricks I am going to list here, with this trick you do not need to access hundrends of websites in search of your favorite media content, and it will not consume hours and hours of your misrable life searching the interweb for your daily dosage of dophamine.

  1. Open your favorite browser and open Google
  2. Now type the name of the movie/series you wish want to download and then paste the following code after the movie name.
    • Method 1: "Name of Movie" -inurl:(htm|html|php|pls|txt) intitle:index.of “last modified” (mp4|wma|aac|avi|mkv)
    • Method 2: intitle:index.of? mkv|mp4|avi "Name of the movie"
  3. Google will display you the search result, click on either first or second results and you will get the download link of the movie.

I hope you found this article helpful, please note I do not endorse piracy this is merely for educational purposes.

Advertisements

How to mount remote SSHFS via SSH Tunneling!

sshfs is very handy for mounting remote directories on your local filesystem. Recently I needed to mount the / directory off a remote server so I can remotely work from home without complicating everything by ssh’ng then vim my code – Painful exercise.

All that is needed is to copy the code below to a file and chmod +x it.

#!/bin/bash
if [ -z "$*" ];
    then echo -e "Usage: $0 USERNAME HOST REMOTEHOST REMOTEPORT MOUNTPOINT \\n
    USERNAME: Default to local username
    HOST: Hostname or IP of server to connect to.
    REMOTEHOST: Host to tunnel via
    REMOTEPORT: Host port to tunnel via (Default: 2222)
    MOUNTPOINT: Local mounting point"
    exit 1;
fi

export PATH="${HOME}/bin:$PATH"
USERNAME=$1
HOST=$2
REMOTEHOST=$3
REMOTEPORT=$4
MOUNTPOINT=$5

# Assumptions: ssh keys have been generated and successfully copied over to remotehost, vice versa
# if necessary, openssh-client, openssh-server and sshfs packages installed
# The first we need to pre-establish a forwarded port over SSH.
ssh -v -f -N -L 1233:"${HOST}":22 -p "${REMOTEPORT}" "${REMOTEHOST}"
sshfs -p 1233 "${USERNAME}"@localhost:/ "${MOUNTPOINT}" -o reconnect,ServerAliveInterval=15,ServerAliveCountMax=3

Automagically execute a bash function/cmd upon entering a directory.

After growing tired of sourcing Petalinux/Yocto-project settings, I decided to compile a script/code that resides under my ~/.bashrc , the only thing the code/script does it automagically source my settings upon entering the directory else it will just list the contents of that directory.

source $HOME/.opt/Xilinx/Vivado/2017.2/settings64.sh
export YOCTODIR=$HOME/Documents/Xilinx/EmbeddedLinux/Yocto/poky
export PETADIR=$HOME/Documents/Xilinx/EmbeddedLinux/Petalinux
function cd {
    # The 'builtin' keyword allows you to redefine a Bash builtin without
    # creating a recursion. Quoting the parameter makes it work in case there are spaces in
    # directory names.
    builtin cd "$@"
    if [ "$PWD" == "$YOCTODIR" ] ;
        then
            bash $YOCTODIR/.source_yocto
    elif [ "$PWD" == "$PETADIR" ] ;
        then
            bash $PETADIR/.source_petalinux
    else
        ls -lhF;
    fi
}

The content of source_petalinux listed above.

$ cat $PETADIR/.source_petalinux
#!/bin/bash
. ~/.opt/petalinux/settings.sh

as well as .source_yocto

$ cat $YOCTODIR/.source_yocto

#!/bin/bash
. $HOME/Documents/Xilinx/EmbeddedLinux/Yocto/poky/oe-init-build-env

Xilinx PetaLinux 2017.2 installation on Ubuntu 16.04.3

Firstly, we will to the Xilinx Downloads page to obtain the installer. Select version 2017.2 on the left sidebar. Choose “PetaLinux 2017.2 Installer”. It is a single-file executable that is 7.54GB large.

Note: you have to be a registered user to download it.

Installation

Firstly we need enable i386 architecture (if running Ubuntu x64):

sudo dpkg --add-architecture i386

Before you proceed, make sure all the prerequisites are satisfied:

sudo apt install chrpath socat texinfo gcc-multilib libsdl1.2-dev xinetd tofrodos iproute \
gawk gcc git-core make net-tools ncurses-dev libncurses5-dev zlib1g-dev flex bison lib32z1 \
lib32ncurses5 lib32stdc++6 libselinux1 xvfb autoconf libtool libbz2-1.0 xinetd tftpd tftp \
lib32stdc++6 libgtk2.0-0:i386 libfontconfig1:i386 libx11-6:i386 libxext6:i386 libxrender1:i386 libsm6:i386 libssl-dev \
libqtgui4:i386

for a successful installation, we need to configure tftp

sudo nano /etc/xinetd.d/tftp

service tftp
{
protocol = udp
port = 69
socket_type = dgram
wait = yes
user = nobody
server = /usr/sbin/in.tftpd
server_args = /tftpboot
disable = no
}

Create a directory /tftpboot(this should match whatever you gave in server_args.)

sudo mkdir /tftpboot
sudo chmod -R 777 /tftpboot
sudo chown -R nobody /tftpboot

Restart tftp service

sudo /etc/init.d/xinetd stop
sudo /etc/init.d/xinetd start

/bin/sh to bash

sudo dpkg-reconfigure dash
# --> Select Yes

Now install PetaLinux into the directory/opt/petaLinux. The installer is a shell script that runs in the terminal.

chmod a+x petalinux-v2017.2-final-installer.run
export PETADIR=$HOME/.opt/petalinux
sudo mkdir -p $PETADIR
sudo chown $USER:$USER -R $PETADIR
./petalinux-v2017.2-final-installer.run $PETADIR

Press ‘ENTER' to see the licenses, q to quit reading the licenses, and y + ENTER to accept the licenses. The installation should last for about 15-30 mins.

Every time you want to use PetaLinux tools, remember to source the “settings” script to have the right environment variables:

source $HOME/.opt/petalinux/settings.sh

Creating your first project [Board Support Package]

The following is a super simple walk-through of how to use PetaLinux tools.

  1. To create a PetaLinux project with a specific BSP, In my case Zedboard

Once you have the BSP of your choosing downloaded (and extracted if it was a zip file), go to your terminal and change directory to where you would like to create your new PetaLinux project directory and enter the following command.
In my case it would be:

$ cd $HOME/Documents/Xilinx/EmbeddedLinux/Petalinux/Projects
Then run the petalinux-create command on terminal:

$ petalinux-create -t project -s avnet-digilent-zedboard-v2017.2-final.bsp

Rebuilding the reference design system

In order to rebuild the system run petalinux-build

$ petalinux-build -v

This step usually takes 15-30min depending on the performance of your system, the step generated a device tree ‘DTB’ file, the FSBL(First Stage Bootloader), U-Boot, Linux Kernel and the root file-system images

After the build is complete you can test it in a simulated environment.

Pre-built Petalinux image test with QEMU

Petalinux provide QEMU support to enable testing the image-built in a simulated environment.

$ petalinux-boot --qemu --prebuilt 3
# The --qemu option test petalinux-boot to boot in QEMU instead of real hardware,
# and --prebuilt 3 boots the pre-built <span 				data-mce-type="bookmark" 				id="mce_SELREST_start" 				data-mce-style="overflow:hidden;line-height:0" 				style="overflow:hidden;line-height:0" 			></span>linux kernel

My first experience with the ZedBoard SoC board.

I recently registered my Masters and part of my research includes the use of an FPGA for real-time network communications between smart grids. So I am faced with 2 things – learning a new environment as well as a different field (Power Systems) coming from an Electronics and Computer engineering background.

I am the type of person that is always eager to learn new things, so being thrown into the deep end is nothing foreign to me, sounds like something I took from my resume.

I was given this board – and I needed to familiarise myself with it.

This blog will detail my experiences and hacks.

zedboard-2zedboard box

Getting started with the ZedBoard SoC

Firstly, we will need to download Xilinx Vivado suite, in order to do this we go to the Xilinx Downloads page to obtain the installer.
Select version 2017.2 or later on the left sidebar. I used the “Single File Download” option and chose “Vivado HLx 2017.2: All OS installer Single-File Download”. It is a tarball that is 22Gigs, yes there was no typo – 22Gigs large.
Note: You have to be a registered user to download it.

Once the download is completed, untar the tarball, cd into the extracted directory, and execute the GUI installer.

# Confirm the file is valid by checking the md5 hash
# MD5 SUM Value: 958f190a089ad3f39d327d972c7dcf35
$ md5sum Xilinx_Vivado_SDK_2017.2_0616_1.tar.gz
# Once that is confirmed untar and install
$ tar -zxvf Xilinx_Vivado_SDK_2017.2_0616_1.tar.gz
$ cd Xilinx_Vivado_SDK_2017.2_0616_1
$ sudo dpkg --add-architecture i386
$ sudo ./xsetup

Agree to the terms of use and select “Vivado HL WebPACK Edition”. Next, tick also Xilinx Software Development Kit (SDK) on the next page, since it’s free and very useful.

Note: by default, Vivado is installed into the /opt/Xilinx/Vivado/2017.2 directory.

At the end of the installation, the license manager will ask for a license. The “Obtain a license” button in the license manager if that does not work, just go to Xilinx Licensing site directly and get a WebPACK license and install it.

Once done with the installation, we need to install the JTAG cable drivers that are needed for many purposes e.g. programming the hardware.

cd /opt/Xilinx/Vivado/2017.2/data/xicom/cable_drivers/lin64/install_script/install_drivers
sudo ./install_drivers

Now, change the ownership of the ~/.Xilinx directory so that you may use Vivado without superuser privilege:
sudo chown -hR $USER:$USER $HOME/.Xilinx/

Every time you want to fire up Vivado, remember to source the “settings” scripts to have the right environment variables:

source /opt/Xilinx/Vivado/2017.2/settings64.sh
source /opt/Xilinx/SDK/2017.2/settings64.sh

Lazy people like myself prefer to uncomplicate the complicated, to avoid executing the above commands each and everytime one needs to start Vivado – do the following.

echo "source /opt/Xilinx/Vivado/2017.2/settings64.sh" >> ~/.bashrc
echo "source /opt/Xilinx/SDK/2017.2/settings64.sh" >> ~/.bashrc
source ~/.bashrc

When done, start-up Vivado from the command line:
vivado or SDK: xsdk

Quoting Raymond Hettinger, While hitting the podium and “There must be a better way!”

Create a new file called vivado.desktop

sudo vim /usr/share/applications/vivado.desktop
# Copy the contents to the file

[Desktop Entry]
Type=Application
Version=1.0
GenericName=Vivado
Name=Vivado
Comment=Vivado
TryExec=/opt/Xilinx/Vivado/2017.2/bin/vivado
Exec=/opt/Xilinx/Vivado/2017.2/bin/vivado
Icon=
Terminal=false
Categories=Education;System
StartupNotify=false
X-GNOME-Autostart-Delay=5

When done, log out-in in order to refresh the systems settings.

Vivado should be available from start-menu and can be copied to the desktop for future executions.

Docker: Remove all images and containers

Problem:

You use Docker, but working with it created lots of images and containers. You want to remove all of them to save disk space.

Solution:

Warning: This will destroy all your images and containers. It will not be possible to restore them!

Run those commands in a shell:
# Delete all containers
sudo docker rm $(docker ps -a -q)
# Delete all images
sudo docker rmi $(docker images -q)

This solution has be proposed by GitHub user @crosbymichael in this issue

Back to top