Skip to content

Instantly share code, notes, and snippets.

View AkechiShiro's full-sized avatar
🌴
Away, might not able to respond in a timely manner, pause on open source

Samy Lahfa AkechiShiro

🌴
Away, might not able to respond in a timely manner, pause on open source
View GitHub Profile
@mischief
mischief / openbsd-cheatsheet.md
Last active May 21, 2024 18:27
openbsd cheatsheet

openbsd cheatsheet

manuals

manuals: man(1), apropos(1)

  • man man - read the manual for the pkg_info command.
  • man 5 ethers - read a manual in a specific section, such as ethers(5)
  • apropos <manname> - search for manuals by name
@Kartones
Kartones / postgres-cheatsheet.md
Last active November 15, 2024 21:14
PostgreSQL command line cheatsheet

PSQL

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)
@josh-padnick
josh-padnick / fish-agent.sh
Last active July 6, 2024 11:20
Run ssh-agent via fish shell
#!/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"
@Happyholic1203
Happyholic1203 / PyOpenSSL example
Last active June 14, 2023 19:35 — forked from shatil/punnel.py
Python OpenSSL libraries' private key signing vs. OpenSSL's rsautl
#!/usr/bin/env python
from __future__ import print_function
import base64
import sys
PEM = ("""-----BEGIN RSA PRIVATE KEY-----
MIIEogIBAAKCAQEAgK1Q6Ydi8UUheJLvnTYJE65NOZtAtjDdDSxS+6b4x9EakjIylljSzs5uLEJn
@ahmed-musallam
ahmed-musallam / compress_pdf.md
Last active November 13, 2024 03:47
How to compress PDF with ghostscript

How to compress PDF using ghostscript

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

@miblodelcarpio
miblodelcarpio / notes_weechat
Last active November 7, 2024 07:28
WeeChat Relay Setup
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:
@agronick
agronick / vlctv.sh
Created December 3, 2018 23:49
VLC Linux with Chromecast: Solution to error "gnutls tls client error: Certificate verification failure: The certificate is NOT trusted. The certificate issuer is unknown. The name in the certificate does not match the expected. "
#!/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
@orangecms
orangecms / coreboot-p34v2.md
Last active October 29, 2024 20:15
Porting guide for coreboot: GIGABYTE P34G v2 / Schenker XMG C404

Porting coreboot to a Haswell / Lynx Point laptop: GIGABYTE P34G v2

This mainboard was sold by Schenker XMG as C404, while the original model name by GIGABYTE is P34G v2.

The board schematics are not publicly available. However, from another laptop board's schematics, we can learn a bit about the components it should have: laptop mainboard schematics

autoport

@ThomasLeister
ThomasLeister / auto-start-tmux-ssh.txt
Last active September 30, 2024 11:26
Put this into your .bashrc to auto-start a tmux session after SSH login
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
@vegard
vegard / kernel-dev.md
Last active November 18, 2024 21:03
Getting started with Linux kernel development

Getting started with Linux kernel development

Prerequisites

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.