Get captions from Youtube video

(…not video’s subtitle) 1youtube-dl --o "%(title)s.%(id)s.%(ext)s" $URL; # first stop 2youtube-dl --sub-lang en --write-auto-sub --sub-format srt --skip-download -o "%(title)s.%(id)s.%(ext)s" $URL; # and finally if you’re using mpv as video player, use v to display captions.

2020-01-21 · G2G

Choose a public DNS server for more privacy

You have to prepend a nameserver in resolv.conf file. Follow this quick guide in KISS mode (Keep It Simple and Stupid). create (if not exits) /etc/dhclient.conf file with interface "eth0" { prepend domain-name-servers 9.9.9.9; } for testing purpose 1dhclient eth0 -v 2cat /etc/resolv.conf by this way, it will be the first DNS server to be querying for domain name. some public DNS servers easy to remember: 1.1.1.1 (Cloudflare) 9.9.9.9 (Quad9) More public DNS servers ...

2020-01-15 · G2G

Detect virtualization technology used by the OS

detect virtualization technology 1dmidecode -s system-product-name || systemd-detect-virt source

2019-11-17 · G2G

Transfer easily files for Android devices in SFTP mode

Transfer files for Android devices with Primitive FTPd server (ftp/sftp) Download Primitive FTPd Apk From Fdroid website From Fdroid MarketPlace From Google Play Configure Primitive FTPd set a password for user (Primitive FTPd default username) disable ftp server (SFTP only) launch Primitive FTPd server upload authorized_keys 1cat <<EOF> authorized_keys 2ssh-rsa ...my super secure rsa pubkey 3EOF 4chmod 0700 authorized_keys 5sftp -P 1234 user@<ip_displayed_by_primitive_ftpd> 6> mkdir .ssh 7> cd .ssh 8> put authorized_keys enable “Authentication Public Key” restart Primitive FTPd server Configure your machine mount it for test purpose (or temporarily) 1mkdir $HOME/droid 2sshfs -p 1234 -o idmap=user user@<ip_displayed_by_primitive_ftpd>: $HOME/droid # mount 3fusermount3 -u $HOME/droid # umount mount it via fstab 1# in root mode 2cat <<EOF>> /etc/fstab 3user@<ip_displayed_by_primitive_ftpd>: /home/user/droid fuse.sshfs noauto,x-systemd.automount,_netdev,port=1234,users,idmap=user,IdentityFile=/home/user/.ssh/id_rsa,allow_other,reconnect 0 0 4EOF 5mount $HOME/droid # mount 6umount $HOME/droid # umount Sources SSHFS on Archlinux Wiki That’ s all ! ...

2019-10-06 · G2G

Generate Ansible snippets for VIm completion

With one python script, get an UltraSnips file for VIm Ansible modules completion from Ansible 2.2.1.0 and Python 2.7.13. Build A Debian 9 Stretch VM 1mkdir debian && cd debian 2vagrant init debian/stretch64 3vagrant ssh Generate UltraSnips File 1apt-get install -y ansible git 2git clone https://github.com/z0mbix/ansible_snippet_generator /tmp/snippet_generator 3/tmp/snippet_generator/snippet_generator.py --ultisnips /usr/lib/python2.7/dist-packages/ansible/modules > /vagrant/ansible.snippets Sources Ansible Snippet Generator Git Repo That’s all !

2019-01-26 · G2G

Blogging with Minimal Mistakes Jekyll theme

PROS: Github / Gitlab Pages compatible (host your static blog on Github ) all gems embedded (good for migration / reinstallation / testing in local) create easily new post with Octopress (embedded too) CONS: bad performance for generating static pages with big blogs (unlike with Hugo) made in Ruby CLI addicted :) Install in Github Pages mode use bundle 2.0 all gems are embedded in repository’s ./vendor/bundle folder 1git clone git@github.com:mmistakes/minimal-mistakes.git myrepo.github.io 2cd myrepo.github.io/ 3rm Gemfile 4bundle init 5bundle install --path vendor/bundle # embedded gems 6bundle add github-pages --group=jekyll_plugins 7bundle add minimal-mistakes-jekyll 8bundle exec jekyll serve --watch # run in reload mode Add new content with Octopress automate the creation of new posts and pages for easier management 1bundle add jekyll-paginate octopress 2bundle exec octopress new post "Blogging with Minimal Mistakes Jekyll theme" 3# TIP: alias for octopress 4cat << EOF >> $HOME/.bashrc 5alias octopress='bundle exec octopress' 6EOF Deploy to Github Pages 1# NEED: create myrepo.github.io repository in your Github repo 2cd myrepo.github.io 3git remote set origin git@github.com:myrepo/myrepo.github.io.git 4git remote add upstream git@github.com:mmistakes/minimal-mistakes.git 5git add . 6git commit -am "My first post" 7git push -u origin --all 8xdg-open https://myrepo.github.io # access to your personal blog Link to your custom domain on your repository root directory: set your custom domain 1cat <<EOF> CNAME 2mydomain.net 3EOF 4sed -ri 's#^(url.*: ).*#\1"https://mydomain.net"#' _config.yml on https://github.com/myrepo: Settings tab # Github pages > Custom domain : mydomain.net Save on your DNS provider: Set A records with: mydomain.net. 26735 IN A 185.199.108.153 mydomain.net. 26735 IN A 185.199.109.153 mydomain.net. 26735 IN A 185.199.110.153 mydomain.net. 26735 IN A 185.199.111.153 Sources Minimal Mistakes documentation Github Pages dependencies and versions Bundle with Jekyll

2019-01-16 · G2G