Skip to content

Instantly share code, notes, and snippets.

View floriandejonckheere's full-sized avatar

Florian Dejonckheere floriandejonckheere

View GitHub Profile
@floriandejonckheere
floriandejonckheere / grep-logs.sh
Last active August 29, 2015 14:02
Grep both compressed and uncompressed logs
#!/usr/bin/bash
#
# grep-logs - grep both compressed and uncompressed log files
#
if [[ "$1" == "-h" || ! $2 ]]; then
echo "Usage: $0 PATTERN LOG_FILE_BASE"
echo -e "\tPATTERN\t\tsee grep(1)"
echo -e "\tLOG_FILE_BASE\tuncompressed log file relative to /var/log"
echo -e "\n\tExample:\t$0 'denied access' nginx_access.log"
@floriandejonckheere
floriandejonckheere / gist:3aa5ca635d3b6e990919
Created February 9, 2015 15:50
Make Android emulator available to LAN
# sysctl net.ipv4.conf.all.route_localnet=1
# iptables -t nat -I PREROUTING -p tcp --dport 5555 -j DNAT --to 127.0.0.1:5555
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!-- google's material design colours from
http://www.google.com/design/spec/style/color.html#color-ui-color-palette -->
<!--reds-->
<color name="md_red">#F44336</color>
<color name="md_red_50">#FFEBEE</color>
<color name="md_red_100">#FFCDD2</color>
@floriandejonckheere
floriandejonckheere / c
Created April 5, 2015 12:41
Bash colours
#!/usr/bin/bash
#
# c - c070rz 0n ür t3rm1n4l
#
# Florian Dejonckheere <florian@floriandejonckheere.be>
#
if [[ ! $1 || $1 == "-h" ]]; then
echo -e "Usage: $0 \e[4mFOREGROUND\e[0m \e[4mBACKGROUND\e[0m \e[4mTEXT\e[0m [ \e[4mDECORATION\e[0m ]"
echo
/**
* allocbot.c - mindlessly allocate memory
*
* Florian Dejonckheere <florian@floriandejonckheere.be
*
* */
#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
@floriandejonckheere
floriandejonckheere / matlab.desktop
Last active August 29, 2015 14:21
MATLAB desktop file
[Desktop Entry]
Name=MATLAB R2014a
Comment=A multi-paradigm numerical computing environment
Exec=matlab -desktop
Icon=matlab
Terminal=false
Type=Application
StartupNotify=true
Categories=Development;Science
@floriandejonckheere
floriandejonckheere / project.geany
Created June 1, 2015 07:02
Geany Rails project
[file_prefs]
final_new_line=true
ensure_convert_new_lines=true
strip_trailing_spaces=true
replace_tabs=false
[indentation]
indent_width=2
indent_type=0
indent_hard_tab_width=8
@floriandejonckheere
floriandejonckheere / bat.sh
Created July 10, 2015 20:34
SMAPI battery functionality shortcuts
#!/usr/bin/bash
#
# bat - battery utilities
#
BAT="BAT0"
SYSBAT="/sys/class/power_supply/${BAT}/"
SMAPIBAT="/sys/devices/platform/smapi/${BAT}/"
function __bat__cap(){
@floriandejonckheere
floriandejonckheere / ffmpegthumbnailer.thumbnailer
Last active August 29, 2015 14:25
FFMPEGThumbnailer with more formats
[Thumbnailer Entry]
TryExec=ffmpegthumbnailer
Exec=ffmpegthumbnailer -i %i -o %o -s %s -f
MimeType=application/f4v;application/mxf;application/ogg;application/vnd.rn-realmedia;application/vnd.smaf;application/xml;application/x-pgs;application/x-shockwave-flash;application/x-subrip;audio/aac;audio/aac,audio/aacp,audio/x-aac;audio/aiff;audio/amr;audio/basic;audio/bit;audio/G722;audio/g723;audio/iLBC;audio/MP4A-LATM;audio/mpeg;audio/ogg;audio/webm,audio/x-matroska,video/webm,video/x-matroska;audio/x-ac3;audio/x-caf;audio/x-dca;audio/x-eac3;audio/x-flac;audio/x-matroska;audio/x-oma;audio/x-voc;audio/x-wav;audio/x-wavpack;image/vnd.microsoft.icon;multipart/x-mixed-replace;multipart/x-mixed-replace;boundary=;text/vtt;text/x-jacosub;text/x-microdvd;text/x-ssa;video/MP2T;video/mp4;video/mpeg;video/webm;video/x-flv;video/x-h261;video/x-h263;video/x-matroska;video/x-mjpeg;video/x-ms-asf;video/x-ms-wm;video/x-ms-wmv;video/x-msvideo;video/x-nut;video/quicktime;audio/aac;audio/aacp;audio/aiff;audio/amr;audio/bad;audio/bas
@floriandejonckheere
floriandejonckheere / 50-synaptics.conf
Created July 25, 2015 09:32
X Server config for permanent ThinkPad trackpoint scrolling
# Example xorg.conf.d snippet that assigns the touchpad driver
# to all touchpads. See xorg.conf.d(5) for more information on
# InputClass.
# DO NOT EDIT THIS FILE, your distribution will likely overwrite
# it when updating. Copy (and rename) this file into
# /etc/X11/xorg.conf.d first.
# Additional options may be added in the form of
# Option "OptionName" "value"
#
Section "InputClass"