Skip to content

Instantly share code, notes, and snippets.

View raja-ashok's full-sized avatar

Raja Ashok raja-ashok

View GitHub Profile
cmake -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON .
make
1) Command to update API symbols in util/libcrypto.num file
perl "-I." util/mkdef.pl crypto update
@raja-ashok
raja-ashok / python_cheatsheet.txt
Last active June 14, 2019 14:12
Python CheatSheet
1. Main Function
if __name__ == "__main__":
2. CLI arg count
len(sys.argv)
2.1 CLI args
sys.arg[0]
sys.arg[1]
To Setup
sudo apt install hplip
sudo hp-setup -i
To scan and get soft copy
hp-scan
grep -E "colou?r" * -R
- Matches both "colour" and "color"
1) Git SSH configuation
Generate RSA key pair
- ssh-keygen -t rsa -b 4096 -C "your_email@domain.com"
- This generates 2 file, id_rsa and id_rsa.pub in ~/.ssh directory.
- Copy the content of id_rsa.pub and configure in the git settings under the account details.
Then after opening terminal, always execute below 2 command to load the RSA private key (id_rsa).
After loading, all git commands can be executed without entering credentials every time.
- eval $(ssh-agent -s)
- ssh-add ~/.ssh/id_rsa
for loop
count=5
for i in $(seq $count); do
echo $i
done
@raja-ashok
raja-ashok / .bashrc
Last active March 25, 2020 15:56
bashrc
parse_git_branch() {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/'
}
netns_name() {
str=`ip netns identify $$`
[[ "$str" != "" ]] && echo "\033[1;35m[$str]\033[0m " && return
}
export PS1="\u@\h\[\033[32m\]\w\[\033[33m\]\$(parse_git_branch)\[\033[00m\]\n$ "
eval $(ssh-agent -s)
@raja-ashok
raja-ashok / cscope
Last active June 17, 2018 11:52
cscope
#!/bin/bash
CSCOPE_DIR="$PWD/cscope"
echo_usage()
{
echo "Usage: $0 gen|reset [folder]"
exit -1
}
@raja-ashok
raja-ashok / tc_cmd.sh
Created April 30, 2018 06:32
TC command
tc qdisc add dev <interface_name> root netem delay 120ms
tc qdisc delete dev <interface_name> root netem
tc qdisc add dev <interface_name> root netem loss 2%