Skip to content

Instantly share code, notes, and snippets.

@syxolk
syxolk / upgrade-postgres.md
Last active July 18, 2022 11:32
Upgrade Postgresql 10 to 11 on Arch Linux

This guide is mainly based on Arch's wiki, with some additions:

  • I couldn't upgrade the database because the upgrade tool needs the postgis-2.4.so file
  • The created cluster could not be used to upgrade from the old data because the locale was set to 'C' (needed to add --locale=en_US.UTF-8)
  • The upgrade tool checks if the the new postgresql installation has a compatible postgis version. That means we need postgis 2.4 for postgresql 11. Unfortunately, we cannot install it over the package manager, instead we need to compile it from source.
# Stop currently running server
systemctl stop postgresql.service

# Install new packages
@crittermike
crittermike / wget.sh
Last active March 26, 2024 22:49
Download an entire website with wget, along with assets.
# One liner
wget --recursive --page-requisites --adjust-extension --span-hosts --convert-links --restrict-file-names=windows --domains yoursite.com --no-parent yoursite.com
# Explained
wget \
--recursive \ # Download the whole site.
--page-requisites \ # Get all assets/elements (CSS/JS/images).
--adjust-extension \ # Save files with .html on the end.
--span-hosts \ # Include necessary assets from offsite as well.
--convert-links \ # Update links to still work in the static version.
@cryzed
cryzed / fix-infinality.md
Last active January 19, 2024 08:56
A set of instructions on how to fix the harfbuzz + Infinality issue and restoring good-looking, Infinality-like font rendering.

Disclaimer: Please follow this guide being aware of the fact that I'm not an expert regarding the things outlined below, however I made my best attempt. A few people in IRC confirmed it worked for them and the results looked acceptable.

Attention: After following all the steps run gdk-pixbuf-query-loaders --update-cache as root, this prevents various gdk-related bugs that have been reported in the last few hours. Symptoms are varied, and for Cinnamon the DE fails to start entirely while for XFCE the icon theme seemingly can't be changed anymore etc.

Check the gist's comments for any further tips and instructions, especially if you are running into problems!

Screenshots

Results after following the guide as of 11.01.2017 13:08:

@rubik
rubik / .gitignore
Last active August 29, 2015 14:15
Formulario di Chimica I e principali composti organici
*.aux
*.fdb_latexmk
*.pdf
*.log
*.fls
@carlsmith
carlsmith / barcode.py
Last active March 27, 2018 11:15
Interleaved 2 of 5, SVG Barcode Generator
def render(digits):
'''This function converts its input, a string of decimal digits, into a
barcode, using the interleaved 2 of 5 format. The input string must not
contain an odd number of digits. The output is an SVG string.
Wikipedia [ITF Format]: http://en.wikipedia.org/wiki/Interleaved_2_of_5
'''
top = '<svg height="58" width="{0}" style="background:white">'
@tsiege
tsiege / The Technical Interview Cheat Sheet.md
Last active April 20, 2024 16:52
This is my technical interview cheat sheet. Feel free to fork it or do whatever you want with it. PLEASE let me know if there are any errors or if anything crucial is missing. I will add more links soon.

ANNOUNCEMENT

I have moved this over to the Tech Interview Cheat Sheet Repo and has been expanded and even has code challenges you can run and practice against!






\

@keis
keis / coro.py
Created April 14, 2014 08:27
asyncio examples
import asyncio
@asyncio.coroutine
def waiting(r):
print("hello from waiting -", r)
yield from asyncio.sleep(2)
print("bye from waiting -", r)
return r
@rubik
rubik / arch-strap.sh
Last active December 18, 2015 16:38
A little script that does the basic things when installing ArchLinux
#!/bin/bash
# Configuration
root=/dev/sda3
boot=/dev/sda1
home=/dev/sda4
lang=en_US-UTF-8
keyboard=it
zone=Europe
subzone=Rome
@rubik
rubik / A.py
Last active December 16, 2015 17:39
My solution to the problem A of the round 1A of Google Code Jam 2013
'''
Problem solution
----------------
The area of a circular ring is:
pi * (R^2 - r^2)
where R is the radius of the bigger circle and r
the radius of the other one.
@jpetazzo
jpetazzo / README
Created November 9, 2012 22:37
autobahn websocket on dotCloud
Autobahn on dotCloud!
This code is 99% Autobah example code, 1% dotCloud adaptation.
To test this on dotCloud:
- create a dotCloud account at http://www.dotcloud.com/
(free, no credit card)
- install dotCloud CLI, see http://docs.dotcloud.com/