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
http://cgit.freedesktop.org/xorg/app/edid-decode/plain/edid-decode.c | |
compile with: | |
gcc edid-decode.c -o edid-decode | |
get EDID from IORegistryExplorer (mine, an old 24" Apple Cinema Display, is attached). | |
Convert to binary with this command: | |
ruby -e 'File.open("edid", "wb").write(File.read("edid.txt").split.map { |s| ("0x"+s).to_i(16) }.inject("", "<<"))' |
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
/* Copied, Pasted and summarized from ps' source code. | |
You can use sysctl to get other process' argv. | |
*/ | |
#include <sys/sysctl.h> | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#define pid_of(pproc) pproc->kp_proc.p_pid |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<rss version="2.0" | |
xmlns:content="http://purl.org/rss/1.0/modules/content/" | |
xmlns:dsq="http://www.disqus.com/" | |
xmlns:dc="http://purl.org/dc/elements/1.1/" | |
xmlns:wp="http://wordpress.org/export/1.0/" | |
> | |
<channel> | |
<item> | |
<!-- title of article --> |
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
#!/usr/bin/env python2 | |
""" | |
Other Repositories of python-ping | |
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | |
* https://github.com/l4m3rx/python-ping supports Python2 and Python3 | |
* https://bitbucket.org/delroth/python-ping |
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 socket | |
minissdpdSocket = '/var/run/minissdpd.sock' # The socket for talking to minissdpd | |
# Sends a message to the given socket | |
def sendMessage(message): | |
s = socket.socket(socket.AF_UNIX) | |
s.settimeout(1) # 1 second timeout, after all it should be instant because its local | |
s.connect(minissdpdSocket) | |
s.send(message) |
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
tell application "Google Chrome" | |
set windowList to every tab of every window whose URL starts with "https://mail.google.com" | |
repeat with tabList in windowList | |
set tabList to tabList as any | |
repeat with tabItr in tabList | |
set tabItr to tabItr as any | |
delete tabItr | |
end repeat | |
end repeat | |
end tell |
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
#!/usr/bin/perl | |
# Easy port scanner | |
# I wrote this in the 90s to help learn socket programming | |
# ./quickscan -h for usage | |
use Socket; | |
$| = 1; # so \r works right | |
my ($ip, $protocol, $port, $myhouse, $yourhouse, $log); |
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
(* To the extent possible under law, Rob Mayoff has waived all copyright and related or neighboring rights to “AppleScript to make Google Chrome open/reload a URL”. This work is published from: United States. https://creativecommons.org/publicdomain/zero/1.0/ *) | |
tell application "Google Chrome" | |
activate | |
set theUrl to "http://tycho.usno.navy.mil/cgi-bin/timer.pl" | |
if (count every window) = 0 then | |
make new window | |
end if | |
set found to false |
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
# Usage: | |
# source iterm2.zsh | |
# iTerm2 tab color commands | |
# https://iterm2.com/documentation-escape-codes.html | |
if [[ -n "$ITERM_SESSION_ID" ]]; then | |
tab-color() { | |
echo -ne "\033]6;1;bg;red;brightness;$1\a" | |
echo -ne "\033]6;1;bg;green;brightness;$2\a" |
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
FILE SPACING: | |
# double space a file | |
sed G | |
# double space a file which already has blank lines in it. Output file | |
# should contain no more than one blank line between lines of text. | |
sed '/^$/d;G' |
OlderNewer