This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
~ > cat .hammerspoon/init.lua | |
# activate / deactivate kitty | |
hs.hotkey.bind({"ctrl", "shift"}, "`", function() | |
local app = hs.application.get("kitty") | |
if app then | |
if not app:mainWindow() then | |
app:selectMenuItem({"kitty", "New OS window"}) | |
elseif app:isFrontmost() then | |
app:hide() | |
else |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mod rxx; | |
fn main() -> Result<(), Box<dyn std::error::Error>> { | |
let v = rxx::my_ip()?; | |
println!("{}", v); // println!("{:#?}", v); | |
Ok(()) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
From https://cbonte.github.io/haproxy-dconv/1.7/configuration.html#8.5 | |
Session state at disconnection | |
TCP and HTTP logs provide a session termination indicator in the | |
"termination_state" field, just before the number of active connections. It is | |
2-characters long in TCP mode, and is extended to 4 characters in HTTP mode, | |
each of which has a special meaning : | |
- On the first character, a code reporting the first event which caused the |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
> Thank you for reaching out to Autonomous! I am sorry to hear that you are having some trouble with your SmartDesk | |
> but I will be glad to assist. It sounds like your system needs a "hard reset" can I please have you follow these | |
> steps thoroughly. | |
Reset Steps: | |
1. Unplug the desk for 20 seconds. Plug it back in. Wait a full 20 seconds. | |
2. Press the up and down buttons until the desk lowers all the way and beeps or 20 seconds pass. | |
3. Release both buttons. | |
4. Press the down buttons until the desk beeps one more time or 20 seconds pass. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -x | |
set -e | |
yum -y install net-snmp net-snmp-utils | |
yum -y install wget vim csh | |
mkdir megaraid | |
cd megaraid | |
wget http://docs.avagotech.com/docs-and-downloads/raid-controllers/raid-controllers-common-files/MSM_linux_x64_installer-15-05-01-00-tar.gz |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
from subprocess import Popen, PIPE | |
def git_history(commit_from, commit_to): | |
cmd=["git", "log", "--pretty=oneline", "--grep", "'[[:digit:]]\{2,\}'", "--grep", "'issue\|feature\|bug'", "--max-parents=1", "{}...{}".format(commit_from, commit_to)] | |
cmd = " ".join(cmd) | |
p = Popen(cmd, stdout=PIPE, stderr=PIPE, shell=True) | |
return p.communicate() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import urllib2 | |
import json | |
from StringIO import StringIO | |
import base64 | |
#==== configurations ======= | |
username = "[email protected]" | |
password = "naked_password" | |
src_repo = "octocat/Hello-World" | |
dst_repo = "helloworld-inc/Hello-World" |