Skip to content

Instantly share code, notes, and snippets.

View jadia's full-sized avatar
💭
Progress beats Perfect.

Nitish Jadia jadia

💭
Progress beats Perfect.
View GitHub Profile
@jadia
jadia / alt_ctrl_ubuntu_workspace.md
Last active January 26, 2019 05:12
Force alt + tab to switch only on current workspace in GNOME shell

Force alt + tab to switch only on current workspace in GNOME shell. Here is the solution I came up with:

Very fast & easy, without any installations/extensions:

  1. Install dconf-editor (already installed on current debian/ubuntu distributions):

    sudo apt-get install dconf-editor
    
  2. Open dconf-editor (from the Dash or a Terminal)

@jadia
jadia / git_pull_hard.md
Created January 26, 2019 15:21
New repository doesn't match with existing local repo

git pull origin master --allow-unrelated-histories

@jadia
jadia / youtube-dl_playlist_formatted.md
Created January 31, 2019 13:35
youtube-dl playlist download command

Download playlist using youtube-dl in formatted manner

sudo youtube-dl -ic -o '%(playlist_index)s. %(title)s.%(ext)s' https://www.youtube.com/.....
@jadia
jadia / git_deleted_files.md
Last active February 1, 2019 05:05
Git commit all deleted files

Git commit all deleted files

git add -u

man from git-add

-u, --update
@jadia
jadia / dpkg_daily_update_lock.md
Last active August 18, 2019 09:04
dpkg lock held by daily update ubuntu 18 server
root@acer:/home/stephen# apt install htop
 E: Could not get lock /var/lib/dpkg/lock - open (11: Resource temporarily unavailable)
 E: Unable to lock the administration directory (/var/lib/dpkg/), is another process using it?

disable that headache with:

sudo systemctl disable apt-daily.timer && \
sudo systemctl disable apt-daily-upgrade.timer
@jadia
jadia / config_edit_script.md
Created February 7, 2019 11:30
Change entry in a config file

Change an entry in a config file using sed in bash.

sed -r '/PasswordAuthentication/ s/^#/ /; s/(PasswordAuthentication ).*$/\1 no/' ssh_config
        ^ pattern to match        ^remove                             ^ change value
                                  comment
@jadia
jadia / noOfSSHconnections.md
Created May 30, 2019 06:33
Check number of SSH connection to the server
sudo netstat -tpna | grep 'ESTABLISHED.*sshd'
@jadia
jadia / createCertDocker.md
Created June 20, 2019 09:59
Create docker certificate using Docker Image
docker run -it --rm --name certbot -v "/root/letsencrypt/etc/letsencrypt:/etc/letsencrypt" -v "/root/letsencrypt/ssl/var/lib:/var/lib/letsencrypt" -v "/root/letsencrypt/ssl/cloudflare.ini:/tmp/cloudflare.ini:ro" certbot/dns-cloudflare certonly --server https://acme-v02.api.letsencrypt.org/directory --agree-tos --dns-cloudflare --dns-cloudflare-credentials /tmp/cloudflare.ini --dns-cloudflare-propagation-seconds 60 --email nitish.jadia@rtcamp.com --manual-public-ip-logging-ok --no-eff-email --renew-by-default --text -d nitish.rt.gw
@jadia
jadia / certbotDocker.md
Created June 21, 2019 13:31
Create certificates for your website using Certbot

Create certificates for your website using Certbot

mkdir $PWD/certbotFiles/ && \
docker run -it --rm --name certbot \
-v "$PWD/certbotFiles/etc/letsencrypt:/etc/letsencrypt" \
-v "$PWD/certbotFiles/var/lib:/var/lib/letsencrypt" \
-p 80:80 \
certbot/certbot certonly \
--standalone \
@jadia
jadia / keybase.md
Last active September 28, 2019 22:09
Keybase Proof

Keybase proof

I hereby claim:

  • I am jadia on github.
  • I am jadia (https://keybase.io/jadia) on keybase.
  • I have a public key ASDTXJBzCKwVJRFjk-gdVrjkl3VetlLq5ROyrVKoJHqqzwo

To claim this, I am signing this object: