Skip to content

Instantly share code, notes, and snippets.

View xavierlacot's full-sized avatar

Xavier Lacot xavierlacot

View GitHub Profile
@xavierlacot
xavierlacot / USG-static-dns-entries.md
Created August 2, 2017 15:24
USG static dns entries
$ ssh username@192.168.0.1
$ sudo vi /etc/dnsmasq.d/dnsmasq.static.conf

Put there some hostnames <-> ip mappings:

address=/some.domain/192.168.0.123
address=/some.other.domain/167.112.237.24
@xavierlacot
xavierlacot / gist:5cecf11a625e0ddd8667
Created December 1, 2015 09:59
Decrypt a locked pdf
$ brew install qpdf
$ qpdf --decrypt input.pdf output.pdf

Keybase proof

I hereby claim:

  • I am xavierlacot on github.
  • I am xavierlacot (https://keybase.io/xavierlacot) on keybase.
  • I have a public key whose fingerprint is 4026 E05C B76B F5BD 6980 1742 74DE EDAA 3924 BE5B

To claim this, I am signing this object:

@xavierlacot
xavierlacot / macbook-osx-internal-keyboard-disable.md
Created October 1, 2014 09:48
Disable Macbook internal keyboard on OSX Mavericks

This seems to do the trick:

$ sudo kextunload -b com.apple.driver.AppleUSBTCKeyboard
@xavierlacot
xavierlacot / gist:5219919
Created March 22, 2013 09:08
Forward Geocoding in javascript - useful in Titanium which restricts the Ti.API.forwardGeocoder method to the US.
var forwardGeoCoder = function(address, callback) {
xhr = Titanium.Network.createHTTPClient();
var url = 'http://maps.googleapis.com/maps/api/geocode/json?sensor=false&address=' + address;
xhr.open('GET', url);
xhr.onload = function() {
var json = JSON.parse(this.responseText);
if (json.results.length > 0) {
var latitude = json.results[0].geometry.location.lat;
var longitude = json.results[0].geometry.location.lng;
callback(latitude, longitude);
@xavierlacot
xavierlacot / gist:5051742
Created February 27, 2013 21:10
LibreOffice odp odt ods Quicklook preview on OSX
$ cd /System/Library/QuickLook
$ sudo wget http://trinity.neooffice.org/downloads/neopeek.qlgenerator.tgz | tar xzvf
@xavierlacot
xavierlacot / internet.php
Created June 20, 2011 16:16
internet en moins de huit secondes
<?php
// INTERNET EN MOINS DE HUIT SECONDES
class decoder
{
protected
$code = array(),
$codeCombinations = array(),
$operations = array(),
$operationCombinations = array();
@xavierlacot
xavierlacot / pipeviewer.md
Created February 23, 2011 14:39
Some pv tips

Pipeviewer tips

About

Pipeviewer is a terminal-based tool for monitoring the process of data through a pipeline.

Loading a large mysql dump

pv dump.sql | /path/to/mysql -uLOGIN -p DATABASE