Skip to content

Instantly share code, notes, and snippets.

Debian packages must adhere to a strict directory structure.

control file, DEBIAN/control

Package: libgmp Version: 6.1.2 Architecture: all Essential: no Section: lib Priority: optional

@np43
np43 / TrueColour.md
Created November 24, 2019 04:38 — forked from XVilka/TrueColour.md
True Colour (16 million colours) support in various terminal applications and terminals

Terminal Colors

There exists common confusion about terminal colors. This is what we have right now:

  • Plain ASCII
  • ANSI escape codes: 16 color codes with bold/italic and background
  • 256 color palette: 216 colors + 16 ANSI + 24 gray (colors are 24-bit)
  • 24-bit true color: "888" colors (aka 16 milion)
#!/bin/bash
# Steps to repackage binary debian package (.deb)
_pkgname=package
_debpkg=package.deb
_newdeb=newpackage.deb
_builddir=`pwd`/build
#1: Extract deb package
dpkg -x $_debpkg $_builddir
#!/usr/bin/env bash
#set -u #ignores the variable that does not exist
#set -o nounset #same as set -u
#set -x #output the executed command line before its execution result
#set -o xtrace #same as set -x
#set -e #execution terminates whenever an error occurs
#set -o errexit #same as set -e
#set -o pipefail
@np43
np43 / hosts.txt
Created August 17, 2019 07:05 — forked from Ifiht/hosts.txt
Full telehack hosts list
host organization location
---- ------------ --------
3comvax 3Com Corporation Santa Clara, CA
a3bee2 Compusoft Wallingford, CT
aaachoo AAA National Head Quarters - NTS/OTI Virginia
aaahq01 American Automobile Association, Hea Heathrow, Florida
aablue AA Blueprint Co., Inc. Ohio
aai Amerinex Artificial Intelligence Amherst, MA
aaisd Advantest America Inc., Software Div Santa Clara, CA
aardvark Steve's Unix System, Portland Portland, Oregon
@np43
np43 / gist:c352210157689eb7c6390e3cecf0686f
Created June 24, 2019 22:09
process map with loaded libraries
# Get the pid of the process to be inspected, and get the list of the libraries used by looking at the corresponding map file.
#i.e. for pid 10213
cat /proc/10213/maps | grep .so | cut -d/ -f2- | sort -u
$ git remote rm origin
$ git remote add origin git@github.com:aplikacjainfo/proj1.git
$ git config master.remote origin
$ git config master.merge refs/heads/master
@np43
np43 / PostGIS 2.0 Cheatsheet.md
Created March 29, 2019 22:05 — forked from kidpixo/PostGIS 2.0 Cheatsheet.md
PostGIS 2.0 Cheatsheet

S5

S5 is an abbreviation for Snap Serv Server Stack Script. Basically it is meant for setting up a fresh Debian Wheezy x86/x64 system. You can read everything it does in config.sh, which is an example config. Remember to adjust to example configuration to some sane values.

Usage

  1. Connect to your fresh server

  2. Adjust network configuration if necessary

  3. Download s5.sh and config.sh into /root:

#!/bin/bash
# <UDF name="HOSTNAME" Label="server hostname" default="linode"/>
# <udf name="PACKAGES" label="Packages to install" manyOf="Varnish, Nginx, Postgres, Redis, Beanstalk, Memcache" default="">
###########################################################
# System Helpers
###########################################################
function system_update {
apt-get update