Skip to content

Instantly share code, notes, and snippets.

View lepiaf's full-sized avatar

Thierry T. lepiaf

View GitHub Profile
<?php
class DefaultController extends Controller
{
/**
* Dashboard page.
* @Permissions(perm="dashboard_view")
* @Route("/", name="ITEDashboardBundle_index")
* @Template()
* @return array
@thedod
thedod / README.textile
Created November 8, 2010 15:43
Fairly Simple Simon - an Arduino memory game for 4 LEDs and 4 switches

Fairly Simple Simon – an Arduino memory game for 4 LEDs and 4 switches

The FSS is a simple board with 4 leds and 4 normally-closed switches
(each led goes via a 150Ohm resistor, and each switch has a 10KOhm
pull-resistor connecting between the output and ground).

See breadoard (made with fritzing):
Fairly Simple Simon on an imaginary http://fritzing.org bread... on Twitpic

In real life it ain’t that pretty :)

@clarkmcc
clarkmcc / delete-shutdown-pods.sh
Last active May 11, 2022 12:15
Deletes Kubernetes pods with a status of Shutdown that are usually left over after a GKE pre-emptible node goes offline.
#!/bin/sh
for namespace in $(kubectl get ns | awk '{print $1}' | grep -v NAME); do
for pod in $(kubectl get pod -n $namespace --field-selector=status.phase!=Running | grep Shutdown | awk '{print $1}' | grep -v NAME); do
kubectl delete pod -n "$namespace" "$pod"
done
done
@gibtang
gibtang / gist:83f9681b525908900ec4b490992f032d
Created June 6, 2020 10:10
Simple sort of objects in a list using an attribute of type string
class cars:
def __init__(self, name, price):
self.name = name
self.price = price
unsorted_cars = []
unsorted_cars.append(cars('Ford', 20000))
unsorted_cars.append(cars('Volvo', 50000))
unsorted_cars.append(cars('BMW', 24000))
@gm3dmo
gm3dmo / gelfsender.sh
Last active November 16, 2023 04:47
Send a log message to a gelf server using the shell.
# This script can be used to raise a graylog2/gelf message
# gzip it and send it to a graylog server using netcat (nc)
hostname='gelftester'
short_message='test message short version'
full_message='longer test message. dont\n worry be happy'
level=1
facility='gelftester'
# gnu date
date=$(date +'%s.%N')
@jonathantneal
jonathantneal / README.md
Last active March 19, 2024 23:31
Local SSL websites on macOS Sierra

Local SSL websites on macOS Sierra

These instructions will guide you through the process of setting up local, trusted websites on your own computer.

These instructions are intended to be used on macOS Sierra, but they have been known to work in El Capitan, Yosemite, Mavericks, and Mountain Lion.

NOTE: You may substitute the edit command for nano, vim, or whatever the editor of your choice is. Personally, I forward the edit command to Sublime Text:

alias edit="/Applications/Sublime\ Text.app/Contents/SharedSupport/bin/subl"
@ck-on
ck-on / ocp.php
Last active March 25, 2024 09:30
OCP - Opcache Control Panel (aka Zend Optimizer+ Control Panel for PHP)#ocp #php #opcache #opcode #cache #zend #optimizerplus #optimizer+
<?php
/*
OCP - Opcache Control Panel (aka Zend Optimizer+ Control Panel for PHP)
Author: _ck_ (with contributions by GK, stasilok)
Version: 0.1.7
Free for any kind of use or modification, I am not responsible for anything, please share your improvements
* revision history
0.1.7 2015-09-01 regex fix for PHP7 phpinfo
0.1.6 2013-04-12 moved meta to footer so graphs can be higher and reduce clutter
@velizarn
velizarn / ip6tables_setup.bash
Last active March 27, 2024 21:48
Basic setup for ip6tables - drop all traffic except local, ICMP and DHCPv6 traffic.
#!/bin/bash
# http://serverfault.com/questions/410321/debian-ip6tables-rules-setup-for-ipv6/410327#410327
# http://ipset.netfilter.org/iptables.man.html
# https://www.sixxs.net/wiki/IPv6_Firewalling
# https://www.cyberciti.biz/faq/ip6tables-ipv6-firewall-for-linux/
# https://gist.github.com/thomasfr/9712418
# https://gist.github.com/SnakeDrak/f4150f6e517e5a1d525f
# http://www.thegeekstuff.com/2011/06/iptables-rules-examples
# http://www.thegeekstuff.com/scripts/iptables-rules
@artizirk
artizirk / gnupg_scdaemon.md
Last active April 3, 2024 14:49
OpenPGP SSH access with Yubikey and GnuPG

NB: This document describles a 'Old-School' way of using Yubikey with SSH

Modern OpenSSH has native support for FIDO Authentication. Its much simpler and should also be more stable with less moving parts. OpenSSH also now has support for signing arbitary files witch can be used as replacement of gnupg. Git also supports signing commits/tags with ssh keys.

Pros of FIDO

  • Simpler stack / less moving parts
  • Works directly with ssh, ssh-add and ssh-keygen on most computers
  • Simpler
  • Private key can never leave the FIDO device

Cons of FIDO

@henrik
henrik / ocr.markdown
Created March 3, 2012 17:07
OCR on OS X with tesseract

Install ImageMagick for image conversion:

brew install imagemagick

Install tesseract for OCR:

brew install tesseract --all-languages

Or install without --all-languages and install them manually as needed.