Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am csabapalfi on github.
  • I am csabapalfi (https://keybase.io/csabapalfi) on keybase.
  • I have a public key whose fingerprint is C157 4F00 23AE 6CF5 91A5 0A75 B829 7EAC D043 535C

To claim this, I am signing this object:

@csabapalfi
csabapalfi / wifix.sh
Created January 12, 2015 10:12
Temporary wifi fix until OSX 10.10.2
#! /usr/bin/env bash
while true; do
echo "$(date -u):"
dig @8.8.8.8 +tries=1 +time=3 google.com | \
grep 'Query time' | \
cut -d ' ' -f 4 -f 5
if [ ${PIPESTATUS[0]} -ne 0 ] ; then
ifconfig en0 down
ifconfig en0 up
@csabapalfi
csabapalfi / link_airport.sh
Created January 13, 2015 08:55
Link Airport Utility to /usr/sbin
@csabapalfi
csabapalfi / nosleep.sh
Created January 13, 2015 08:55
Don't sleep
caffeinate -t 3600
<!doctype html>
<html lang="en">
<head>
<script>
(function () {
'use strict';
var xhr = new XMLHttpRequest();
xhr.open('GET', 'https://api.github.com/users/csabapalfi/starred', true);
xhr.setRequestHeader('Accept', 'application/vnd.github.v3.star+json');
airodump-ng -w wifi-dump wlan0
tcpdump -n -l -e -r wifi-dump.cap | grep 'Probe Request ([^)]'

docker basics

container basics

  • how they compare to VMs
  • shared kernel with host
  • separate process and file namespace (see PID1 inside container)
  • separate network interface
@csabapalfi
csabapalfi / package.json
Created May 18, 2015 05:48
small exercise quickstart
{
"name": "starter",
"version": "1.0.0",
"scripts": {
"test": "nodemon node_modules/.bin/mocha test/ --recursive --growl --reporter spec"
},
"devDependencies": {
"mocha": "^2.2.5"
},
"dependencies": {
Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[HY000] [2002] Connection refused' in /var/www/captive-portal-live/vendor/ay/pdo/pdo.class.php:8 Stack trace: #0 /var/www/captive-portal-live/vendor/ay/pdo/pdo.class.php(8): PDO->__construct('mysql:dbname=ma...', 'cp-live', '6mFi53GMBF5a', Array) #1 /var/www/captive-portal-live/vendor/arqiva/mama/face/frontend/bootstrap.inc.php(17): ay\pdo\PDO->__construct('mysql:dbname=ma...', 'cp-live', '6mFi53GMBF5a') #2 /var/www/captive-portal-live/endpoint/frontend/index.php(6): require('/var/www/captiv...') #3 {main} thrown in /var/www/captive-portal-live/vendor/ay/pdo/pdo.class.php on line 8
https://connect.wifiservice.net/?aa[ac_url]=https%3A%2F%2Flnborbarn.wifiservice.net%2Flogin&aa[mac]=60%3AF8%3A1D%3AC7%3A15%3AA0&aa[nasid]=LNBORBARN&aa[ssid]=_FreeBarnetWiFi&aa[orig_url]=http%3A%2F%2Findex.hu%2F
@csabapalfi
csabapalfi / HttpsHack.java
Created August 17, 2010 15:28
https Java hack
//Trusting all certificates
TrustManager[] trustAllCerts = new TrustManager[]{new X509TrustManager() {
public java.security.cert.X509Certificate[] getAcceptedIssuers() {
return null;
}
public void checkClientTrusted(java.security.cert.X509Certificate[] certs, String authType) {
}
public void checkServerTrusted(java.security.cert.X509Certificate[] certs, String authType) {