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/perl | |
use strict; | |
use warnings; | |
use FFI::Raw; | |
use IO::Handle; | |
my $fopen = FFI::Raw -> new( | |
'libc.so.6', 'fopen', |
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
/* | |
* Stupid JSON prettifier. | |
* | |
* Compile: | |
* $ cc -o j jsonpretty.c -ljansson | |
* | |
* Usage: | |
* $ ./j < <file> | |
* $ cat <file> | ./j | |
* |
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/perl | |
# Usage: wr <term> [<dict>] | |
# Translate a word using wordreference.com | |
use strict; | |
use warnings; | |
use feature qw(say); |
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/perl | |
# Usage: gist_backup.pl <user> | |
# Clone all the gists of a GitHub user | |
use strict; | |
use warnings; | |
use Git::Raw; | |
use Pithub::Gists; |
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
/* | |
* Wrap mouse pointer at screen edges. | |
* | |
* Compile: | |
* $ cc -o mousewrap mouse_wrap.c -lX11 -lXi | |
* | |
* Usage: | |
* $ ./mwrap | |
* | |
* Copyright (C) 2012 Alessandro Ghedini <alessandro@ghedini.me> |
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
/* | |
* Execute a command after some time of inactivity | |
* | |
* Compile: | |
* $ cc -o sleepd sleepd.c | |
* | |
* Usage: | |
* $ ./sleepd -t 600 -c "slock" | |
* | |
* NOTE: to run this as a normal (non-root) user you may need to change |
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
/* | |
* Bidirectional pipe | |
* | |
* Compile: | |
* $ cc -o bipipe bipipe.c | |
* | |
* Examples: | |
* | |
* * Unix domain socket chat over SSH: | |
* |
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
/* | |
* Arduino library for the MMA8452Q three-axis accelerometer. | |
* | |
* The MMA8452Q is a tiny and low-power three-axis accelerometer. This | |
* library implements a simple interface to access most of the chip | |
* functionality from an Arduino. | |
* | |
* FEATURES: | |
* + Normal and fast raw axes values reading | |
* + Scale configuration (allowed 2g, 4g and 8g scales) |
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
/* | |
* Arduino library for the ATSHA204 authentication chip. | |
* | |
* The ATSHA204 is a tiny and low-power authentication chip. This library | |
* implements a simple interface to access most of the chip functionality from | |
* an Arduino. | |
* | |
* Note that only the Single-Wire Interface (SWI) is currently supported. | |
* | |
* FEATURES: |
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
package main | |
import "log" | |
import "os" | |
import "github.com/docopt/docopt-go" | |
import "github.com/godbus/dbus" | |
const target string = "org.freedesktop.systemd1"; | |
const object string = "/org/freedesktop/systemd1"; |