Skip to content

Instantly share code, notes, and snippets.

View HLFH's full-sized avatar

Gaspard d'Hautefeuille HLFH

View GitHub Profile
@schlomo
schlomo / demo3.ipxe
Last active October 27, 2015 04:51
iPXE Installation menu with several Linux Distributions and Live CDs
#!ipxe
menu Bitte waehlen Sie ein Betriebssystem zur Installation aus
item ubuntu Ubuntu installieren
item fedora Fedora installieren
item --gap
item back Zurueck zum Hauptmenue
choose --timeout 20000 --default back target && goto ${target} || goto menu
:ubuntu
set ubuntu http://archive.ubuntu.com/ubuntu/dists/trusty/main/installer-i386/current/images/netboot/ubuntu-installer/i386
@aeris
aeris / hpkp-tlsa.sh
Created January 17, 2016 21:18
Generate HPKP or TLSA fingerprint
#!/bin/bash
case "$1" in
hpkp)
case "$2" in
key)
openssl rsa -in "$3" -outform der -pubout 2>/dev/null | openssl dgst -sha256 -binary | openssl enc -base64
;;
csr)
openssl req -in "$3" -pubkey -noout | openssl rsa -pubin -outform der 2>/dev/null | openssl dgst -sha256 -binary | openssl enc -base64
@chrisalexander55
chrisalexander55 / bootstrap-4-webpack-config.md
Last active September 29, 2017 18:27
Subtle Tweak to get Boostrap 4 Working With Webpack

Although I followed the excellent directions provided by the Boostrap 4 documentation, I found it incomplete. Here are the missing steps:

# install dependencies
npm i jquery popper.js bootstrap@4.0.0-beta --save

# install dev-dependencies
npm i precss --save-dev

# use the following webpack postcss-loader config
@lxneng
lxneng / gist:0b79d373cda4bdfe3dcc
Created August 6, 2014 06:21
mongodb distinct multiple fields
collection = db.getCollection('foo')
result = collection.aggregate(
[
{"$group": { "_id": { fa: "$fa", fb: "$fb" } } }
]
);
printjson(result);
@alexiri
alexiri / Transmission port check bug
Created November 3, 2018 17:56
portcheck.transmissionbt.com fails over IPv6
$ curl -6 -v https://portcheck.transmissionbt.com/51413
* Trying 2001:41d0:c:5ac:5::1...
* TCP_NODELAY set
* Connected to portcheck.transmissionbt.com (2001:41d0:c:5ac:5::1) port 443 (#0)
* ALPN, offering h2
* ALPN, offering http/1.1
* successfully set certificate verify locations:
* CAfile: /etc/ssl/certs/ca-certificates.crt
CApath: /etc/ssl/certs
* TLSv1.2 (OUT), TLS handshake, Client hello (1):
@chrisjacob
chrisjacob / Gemfile
Last active February 6, 2020 08:26
Simple guide to integrating Pages v1.0.0 with Rails v4.1.1
gem 'rails', '4.1.1'
# Use jquery as the JavaScript library
gem 'jquery-rails'
# Turbolinks makes following links in your web application faster. Read more: https://github.com/rails/turbolinks
gem 'turbolinks'
gem 'jquery-turbolinks'
# Gems for twitter LESS -> CSS and JS support
gem 'execjs'
@coffeejunk
coffeejunk / gist:3827905
Created October 3, 2012 16:10
ruby string for xml
In Ruby 1.9.2 to escape XML special characters in Strings, use the 'encode' method.
Example, if you have:
my_string = 'this is "my" complicated <String>'
For XML attributes use:
"<node attr=#{my_string.encode(:xml => :attr)} />"
Generates:
@hardware
hardware / main.cf
Last active July 26, 2020 16:24
/etc/postfix/main.cf - Fichier de configuration de Postfix
#######################
## GENERALS SETTINGS ##
#######################
smtpd_banner = $myhostname ESMTP $mail_name (Debian/GNU)
biff = no
append_dot_mydomain = no
readme_directory = no
delay_warning_time = 4h
mailbox_command = procmail -a "$EXTENSION"
@diegopacheco
diegopacheco / pip3-python3-ubuntu.md
Created January 5, 2017 13:46
How to Install pip3 on python3 Ubuntu 16.04
sudo apt-get install python3-setuptools
sudo easy_install3 pip
@Mister-Meeseeks
Mister-Meeseeks / pullYahoo.sh
Created May 17, 2017 21:45
Bash script for Yahoo Finance historical data. Works with new cookie-based authentication
#!/bin/bash -eu
# Client script to pull Yahoo Finance historical data, off of its new cookie
# authenticated site. Start/End Date args can be any GNU readable dates.
# Script requires: GNU date, curl and bash shell
symbol=$1
startDate=$2
endDate=$3