Skip to content

Instantly share code, notes, and snippets.

View inceabdullah's full-sized avatar
🏢
Working from office

inceabdullah

🏢
Working from office
View GitHub Profile
@inceabdullah
inceabdullah / redis-increment-keyN.md
Created November 4, 2022 11:28
redis-increment-keyN.md
127.0.0.1:6379> eval 'return redis.call("set", "item:" .. redis.call("incr","itemNCounter"), "item value")' 0
OK
127.0.0.1:6379> keys item:*
 1) "item:10"
 2) "item:14"
 3) "item:13"
 4) "item:6"
 5) "item:15"
@inceabdullah
inceabdullah / screen_aliases.sh
Last active November 15, 2022 08:18
Screen Command Aliases
# screen command aliases
alias lsscreen='screen -ls'
alias scrs='screen -S'
alias scrx='screen -x'
alias scrr='screen -r'
alias scrname='f() { echo $STY; }; f'
# Functions
# scrkill <STY>
@inceabdullah
inceabdullah / kill_process_by_port_number.sh
Created August 16, 2022 22:26
Kill process by port number
kill -9 `ss -lpnt | grep 8080 | sed 's/.*pid=//' | sed 's/,fd.*//'`
@inceabdullah
inceabdullah / .bash_alias_myip.sh
Last active August 17, 2023 08:27
My Public IP UNIX Alias
alias myip='f() { dig +short myip.opendns.com @resolver1.opendns.com; }; f'
alias myipv6='f() { dig -t aaaa +short myip.opendns.com @resolver1.opendns.com;
}; f'
@inceabdullah
inceabdullah / enter-password-prompt.md
Created June 10, 2022 06:21
Enter Password Prompt
echo -n "Enter Password: " && head -1 </dev/stdin | tr -d '\n' | sha256sum | cut -d" " -f1
@inceabdullah
inceabdullah / .Colored Command-line Prefix Macbook zsh.md
Last active June 1, 2022 06:51
Colored Command-line Prefix Macbook zsh
autoload -U colors && colors
PS1="%{$fg[cyan]%}mac %{$reset_color%}% | %{$fg_bold[red]%}%n %{$reset_color%}% | %{$fg[green]%}%~  %{$reset_color%}% %F{#61BFFD}% # %{$reset_color%}% %F{#00E000}%B "

root user uses sh default shell, change with

chsh -s /bin/bash root

for root user use /var/root/.bash_profile instead of .bashrc file when login with ssh, but not sudo bash

@inceabdullah
inceabdullah / Graylog-docker-compose-syslog-ng-udp-pm2.md
Last active May 26, 2022 04:54
graylog-docker-compose-syslog-ng-udp-pm2

pm2

Install

pm2 install pm2-gelf

Conf

pm2 set pm2-gelf:graylogHostname 127.0.0.1
pm2 set pm2-gelf:graylogPort 12201
@inceabdullah
inceabdullah / scan-IPs-ESXI
Created May 22, 2022 16:36
Scan IPs for ESXI
nmap --script vmware-version -p443 172.16.1.1-255
@inceabdullah
inceabdullah / openVPN-in-network-namespace-masquerade.sh
Last active October 29, 2022 13:48
openVPN-in-network-namespace-VPN-Gateway-masquerade.sh
IFACE="wlan0"
NS="vpn-1"
VETH="veth"
VPEER="vpeer"
VETH_ADDR="10.0.0.1"
VPEER_ADDR="10.0.0.2"
VPN_PRIVATE_NETWORK="192.168.0.0/24"
VPN_IFACE="tun0"
# Create namespace
@inceabdullah
inceabdullah / openVPN-in-network-namespace.sh
Last active May 15, 2022 10:23
openVPN-in-network-namespace.sh
export IFACE="eth0"
export MACVTAP="macvtap1"
export ADDR="192.168.1.102"
export GW_ADDR="172.168.1.1"
export NS="vpn"
ip l a macvtap1 link $IFACE type macvtap mode bridge
ip netns a $NS
ip l s macvtap1 netns $NS
ip netns exec $NS bash