Skip to content

Instantly share code, notes, and snippets.

View pavanyogi's full-sized avatar
🎯
Focusing

Pavan Yogi pavanyogi

🎯
Focusing
  • Bengaluru, India.
View GitHub Profile

How to follow this guide

The problem

I have one computer and two different github accounts. One is for work, the other is for my personal stuff. I can't use the same ssh key twice, so I have to use different ssh key for each of my accounts. How do I do that? How do I switch between these ssh keys?

Problem

I have two Github accounts: oanhnn (personal) and superman (for work). I want to use both accounts on same computer (without typing password everytime, when doing git push or pull).

Solution

Use ssh keys and define host aliases in ssh config file (each alias for an account).

How to?

  1. Generate ssh key pairs for accounts and add them to GitHub accounts.
@pavanyogi
pavanyogi / multiple_ssh_setting.md
Created March 16, 2022 11:28 — forked from jexchan/multiple_ssh_setting.md
Multiple SSH keys for different github accounts

Multiple SSH Keys settings for different github account

create different public key

create different ssh key according the article Mac Set-Up Git

$ ssh-keygen -t rsa -C "your_email@youremail.com"
@pavanyogi
pavanyogi / self-signed-ssl-certificate.md
Created February 23, 2022 10:33 — forked from clemlatz/self-signed-ssl-certificate.md
Setup a self-signed SSL certificate with Nginx (server and browser)

1. Configure server: Nginx

Create the certificate:

$ sudo openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout /etc/ssl/private/nginx-selfsigned.key -out /etc/ssl/certs/nginx-selfsigned.crt

Create a strong Diffie-Hellman group:

$ sudo openssl dhparam -out /etc/ssl/certs/dhparam.pem 2048
@pavanyogi
pavanyogi / self-signed-ssl-certificate.md
Created February 23, 2022 10:32 — forked from josephdicdican/self-signed-ssl-certificate.md
Setup a self-signed SSL certificate with Nginx (server and browser)

1. Configure server: Nginx

Create the certificate:

$ sudo openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout /etc/ssl/private/nginx-selfsigned.key -out /etc/ssl/certs/nginx-selfsigned.crt

Create a strong Diffie-Hellman group:

$ sudo openssl dhparam -out /etc/ssl/certs/dhparam.pem 2048
@pavanyogi
pavanyogi / curl.md
Created February 21, 2022 15:06 — forked from subfuzion/curl.md
curl POST examples

Common Options

-#, --progress-bar Make curl display a simple progress bar instead of the more informational standard meter.

-b, --cookie <name=data> Supply cookie with request. If no =, then specifies the cookie file to use (see -c).

-c, --cookie-jar <file name> File to save response cookies to.

<?php
define('BOT_TOKEN', 'XXXXXXXX:XXXXXXXXXXXXXXXXXXXXXXXX'); // place bot token of your bot here
function checkTelegramAuthorization($auth_data) {
$check_hash = $auth_data['hash'];
unset($auth_data['hash']);
$data_check_arr = [];
foreach ($auth_data as $key => $value) {
$data_check_arr[] = $key . '=' . $value;
<?php
define('BOT_TOKEN', 'XXXXXXXX:XXXXXXXXXXXXXXXXXXXXXXXX'); // place bot token of your bot here
function checkTelegramAuthorization($auth_data) {
$check_hash = $auth_data['hash'];
unset($auth_data['hash']);
$data_check_arr = [];
foreach ($auth_data as $key => $value) {
$data_check_arr[] = $key . '=' . $value;
@pavanyogi
pavanyogi / auto-remove-sublime-license-popup
Created January 18, 2022 07:49 — forked from egel/auto-remove-sublime-license-popup
Auto-remove Sublime's license popup
#!/usr/bin/python
# -*- coding: utf-8 -*-
import sublime_plugin
import subprocess
from time import sleep
import sys
cl = lambda line: subprocess.Popen(line, shell=True, stdout=subprocess.PIPE).communicate()[0].strip()
log = lambda message: sys.stderr.write("Log: %s\n" % message)
@pavanyogi
pavanyogi / battery-full.sh
Last active September 21, 2022 12:08
set battery full charge alert notification with sound play
#!/bin/bash
# sudo apt install acpi
# cd
# wget https://gist.githubusercontent.com/pavanyogi/681fa31cd2fce0b1c8123f42e98f2053/raw/56ef38e90e6d6bdcacb1aba23b57b7ced8838699/battery-full.sh
# sudo chmod -v +x battery-full.sh
# sudo mv -v battery-full.sh /usr/local/bin
# add the command to startup applications
# /usr/local/bin/battery-full.sh
COUNTER=10
while true; do