Skip to content

Instantly share code, notes, and snippets.

View norpol's full-sized avatar

Phileas Lebada norpol

View GitHub Profile
@djmitche
djmitche / gist:08c41b8b16ca3b969df4
Created November 4, 2014 19:07
ttyrec-1.0.8.RHEL5.patch
diff -rupN original/Makefile new/Makefile
--- original/Makefile 2006-06-11 10:52:50.000000000 -0500
+++ new/Makefile 2012-04-23 18:34:05.000000000 -0500
@@ -1,5 +1,5 @@
CC = gcc
-CFLAGS = -O2
+CFLAGS = -O2 -DHAVE_openpty
VERSION = 1.0.8
TARGET = ttyrec ttyplay ttytime
@jeremija
jeremija / thinklight-led.sh
Last active December 26, 2015 08:09
Scripts for blinking of the power LED on a Thinkpad X230. You can use the `thinklight-led.sh "0 blink"` in any application which can execute a command on an event.
#!/bin/sh
#
# Place this file in /usr/local/bin folder.
# You might want to edit the /etc/sudoers file and add a line like this:
# $user ALL=NOPASSWD: /usr/local/bin/thinklight-led.sh
#
# Replace the $user variable with your username.
#
# author: www.github.com/jeremija
[package]
name = "urlshortener"
version = "0.1.0"
authors = ["Gökberk Yaltıraklı <webdosusb@gmail.com>"]
[dependencies]
nickel = "*"
hyper = "*"
rand = "0.3.11"
@dlangille
dlangille / from var log messages
Created December 13, 2017 23:35
R710 after powering up the Dell TL4000 tape library
Dec 13 23:30:41 r710-01 kernel: sa2 at mps1 bus 0 scbus1 target 5 lun 0
Dec 13 23:30:41 r710-01 kernel: sa2: <IBM ULT3580-HH4 C7Q1> Removable Sequential Access SCSI-3 device
Dec 13 23:30:41 r710-01 kernel: sa2: Serial Number 1K10012996
Dec 13 23:30:41 r710-01 kernel: sa2: 300.000MB/s transfers
Dec 13 23:30:41 r710-01 kernel: sa2: Command Queueing enabled
Dec 13 23:30:41 r710-01 kernel: ch0 at mps1 bus 0 scbus1 target 5 lun 1
Dec 13 23:30:41 r710-01 kernel: ch0: <IBM 3573-TL B.60> Removable Changer SPC-3 SCSI device
Dec 13 23:30:41 r710-01 kernel: ch0: Serial Number 00X4U78G4272_LL0
Dec 13 23:30:41 r710-01 kernel: ch0: 300.000MB/s transfers
Dec 13 23:30:41 r710-01 kernel: ch0: Command Queueing enabled
@reox
reox / new_debian_kvm.sh
Last active March 31, 2018 20:17
Create a new Debian container for KVM and import it using virt-install
#!/bin/bash
set -e
# Name of the VM
IMAGE=some-fancy-name
# IP address for VM
IP="192.168.122.30"
MIRROR=http://mirror.hetzner.de/debian/packages
PACKAGES="openssh-server htop vim"
@BjarniRunar
BjarniRunar / gist:bd34c1e2e8101f6ff237add5db43eb78
Last active April 20, 2018 21:11
Backup snapshots, using rsync. CLI user's Time Machine replacement.
#!/bin/bash
#
# Backup scriptlet. Public Domain. Made by Bjarni, https://bre.klaki.net/
#
# This will look in any device mounted on /media/$USER/, and if it has a directory
# named home-00000000 or data-00000000, it will use one of two rsync-based strategies
# to create a backup snapshot. To start using new media, just create one of those
# directories and run the script.
#
# I have two strategies because some of my backup disks are too small for my "Data"
@raphlinus
raphlinus / parse.cu
Created April 23, 2018 19:31
sketch of prefix sum to do backslash unescaping in cuda
// Copyright 2018 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
@nikolaplejic
nikolaplejic / gist:3654637
Created September 6, 2012 10:36
How to copy/paste your password in PayPal's change password form
PayPal blocks copy/paste actions in their "change password" form,
citing some irrelevant security issues as the reason. That's a
load of crap, and they know it -- disabling copy/paste makes it a
lot harder to use a decent password generator and a lot easier to
screw up your pwd when retyping, especially if it's a long one
(as it should be!).
So, here's the quick'n'dirty way to use an externally generated
password in your PayPal account:
@omadjoudj
omadjoudj / sandboxed-firefox
Created August 8, 2013 04:14
Configure and run firefox inside SELinux sandbox with the previous profile
sudo yum install policycoreutils-sandbox
sudo semodule -e sandbox
sandbox -t sandbox_web_t -X -i ~/.mozilla/ -i ~/.gtkrc-2.0 firefox
@pigeonhill
pigeonhill / h3s.lua
Last active September 14, 2018 19:51
Hand Held Helper Script
--Hand Held Helper Script (H3S) Release 1.05
--[[
********************************************************************************************
This script attempts to capture 'the best' bracket sequences when hand holding.
Bracketing choices are Exposure or Focus.
In Focus mode the script creates a two image focus stack via aperture bracketing, and attempts to maintain the same exposure between two limits: the minimum handheld shutter and the maximum ISO.
The exposure bracketing mode is based on ISO shifting as well as time shifting.
The general strategy being to time shift from the highlights at the lowst ISO you can, and ISO shift from the shadows from the lowest Tv you can, at ISO 100. That is try and maximise photon capture, ie for the highest DR.
Note pushing ISO too far is pointless, as once above a critical level, Canon cameras go into ISO invariant zone (varies with camera) and overall DR falls with no increase in (read) noise.