manuals: man(1)
, apropos(1)
man man
- read the manual for thepkg_info
command.man 5 ethers
- read a manual in a specific section, such asethers(5)
apropos <manname>
- search for manuals by name
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)#!/bin/bash | |
# | |
# Convert ssh-agent output to fish shell | |
# | |
eval "$(ssh-agent)" >/dev/null | |
echo "set SSH_AUTH_SOCK \"$SSH_AUTH_SOCK\"; export SSH_AUTH_SOCK" | |
echo "set SSH_AGENT_PID \"$SSH_AGENT_PID\"; export SSH_AGENT_PID" |
#!/usr/bin/env python | |
from __future__ import print_function | |
import base64 | |
import sys | |
PEM = ("""-----BEGIN RSA PRIVATE KEY----- | |
MIIEogIBAAKCAQEAgK1Q6Ydi8UUheJLvnTYJE65NOZtAtjDdDSxS+6b4x9EakjIylljSzs5uLEJn |
As a developer, it bothers me when someone sends me a large pdf file compared to the number of pages. Recently, I recieved a 12MB scanned document for just one letter-sized page... so I got to googlin, like I usually do, and found ghostscript!
to learn more abot ghostscript (gs): https://www.ghostscript.com/
What we are interested in, is the gs command line tool, which provides many options for manipulating PDF, but we are interested in compressign those large PDF's into small yet legible documents.
credit goes to this answer on askubuntu forum: https://askubuntu.com/questions/3382/reduce-filesize-of-a-scanned-pdf/3387#3387?newreg=bceddef8bc334e5b88bbfd17a6e7c4f9
weechat | |
Relay setup | |
On the server's instance of weechat: | |
/relay add ssl.irc 8001 | |
/secure set relay WHATEVER_PASSWORD | |
/set relay.network.password "${sec.data.relay}" | |
On the server, to generate the ssl certificate: |
#!/bin/bash | |
# On my machine VLC fails to connect to chromecast. If I specify the IP it fails to connect because of certificate errors. I can | |
# manually download the certificate but it is only valid for 2 days. This little script gets it all working. | |
# Set your ip address below and call this script with the filename. | |
CHROMECAST_IP=192.168.1.153 | |
gnutls-cli --save-cert=chromecast.pem --insecure $CHROMECAST_IP:8009 | |
mkdir -p ~/.local/share/vlc/certs | |
mv chromecast.pem ~/.local/share/vlc/certs |
Put these lines into your server's .bashrc: | |
## | |
## TMUX auto attach | |
## | |
if [ -n "$SSH_CLIENT" ] || [ -n "$SSH_TTY" ]; then # if this is an SSH session | |
if which tmux >/dev/null 2>&1; then # check if tmux is installed | |
if [[ -z "$TMUX" ]] ;then # do not allow "tmux in tmux" | |
ID="$( tmux ls | grep -vm1 attached | cut -d: -f1 )" # get the id of a deattached session | |
if [[ -z "$ID" ]] ;then # if not available create a new one | |
tmux new-session |
The Linux kernel is written in C, so you should have at least a basic understanding of C before diving into kernel work. You don't need expert level C knowledge, since you can always pick some things up underway, but it certainly helps to know the language and to have written some userspace C programs already.
It will also help to be a Linux user. If you have never used Linux before, it's probably a good idea to download a distro and get comfortable with it before you start doing kernel work.
Lastly, knowing git is not actually required, but can really help you (since you can dig through changelogs and search for information you'll need). At a minimum you should probably be able to clone the git repository to a local directory.