Skip to content

Instantly share code, notes, and snippets.

View ahxxm's full-sized avatar
🚘
On The Road

ahxxm ahxxm

🚘
On The Road
View GitHub Profile
@chrisroos
chrisroos / gpg-import-and-export-instructions.md
Created September 9, 2011 10:49
Instructions for exporting/importing (backup/restore) GPG keys

Every so often I have to restore my gpg keys and I'm never sure how best to do it. So, I've spent some time playing around with the various ways to export/import (backup/restore) keys.

Method 1

Backup the public and secret keyrings and trust database

cp ~/.gnupg/pubring.gpg /path/to/backups/
cp ~/.gnupg/secring.gpg /path/to/backups/
cp ~/.gnupg/trustdb.gpg /path/to/backups/

or, instead of backing up trustdb...

@jandk
jandk / cleanup.sh
Last active December 21, 2018 14:30
Clean up some gentoo files
#!/bin/sh
echo "Space free"
df -h | head -n 2
echo "Removing foreign man pages"
find /usr/share/man -type d -not -name man*
echo "Removing gtk docs"
rm -rf /usr/share/gtk-doc
@UniIsland
UniIsland / SimpleHTTPServerWithUpload.py
Created August 14, 2012 04:01
Simple Python Http Server with Upload
#!/usr/bin/env python
"""Simple HTTP Server With Upload.
This module builds on BaseHTTPServer by implementing the standard GET
and HEAD requests in a fairly straightforward manner.
"""
@arantius
arantius / create-test-container.script
Last active April 6, 2019 12:38
How To Install Gentoo Onto Any OpenVZ VPS
# vzctl create 200 --config unlimited --ostemplate \
> debian-6.0-x86 --ipadd 192.168.202.200 --hostname guest
Creating container private area (debian-6.0-x86)
Performing postcreate actions
CT configuration saved to /etc/vz/conf/200.conf
Container private area was created
# vzctl start 200
Starting container...
Container is mounted
Adding IP address(es): 192.168.202.200
# emerge --sync
# eselect news read new
# emerge portage
# emerge eix
# eix-update
# screen -R eme
# emerge -uDNa --with-bdeps=y world
# nano /etc/conf.d/hostname
@codefisher
codefisher / DecoratorsAndContentManagers.html
Last active July 4, 2018 17:31
Python decorators and context managers
<p>
Two weeks ago I wrote a post called <a href="https://codefisher.org/catch/blog/2015/01/27/python-tips-tricks-and-idioms/">Python: tips, tricks and idioms</a> where I went though a whole lot of features of python. Now however I want to narrow down on just a few, and look at them in more depth. The first is decorators, which I did not cover at all, and the second is context managers which I only gave one example of.
</p>
<p>
There is a reason that I put them together; they both have the same goal. They can both help separate what your trying to do (the "business logic") from some extra code added for clean up or performance etc. (the "administrative logic"). So basically it helps package away in a reusable way code that really we don't care too much about.
</p>
<h2>Decorators</h2>
@touilleMan
touilleMan / SimpleHTTPServerWithUpload.py
Last active June 16, 2024 01:51 — forked from UniIsland/SimpleHTTPServerWithUpload.py
Simple Python Http Server with Upload - Python3 version
#!/usr/bin/env python3
"""Simple HTTP Server With Upload.
This module builds on BaseHTTPServer by implementing the standard GET
and HEAD requests in a fairly straightforward manner.
see: https://gist.github.com/UniIsland/3346170
"""
@tbarbugli
tbarbugli / How to build a notification feed.md
Last active October 17, 2021 20:13 — forked from tschellenbach/notify_tut.md
How to build a notification feed using Stream

How to build a notification feed using Stream

Introduction

In this tutorial we are going to show how easy it is to build a notification feed using GetStream.io. First of all, let's quickly introduce you to our fictional example app. It's called bug-your-friends.com and allows you interact with your friends, ping them, follow them or poke them. Here's a quick list of example interactions:

  • poke another user (eg. Thierry pokes Alessandra)
  • follow a user (eg. Tommaso follows Iris)
  • ping a user (eg. Josie pings Carolina)

Whenever a user is part of one of these interactions, we want to update his notification feed, update the number of unseen and unread

@imjasonh
imjasonh / markdown.css
Last active May 24, 2024 22:56
Render Markdown as unrendered Markdown (see http://jsbin.com/huwosomawo)
* {
font-size: 12pt;
font-family: monospace;
font-weight: normal;
font-style: normal;
text-decoration: none;
color: black;
cursor: default;
}