Skip to content

Instantly share code, notes, and snippets.

@amatsumara
amatsumara / my-dns.sh
Created May 2, 2018 10:58
Check actual dns server used for current connection
ping -c1 whoami.fluffcomputing.com
ping -c1 whoami.akamai.net
#
include GENERIC
ident superserver
nomakeoptions DEBUG
nodevice fdc
nodevice cbb # cardbus (yenta) bridge
reg add HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System /v LocalAccountTokenFilterPolicy /t REG_DWORD /d 1 /f
@amatsumara
amatsumara / myip-cmd.sh
Last active October 8, 2021 13:19
check IP I'm going to Internet with
#
# https://unix.stackexchange.com/questions/22615/how-can-i-get-my-external-ip-address-in-a-shell-script
dig +short myip.opendns.com @resolver1.opendns.com
curl https://api.my-ip.io/ip
@amatsumara
amatsumara / make.conf
Created August 31, 2017 08:56
FreeBSD make.conf
# You can use /etc/make.conf to control the options used to compile software
# on this system. Example entries are in
# /usr/share/examples/etc/make.conf.
#CFLAGS+= -mtune=opteron-sse3
KERNCONF=superserver
#OPTIONS_SET=IPV6
#OPTIONS_UNSET=X11
@amatsumara
amatsumara / PS1
Last active April 16, 2017 00:10
#!/usr/bin/env bash
# .bashrc
# Unprivileged [green]
export PS1='\A[\l]\[\033[0m\033[32m\]\u\[\033[1m\033[37m\]@\[\033[0m\033[32m\]\h:\[\033[0m\033[37m\]\w>'
# Privileged [red]
# PS1='\A[\l]\[\e[0m\e[1;31m\]\u\[\e[1m\e[37m\]@\[\e[0m\e[32m\]\h:\[\e[0m\e[37m\]\w>'
rsync -av --delete -e "ssh -p2222" <src> <dst>
#!/usr/local/bin/bash
tar=/usr/bin/tar
${tar} --exclude backups -czf file_`date +%F_%H%M%S`.tar.gz /path/something
# tar -cJf file_`date +%F_%H%M%S`.tar.xz /path/something
(Get-Process chrome | Measure-Object WorkingSet -sum).sum
(Get-Process firefox | Measure-Object WorkingSet -sum).sum