Skip to content

Instantly share code, notes, and snippets.

View winny-'s full-sized avatar
👋
***status goes here***

Winston (Winny) Weinert winny-

👋
***status goes here***
View GitHub Profile
@HappyCodingRobot
HappyCodingRobot / 61-hp-mic-mute-hotkey.hwdb
Created January 8, 2019 14:22
Activate mic mute function key, ubuntu 18.04, HP Elitebook 820
# see also: /lib/udev/hwdb.d/60-keyboard.hwdb
evdev:atkbd:dmi:bvn*:bvr*:bd*:svnHewlett-Packard*:pn*EliteBook*:pvr*
KEYBOARD_KEY_81=f20 # Fn+F8 on Elitebook, map to F20
# KEYBOARD_KEY_81=fn_esc # org entry
@johntyree
johntyree / soundcloud
Created January 3, 2014 03:50
Add soundcloud streams to your mpd playlist
#!/usr/bin/env python3
# coding: utf8
# GistID: 8232376
import optparse
import sys
from subprocess import check_call
from urllib.parse import urlparse, quote, urlencode
@martijnvermaat
martijnvermaat / encrypted-root-debian-wheezy.markdown
Created May 18, 2012 16:55
Encrypted root filesystem on Debian Wheezy

Encrypted root filesystem on Debian Wheezy

This documents how to set up an encrypted root filesystem (except for /boot) on Debian Wheezy with automatic mounting using a keyfile on a USB drive.

Basic setup

In the Debian Installer, choose "Guided - use entire disk and set up encrypted LVM". That's it, on boot you will be asked to enter you passphrase using the keyboard. My system does not usually have a keyboard attached, so that's not very convenient (but read on).

@datagrok
datagrok / gist:2199506
Last active April 8, 2023 17:36
Virtualenv's `bin/activate` is Doing It Wrong
@dpalomar
dpalomar / .gitattributes
Created April 8, 2016 12:43
Fixing CRLF with gitattributes
From this [issue](https://github.com/puphpet/puphpet/issues/1025#issuecomment-157059174):
I know that this issue is closed, but as I spent a lot of time to understand what was going on, I made some researches and I can explain why this happen, and you can fix it.
Using git config core.autocrlf true can help, but not on a multi-developpers project.
This command has to be the same on each developper machine, and that's not always the case.
You have to use the .gitattributes provided in the puphpet archive and edit it as follow (carefull, this file need to be in your project root)
You also need to use an IDE that allow you to save/edit files as LF (like phpstorm). You can check the type of the file in the bottom right corner, in the status bar (you'll see LF or CRLF while a file is opened)
@fernandoaleman
fernandoaleman / Linux Static IP
Created March 23, 2012 16:20
How To Configure Static IP On CentOS 6
## Configure eth0
#
# vi /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE="eth0"
NM_CONTROLLED="yes"
ONBOOT=yes
HWADDR=A4:BA:DB:37:F1:04
TYPE=Ethernet
BOOTPROTO=static
@Metaxal
Metaxal / logging.rkt
Last active September 10, 2023 09:52
Simple usage of Racket's logging facility
#lang racket/base
; One way to define a logger
(define lg (make-logger 'my-logger))
; Define a receiver for this logger, along with a log level
(define rc (make-log-receiver lg 'error)) ; also try with 'debug
; Another way to define a logger, with additional forms
(define-logger lg2)
(define rc2 (make-log-receiver lg2-logger 'debug))
@ndarville
ndarville / webm.md
Last active September 30, 2023 18:56
4chan’s guide to converting GIF to WebM - https://boards.4chan.org/g/res/41212767

Grab ffmpeg from https://www.ffmpeg.org/download.html

It's a command line tool which means you will have to type things with your keyboard instead of clicking on buttons.

The most trivial operation would be converting gifs:

ffmpeg -i your_gif.gif -c:v libvpx -crf 12 -b:v 500K output.webm
  • -crf values can go from 4 to 63. Lower values mean better quality.
  • -b:v is the maximum allowed bitrate. Higher means better quality.
@nathanielc
nathanielc / gist:9b98350ccbcbf21256d7
Created August 20, 2014 05:07
Minecraft systemd unit file
[root@plex ~]# cat /etc/systemd/system/minecraft@.service
[Unit]
Description=Minecraft Server %i
[Service]
WorkingDirectory=/opt/minecraft-%i
User=mcserver
ExecStart=/usr/bin/screen -DmS mc-%i /bin/java -Xmx2048M -jar minecraft_server.jar nogui
@kirelagin
kirelagin / tmux-magic
Last active November 2, 2023 11:05
tmux magic for OpenRC
###
#
# tmux magic for OpenRC
#
# These functions do some tmux magic to let you run non-daemon programs
# (e.g. ones with ncurses interface) as daemons in tmux sessions.
# You just run `/etc/init.d/<service> start/stop` or add the service
# to a runlevel and later you can do `/etc/init.d/<service> attach` to
# see its console. Type `Ctrl+b d` to detach (in the default tmux configuration).
# We execute tmux with `-L`, so those sessions are not visible in the