#!C:\perl\perl\bin | |
# sudo apt-get install libmodern-perl-perl libstring-crc32-perl | |
use Modern::Perl; | |
use String::CRC32; | |
my $sil = 0; | |
my $debugmode = 0; | |
my $start = time; | |
my @files; |
#!/bin/bash | |
IPT="/sbin/iptables" | |
# Server IP | |
SERVER_IP="$(ip addr show eth0 | grep 'inet ' | cut -f2 | awk '{ print $2}')" | |
# Your DNS servers you use: cat /etc/resolv.conf | |
DNS_SERVER="8.8.4.4 8.8.8.8" | |
# Allow connections to this package servers |
Magic words:
psql -U postgres
Some interesting flags (to see all, use -h
or --help
depending on your psql version):
-E
: will describe the underlaying queries of the\
commands (cool for learning!)-l
: psql will list all databases and then exit (useful if the user you connect with doesn't has a default database, like at AWS RDS)
Here goes. | |
ls /usr/src/linux-headers-* -d | sed -e 's/.*linux-headers-//' | \ | |
sort -V | tac | sudo xargs -n1 /usr/lib/dkms/dkms_autoinstaller start | |
Run as root. |
First, install the necesssary packages:
% apt-get install libpam-oath oathtool
Generate a key and write it to /etc/users.oath
(NB the key will be in hexadecimal; if you are using Authy you will want to convert it to BASE32):
% KEY=$( head -c 1024 /dev/urandom | openssl sha1 | awk '{ print $2 }' )
% echo "HOTP/T30/6 andrewlkho - ${KEY}" >> /etc/security/users.oath
% chmod 600 /etc/users.oath
This is a collection of the most common commands I run while administering Postgres databases. The variables shown between the open and closed tags, "<" and ">", should be replaced with a name you choose. Postgres has multiple shortcut functions, starting with a forward slash, "". Any SQL command that is not a shortcut, must end with a semicolon, ";". You can use the keyboard UP and DOWN keys to scroll the history of previous commands you've run.
http://www.postgresql.org/download/linux/ubuntu/ https://help.ubuntu.com/community/PostgreSQL
Inspired by dannyfritz/commit-message-emoji
See also gitmoji.
Commit type | Emoji |
---|---|
Initial commit | 🎉 :tada: |
Version tag | 🔖 :bookmark: |
New feature | ✨ :sparkles: |
Bugfix | 🐛 :bug: |
// Linux driver for B&K Precision 393 multimeter. | |
// g++ -Wall -Wextra -std=c++11 -o bk393 bk393.cc | |
// It currently points to /dev/ttyUSB0, but I'd recommend adding a udev rule to get a consistent device name: | |
// SUBSYSTEMS=="usb", ATTRS{idVendor}=="0403", ATTRS{idProduct}=="6001", ATTRS{serial}=="A60198LN", MODE="0664", GROUP="mygroup", SYMLINK+="bk393" | |
#include <boost/utility.hpp> | |
#include <array> | |
#include <iomanip> | |
#include <cstdio> |