This guide was written while setting up an Unbuntu VPS. There may be some differences when setting up a different distro.
Do some basic setup as the root user, which should mainly consist of
> data Thing = Thing {a :: Int, b :: Int, c :: Int} deriving Show | |
> :t | |
Thing :: Int -> Int -> Int -> Thing | |
> Thing {a = 10} | |
<interactive>:13:1: Warning: | |
Fields of ‘Thing’ not initialised: b, c | |
In the expression: Thing {a = 10} | |
In an equation for ‘it’: it = Thing {a = 10} |
Get the current Unix timestamp (seconds from 1970-01-01T00:00:00Z) in SQL.
UNIX_TIMESTAMP()
CAST(EXTRACT(epoch FROM NOW()) AS INT)
DATEDIFF(s, '1970-01-01', GETUTCDATE())
(CAST(SYS_EXTRACT_UTC(SYSTIMESTAMP) AS DATE) - DATE'1970-01-01') * 86400
emacs --daemon
to run in the background.
emacsclient.emacs24 <filename/dirname>
to open in terminal
NOTE: "M-m and SPC can be used interchangeably".
C-/
C-?
M-c
2. Upper Case : M-u
M-l
#!/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 |
#!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): |
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.
dash_sniffer.service
/lib/systemd/system/
systemd
using command: systemctl daemon-reload
systemctl enable dash_sniffer.service
#!/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 |