- Create a service file like
dash_sniffer.service
- Put it in
/lib/systemd/system/
- Reload
systemd
using command:systemctl daemon-reload
- Enable auto start using command:
systemctl enable dash_sniffer.service
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <ArduinoJson.h> | |
#include <Key.h> | |
#include <Keypad.h> | |
// Allow 5 seconds of lag from the device, to the game, and back to the device. | |
#define BUTTON_SYNC_TIME 5000 | |
// Each button press will last about 100ms. | |
#define BUTTON_HOLD_TIME 100 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ uq troll-yaml.yaml | |
{ | |
"country list": [ | |
"US", | |
"GB", | |
false | |
], | |
"end_date": 20130510, | |
"favorite_prog_rock_band": true, | |
"homedir_location": null, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
# | |
# A script to download chat from a Twitch VOD and print it to a terminal. | |
# Chat will be downloaded all the way until it ends. | |
# | |
# Usage: TWITCH_CLIENT_ID=0123456789abcdef0123456789abcde twitch-vod-chat.py [video_id] [start] | |
# | |
# This script could break at any time, because Twitch's chat API is | |
# undocumented and likes to change at any time; in fact, this script was |
Just run:
sh ./ubuntu14.04-emacs-24.4-install.sh
This will install ncurses which is dependency of emacs24.4. It may requires another dependencies depending on your environment. Note that configure options in emacs installation are for disabling GUI features.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!ipxe | |
# To access this file via http use following redirection: | |
# http://preseed.panticz.de/ipxe/menu.netinstall.ipxe | |
# choose cpu architecture | |
cpuid --ext 29 && set arch amd64 || set arch i386 | |
menu NetInstall | |
item --gap NetInstall Ubuntu Preseed (user: ubuntu, password: t00r): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash -e | |
# List users in the system | |
echo "Users setup in the system." | |
ls /etc/openvpn/easy-rsa/keys/*ovpn|xargs -n 1 -I FNAME basename FNAME .ovpn|grep -v proxy|xargs -n 1 -I NAME echo " NAME" | |
echo ------ | |
echo Active users | |
echo ------ | |
cat /var/log/openvpn/server.log |
emacs --daemon
to run in the background.
emacsclient.emacs24 <filename/dirname>
to open in terminal
NOTE: "M-m and SPC can be used interchangeably".
- Undo -
C-/
- Redo -
C-?
- Change case: 1. Camel Case :
M-c
2. Upper Case :M-u
- Lower Case :
M-l
Get the current Unix timestamp (seconds from 1970-01-01T00:00:00Z) in SQL.
- MySQL:
UNIX_TIMESTAMP()
- PostgreSQL:
CAST(EXTRACT(epoch FROM NOW()) AS INT)
- MS SQL:
DATEDIFF(s, '1970-01-01', GETUTCDATE())
- Oracle:
(CAST(SYS_EXTRACT_UTC(SYSTIMESTAMP) AS DATE) - DATE'1970-01-01') * 86400
NewerOlder