Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
Focusing

Amos Bird amosbird

🎯
Focusing
  • kuaishou.com
  • Beijing
View GitHub Profile
View gist:af1058d7bbe7520bf48fa4214f9a8dca
I have an vpn tunnel which generates this device
22: tun0: <POINTOPOINT,MULTICAST,NOARP,UP,LOWER_UP> mtu 1390 qdisc fq_codel state UNKNOWN group default qlen 500
link/none
inet 172.19.60.64/32 scope global tun0
valid_lft forever preferred_lft forever
@amosbird
amosbird / diskcheck.sh
Last active Aug 17, 2017
check disk failures using megacli
View diskcheck.sh
#!/usr/bin/env bash
while [[ 1 ]]; do
nd=$(sudo /opt/MegaRAID/MegaCli/MegaCli64 -PDList -aALL | grep "Firmware state: Online, Spun Up" | wc -l)
if [[ nd -ne <YOU DISK NUM> ]];
then
echo "check it using sudo /opt/MegaRAID/MegaCli/MegaCli64 -PDList -aALL" | mail -s "$HOSTNAME has disk failure!!" <YOU EMAIL ADDRESS>
sleep 3600
fi
@amosbird
amosbird / ahk.ahk
Created Aug 16, 2017
better windows experience
View ahk.ahk
#SingleInstance force
Loop, %0% ; For each parameter:
{
param := %A_Index% ; Fetch the contents of the variable whose name is contained in A_Index.
params .= A_ralt . param
}
ShellExecute := A_IsUnicode ? "shell32\ShellExecute":"shell32\ShellExecuteA"
if not A_IsAdmin
View xinput
❯ xinput --list-props 10 (53s 637ms)
Device 'Lite-On Technology Corp. ThinkPad USB Keyboard with TrackPoint':
Device Enabled (138): 1
Coordinate Transformation Matrix (140): 1.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 1.000000
libinput Accel Speed (276): 1.000000
libinput Accel Speed Default (277): 0.000000
libinput Accel Profiles Available (278): 1, 1
libinput Accel Profile Enabled (279): 1, 0
libinput Accel Profile Enabled Default (280): 1, 0
libinput Natural Scrolling Enabled (281): 0
View Keyboard remapping
❯ cat /usr/share/X11/xkb/symbols/altwin
// Meta is mapped to second level of Alt keys.
partial modifier_keys
xkb_symbols "meta_alt" {
key <LALT> { [ Alt_L, Meta_L ] };
key <RALT> { type[Group1] = "TWO_LEVEL",
symbols[Group1] = [ Hyper_R ] };
modifier_map Mod1 { Alt_L, Alt_R, Meta_L, Meta_R };
modifier_map Mod3 { Hyper_R };
// modifier_map Mod4 {};
View Keyboard remapping
❯ cat /usr/share/X11/xkb/symbols/altwin
View cvimrc
set nosmoothscroll
set noautofocus
" set debugcss
" set cncpcompletion
" set nohud
" set nodimhintcharacters
" set typelinkhints
let mapleader = ';'
let searchlimit = 25
let completionengines = ['google', 'wikipedia', 'imdb', 'amazon']
@amosbird
amosbird / restore.sh
Last active Dec 1, 2018
restore configurations.
View restore.sh
#!/usr/bin/env bash
export PATH=$HOME/bin:$PATH
# Centos 6
# install binutil https://ftp.gnu.org/gnu/binutils/
./configure --prefix=$HOME
make -j`nproc`
make install
View keybase.md

Keybase proof

I hereby claim:

  • I am amosbird on github.
  • I am amosbird (https://keybase.io/amosbird) on keybase.
  • I have a public key ASBpNSfNn7MYBhGGoMBk1hdYR-4YP8hsAQtKiKBJFnncbgo

To claim this, I am signing this object:

@amosbird
amosbird / info.txt
Created Nov 2, 2015 — forked from phrawzty/info.txt
python27 in CentOS via SCL on Socorro Vagrant
View info.txt
(socorro-virtualenv)[vagrant@localhost ~]$ cat /etc/centos-release
CentOS release 6.4 (Final)
(socorro-virtualenv)[vagrant@localhost ~]$ sudo yum install centos-release-SCL
[...]
================================================================================
Package Arch Version Repository Size
================================================================================
Installing: