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.7 | |
from __future__ import print_function | |
import subprocess | |
import time | |
def netstat(): | |
ifs0 = subprocess.check_output(['/usr/sbin/netstat', '-b', '-i']) | |
retval = dict() | |
for i in ifs0.splitlines(): |
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
PLA = 1.24 | |
ABS = 1.03 | |
def _normalize_density(d): | |
"""Density can be specified as g/cm^3 (common way) or kg/m^3 (SI way). | |
Assumes we are not dealing with degenerate matter! | |
""" | |
return (d < 25) and (d * 1000) or d |
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
/dts-v1/; | |
// magic: 0xd00dfeed | |
// totalsize: 0x37b3 (14259) | |
// off_dt_struct: 0x38 | |
// off_dt_strings: 0x31c0 | |
// off_mem_rsvmap: 0x28 | |
// version: 17 | |
// last_comp_version: 16 | |
// boot_cpuid_phys: 0x0 | |
// size_dt_strings: 0x5f3 |
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 python3 | |
from __future__ import print_function | |
import boto3 | |
import ipaddress | |
import sys | |
import time | |
ec2 = boto3.client('ec2') |
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
stat("/etc/fonts/fonts.conf", {st_mode=S_IFREG|0644, st_size=2339, ...}) = 0 | |
stat("/etc/fonts/conf.d", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0 | |
stat("/etc/fonts/conf.d/00kde.conf", {st_mode=S_IFREG|0644, st_size=124, ...}) = 0 | |
stat("/etc/fonts/conf.d/10-antialias.conf", {st_mode=S_IFREG|0644, st_size=223, ...}) = 0 | |
stat("/etc/fonts/conf.d/10-hinting-slight.conf", {st_mode=S_IFREG|0644, st_size=229, ...}) = 0 | |
stat("/etc/fonts/conf.d/10-hinting.conf", {st_mode=S_IFREG|0644, st_size=212, ...}) = 0 | |
stat("/etc/fonts/conf.d/10-scale-bitmap-fonts.conf", {st_mode=S_IFREG|0644, st_size=2010, ...}) = 0 | |
stat("/etc/fonts/conf.d/11-lcdfilter-default.conf", {st_mode=S_IFREG|0644, st_size=526, ...}) = 0 | |
stat("/etc/fonts/conf.d/20-unhint-small-dejavu-lgc-sans-mono.conf", {st_mode=S_IFREG|0644, st_size=874, ...}) = 0 | |
stat("/etc/fonts/conf.d/20-unhint-small-dejavu-lgc-sans.conf", {st_mode=S_IFREG|0644, st_size=864, ...}) = 0 |
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
#include <err.h> | |
#include <fcntl.h> | |
#include <sys/ioctl.h> | |
#include <termios.h> | |
const char* const kJesusSaves = "\025\033xsave-buffers-kill-emacs\n"; | |
int main(int argc, char* argv[]) { | |
int fd = open(argv[1], O_WRONLY); | |
if (fd < 0) { |
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
class _iloop(Exception): | |
pass | |
try: | |
for i in range(2, 10): | |
for j in range(2, 10): | |
if i == j * j: | |
raise _iloop | |
print(i, j) | |
except _iloop: |
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
;; DWIM key bindings when I have switched to a greek keyboard mapping | |
;; By <ji@tla.org> | |
;; If you fix something, email me. | |
(global-set-key (kbd "C-χ") ctl-x-map) | |
(global-set-key (kbd "M-χ") 'smex) | |
(global-set-key (kbd "C-α") 'move-beginning-of-line) | |
(global-set-key (kbd "C-β") 'backward-char) |
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
; Light and heavy solid lines | |
; | |
; 2500 ─ BOX DRAWINGS LIGHT HORIZONTAL | |
; 2501 ━ BOX DRAWINGS HEAVY HORIZONTAL | |
; 2502 │ BOX DRAWINGS LIGHT VERTICAL | |
; 2503 ┃ BOX DRAWINGS HEAVY VERTICAL | |
; | |
; Light and heavy dashed lines | |
; | |
; 2504 ┄ BOX DRAWINGS LIGHT TRIPLE DASH HORIZONTAL |
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
// * compile without optimization | |
// * run an inferior shell | |
// * type limit -d 2048 to restrict the data segment to 2 megs | |
// * ./a.out | |
// * profit! | |
#include <sys/resource.h> | |
#include <cstdint> | |
#include <iostream> |
OlderNewer