Skip to content

Instantly share code, notes, and snippets.

View tvlooy's full-sized avatar
🐧
<(o)

Tom Van Looy tvlooy

🐧
<(o)
View GitHub Profile
@tvlooy
tvlooy / dmesg.txt
Last active August 29, 2015 14:01
Lenovo ideapad yoga 11s - OpenBSD dmesg
OpenBSD 5.5-current (RAMDISK_CD) #102: Mon May 12 21:53:03 MDT 2014
todd@i386.openbsd.org:/usr/src/sys/arch/i386/compile/RAMDISK_CD
RTC BIOS diagnostic error 80<clock_battery>
cpu0: Intel(R) Core(TM) i5-4210Y CPU @ 1.5GHz ("GenuineIntel" 686-class) 1.40 GHz
cpu0: FPU,V86,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,DS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,PBE,NXE,LONG,SSE3,PCLMUL,DTES64,MWAIT,DS-CPL,VMX,EST,TM2,SSSE3,FMA3,CX16,xTPR,PDCM,PCID,SSE4.1,SSE4.2,MOVBE,POPCNT,DEADLINE,AES,XSAVE,AVX,F16C,RDRAND,LAHF,ABM,PERF,ITSC,FSGSBASE,BMI1,AVX2,SMEP,BMI2,ERMS,INVPCID
real mem = 2573516800 (2454MB)
avail mem = 2523840512 (2406MB)
mainbus0 at root
bios0 at mainbus0: AT/286+ BIOS, date 08/16/13, BIOS32 rev. 0 @ 0xef725, SMBIOS rev. 2.7 @ 0xe6ec0 (37 entries)
bios0: vendor LENOVO version "8FCN19WW(V1.00)" date 08/16/2013
@tvlooy
tvlooy / services.xml
Last active August 29, 2015 14:02
Example: inject repository into service
<?xml version="1.0" ?>
<container xmlns="http://symfony.com/schema/dic/services"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd">
<parameters>
<parameter key="acme.demo.repository.class">Acme\DemoBundle\Entity\ExampleRepository</parameter>
<parameter key="acme.demo.service.class">Acme\DemoBundle\Service\ExampleService</parameter>
</parameters>
@tvlooy
tvlooy / gist:a6b9c58c5d1ab4076775
Created June 13, 2014 21:31
Example service with factory method
<?xml version="1.0" ?>
<container xmlns="http://symfony.com/schema/dic/services"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd">
<services>
<service id="foo" class="DateTime"
factory-class="DateTime"
factory-method="createFromFormat">
<argument>Ymd</argument>
export GIT_PS1_SHOWDIRTYSTATE=1
PS1='[\[\033[00;31m\]\u@\h\[\033[00m\] \[\033[00;34m\]\w\[\033[00;31m\]$(__git_ps1)\[\033[00m\]]\n\$ '
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
LANGUAGE = (unset),
LC_ALL = (unset),
LC_PAPER = "de_BE.UTF-8",
LC_ADDRESS = "de_BE.UTF-8",
LC_MONETARY = "de_BE.UTF-8",
LC_NUMERIC = "de_BE.UTF-8",
LC_TELEPHONE = "de_BE.UTF-8",
LC_IDENTIFICATION = "de_BE.UTF-8",
#################################################################################
# CVE-XXXXX Wordpress and Drupal XML Blowup Attack DoS#
# Author: Nir Goldshlager - Salesforce.com Product Security Team#
# This is a Proof of Concept Exploit, Please use responsibly.#
#################################################################################
#!/usr/bin/env python
from __future__ import print_function
import threading
import time
import urllib
@tvlooy
tvlooy / endian.c
Created November 21, 2014 21:55
determine endian type
/* endian.c */
#include <stdio.h>
char *bytesex() {
char geheugenblok[8];
unsigned short *pointershort = (unsigned short *)geheugenblok;
unsigned long *pointerlong = (unsigned long *)geheugenblok;
*pointershort = 0x0d0c;
@tvlooy
tvlooy / fizzbuzz.scm
Last active August 29, 2015 14:10
xpdays 2015 fizzbuzz kata
; https://github.com/hightechict/fp-and-tdd/
load "~/.bin/check.scm")
(check-set-mode! 'report-failed)
(define divisible-by
(lambda (value divisor)
(= (modulo value divisor) 0)))
(define digits-split
(lambda (value)
@tvlooy
tvlooy / fizzbuzz.php
Last active August 29, 2015 14:10
"functional php" fizzbuzz kata
<?php
function test($message, $received, $expected) {
if ($received === $expected) {
echo "\033[32m✔︎ Tested $message\n";
} else {
echo "\033[31m✘ Tested $message\n";
echo "Received:\n";
var_dump($received);
echo "Expected:\n";
@tvlooy
tvlooy / gist:e2be8355a95627903d74
Created December 22, 2014 09:10
Set github oauth token
Github -> Account Settings -> Applications -> Personal Access Tokens
composer.phar config --global github-oauth.github.com <oauth-token>