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 / ubuntu16.04_kernel_upgrade.md
Created July 27, 2019 18:42
Update/Upgrade kernel on Ubuntu 16.04 server

Update/Upgrade kernel on Ubuntu 16.04 server

This solves the issue where apt upgrade does not upgrade the kernel version.

Just doing apt upgrade won't work. We might need to give special attention to some packages.

sudo apt-get upgrade linux-generic linux-headers-generic linux-image-generic
@jadia
jadia / i3_kde_debian_screenshot.md
Created July 27, 2019 09:53
i3 KDE Debian screenshot utility

Enable screenshot using in i3wm Debian KDE

mkdir -p ~/Pictures/Screenshots

Add the following lines in your i3 config:

# Printscreen controls (KDE)
@jadia
jadia / i3_dolphins.md
Created July 27, 2019 09:02
i3 Dolphin icons not showing

i3 Dolphin icons not showing

Add the following line on your i3 config file

bindsym $mod+n exec bash -c "XDG_CURRENT_DESKTOP=KDE && dolphin"

Run using $mod+n

@jadia
jadia / mysqlDumpDatabase.md
Created July 19, 2019 07:14
Take MySQL dump of a database

Take MySQL dump of a database or backup the database

mysqldump -u root -pYOUR-PASSWORD-HERE DATABASE-NAME > myDbData.sql

P.S.:- No space between your passowrd and -p

Todo:

@jadia
jadia / certbotCommand.md
Created July 18, 2019 09:48
Create certificates for website using certbot

create a clone of certbot git repo or install certbot

sudo ./certbot-auto certonly -m test@example.com --agree-tos --manual --no-eff-email --manual-public-ip-logging-ok --preferred-challenges http  -d test1.example.com

This will give crt and key.

@jadia
jadia / ansible_check_process_status.yaml
Last active July 16, 2019 14:43
Ansible: Check if a process is already running
# Check if process is already running if not then set the false flag
- name: Check if authCheck process is running
shell: |
bash -c "if lsof /usr/local/sshAuthKeyNotify.sh ; then
echo 'Process ALREADY running'
true
else
echo 'PROCESS NOT RUNNING'
false
fi"
@jadia
jadia / getTeamListGithub.md
Created July 9, 2019 07:12
Get all team members list using Github API v3

Get list of all the teams in your organization

GITHUB_TOKEN=<YOUR-GITHUB-TOKEN-WITH-org:read-CHECKED>
GITHUB_ORG=<YOUR ORGANIZATION>
curl -sH "Authorization: token $GITHUB_TOKEN" https://api.github.com/orgs/$GITHUB_ORG/teams\?per_page\=100

Note the "id": for the Team of your choice Ex: "id": 68705"

@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:

@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 / 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