Skip to content

Instantly share code, notes, and snippets.

View gema-arta's full-sized avatar
:octocat:
Octocating

gema-arta gema-arta

:octocat:
Octocating
View GitHub Profile
# Loosely based on http://www.vistax64.com/powershell/202216-display-image-powershell.html
[void][reflection.assembly]::LoadWithPartialName("System.Windows.Forms")
$file = (get-item 'C:\Users\Public\Pictures\Sample Pictures\Chrysanthemum.jpg')
#$file = (get-item "c:\image.jpg")
$img = [System.Drawing.Image]::Fromfile($file);
# This tip from http://stackoverflow.com/questions/3358372/windows-forms-look-different-in-powershell-and-powershell-ise-why/3359274#3359274

Add the following chunk to your existing ISC dhcpd.conf file.

if exists user-class and ( option user-class = "iPXE" ) {
    filename "http://boot.smidsrod.lan/boot.ipxe";
}
else {
    filename "undionly.kpxe";
}

(or see https://gist.github.com/4008017 for a more elaborate setup

CFLAGS = -g -Wall -std=c++0x -pipe -march=native -Os
mkdir -p obj
g++ -o obj/CryptoConst.o CryptoConst.cpp -c -g -Wall -std=c++0x -pipe -march=native -Os -DAESNI
g++ -o obj/base64.o base64.cpp -c -g -Wall -std=c++0x -pipe -march=native -Os -DAESNI
g++ -o obj/NTCPSession.o NTCPSession.cpp -c -g -Wall -std=c++0x -pipe -march=native -Os -DAESNI
NTCPSession.cpp: In member function ‘void i2p::ntcp::NTCPSession::DecryptNextBlock(const uint8_t*)’:
NTCPSession.cpp:434:24: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
g++ -o obj/RouterInfo.o RouterInfo.cpp -c -g -Wall -std=c++0x -pipe -march=native -Os -DAESNI
g++ -o obj/Transports.o Transports.cpp -c -g -Wall -std=c++0x -pipe -march=native -Os -DAESNI

tmux cheatsheet

As configured in my dotfiles.

start new:

tmux

start new with session name:

#!/usr/bin/env python
import httplib2
import sys
import json
from urllib import urlencode
h = httplib2.Http(".cache")
print "Please hold while we retrive your IP address..."
r,ip = h.request("http://[fc72:6c3b:8c74:68a7:d8c3:b4e0:6cbd:9588]/ip/","GET")
url = "http://[fc5d:baa5:61fc:6ffd:9554:67f0:e290:7535]/node/details/" + ip + "/save"
print "Looks like your IP is " + ip
#!/bin/bash
for i in {1..100}; do
( docker run -d --name $i cirros sleep 3600 ) &
done
for i in {1..100}; do
( sleep $((RANDOM%120+60)) ; docker rm -f $i ) &
done
<network>
<name>ovs-network</name>
<forward mode='bridge'/>
<bridge name='ovsbr0'/>
<virtualport type='openvswitch'/>
<portgroup name='vlan-01' default='yes'>
</portgroup>
<portgroup name='vlan-02'>
<vlan>
<tag id='2'/>
@gema-arta
gema-arta / nginx.conf
Last active August 29, 2015 14:10 — forked from plentz/nginx.conf
# to generate your dhparam.pem file, run in the terminal
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048
@gema-arta
gema-arta / nginx.conf
Last active August 29, 2015 14:10 — forked from plentz/nginx.conf
# to generate your dhparam.pem file, run in the terminal
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048
if (h->extended_hdr.parsed_pkt.l3_proto == 115) {
struct pfring_pkthdr l2tp_header;
memset(&l2tp_header, 0, sizeof(l2tp_header));
int16_t l4_offset = h->extended_hdr.parsed_pkt.offset.l4_offset;
// L2TP has two headers: L2TP and default L2-Specific Sublayer: every header for 4bytes
int16_t l2tp_header_size = 8;
l2tp_header.len = h->len - (l4_offset + l2tp_header_size);
l2tp_header.caplen = h->caplen - (l4_offset + l2tp_header_size);