Skip to content

Instantly share code, notes, and snippets.

View 54keesh's full-sized avatar
💭
Working on web

M kashif 54keesh

💭
Working on web
View GitHub Profile
@54keesh
54keesh / git_pull.apache
Created July 21, 2024 19:58
git pull via other user in apache/nginx based deployments
OPTIONAL
ensure pulling is possible via www-data user
-> sudo -u www-data git pull
if not add it in visudo
-> git ALL = (www-data) /usr/bin/git pull
add ubuntu to www-data group
-> sudo usermod -aG www-data ubuntu
@54keesh
54keesh / ssh-hostname-unhash.sh
Created July 15, 2024 07:37 — forked from xxorax/ssh-hostname-unhash.sh
Unhash the hostnames hashed in your known_hosts file by passing their names.
#!/bin/bash
# based on http://unix.stackexchange.com/questions/175071/how-to-decrypt-hostnames-of-a-crypted-ssh-known-hosts-with-a-list-of-the-hostna/175199#175199
function replace {
host="$1"
found=$(ssh-keygen -F "$host" 2>/dev/null | grep -v '^#' | sed "s/^[^ ]*/$host/")
if [ -n "$found" ]; then
ssh-keygen -R "$host" &>/dev/null
echo "$found" >>~/.ssh/known_hosts
echo "Found and replaced: $host"
@54keesh
54keesh / multiple_ssh_setting.md
Created February 2, 2024 11:55 — 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 "[email protected]"
@54keesh
54keesh / multiple_ssh_setting.md
Created February 2, 2024 11:55 — 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 "[email protected]"
@54keesh
54keesh / .tmux.conf
Created February 2, 2024 08:25 — forked from justinwalz/.tmux.conf
basic tmux conf
# allow reload of this file with PRE r
bind r source-file ~/.tmux.conf \; display "Reloaded."
# switch prefix to control-a, unmap b, allow double-a to go through
set -g prefix C-a
unbind C-b
bind C-a send-prefix
# -r repeat time (Default 500 millis)
set -g repeat-time 2000
@54keesh
54keesh / install.md
Created December 17, 2022 15:18 — forked from Ryanb58/install.md
How to install telnet into a alpine docker container. This is useful when using the celery remote debugger in a dev environment.
>>> docker exec -it CONTAINERID /bin/sh
/app # telnet
/bin/sh: telnet: not found

/app # apk update
fetch http://dl-cdn.alpinelinux.org/alpine/v3.7/main/x86_64/APKINDEX.tar.gz
fetch http://dl-cdn.alpinelinux.org/alpine/v3.7/community/x86_64/APKINDEX.tar.gz
v3.7.0-243-gf26e75a186 [http://dl-cdn.alpinelinux.org/alpine/v3.7/main]
v3.7.0-229-g087f28e29d [http://dl-cdn.alpinelinux.org/alpine/v3.7/community]
@54keesh
54keesh / tmux-cheatsheet.markdown
Last active December 13, 2022 14:45 — forked from MohamedAlaa/tmux-cheatsheet.markdown
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@54keesh
54keesh / tmux.md
Created December 8, 2022 22:00 — forked from andreyvit/tmux.md
tmux cheatsheet

tmux cheat sheet

(C-x means ctrl+x, M-x means alt+x)

Prefix key

The default prefix is C-b. If you (or your muscle memory) prefer C-a, you need to add this to ~/.tmux.conf:

remap prefix to Control + a