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 / 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 / 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 / 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 / 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 / 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 / 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 / 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 / locale_issue_zsh.md
Created August 3, 2019 07:14
zsh (anon):12: character not in range error

zsh | (anon):12: character not in range

Solution:

sudo apt-get install -y language-pack-en
sudo update-locale

Then zsh starts working!

@jadia
jadia / openvpn_on_openvz.md
Created August 9, 2019 14:33
Using OpenVPN on OpenVZ based machine

Using OpenVPN on OpenVZ based machine

Comment out the LimitNPROC line in /lib/systemd/system/openvpn@.service.

Then run systemctl daemon-reload

Restart the openvpn service

systemctl restart openvpn@server.service

@jadia
jadia / tmux_centos.md
Last active September 6, 2019 07:30
Install tmux latest version in CentOS 7

Install Tmux in CentOS 7

Remove tmux 1.8 and install

sudo yum remove tmux -y && \
git clone https://github.com/tmux/tmux.git && \
sudo yum install libevent-devel -y && \
sudo yum install ncurses-devel.x86_64 -y && \
cd tmux &amp;&amp; \