Skip to content

Instantly share code, notes, and snippets.

View nikodemusk's full-sized avatar

Nikodemus Karlsson nikodemusk

View GitHub Profile
@mcattarinussi
mcattarinussi / gpg-ssh-setup.md
Last active April 14, 2025 02:34
A setup guide to use a personal gpg key for ssh authentication

GPG - SSH setup

Generating the master key

Here we create the master key. We want only Certify capability: we use the master key only to create the subkeys, Sign - Encrypt - Authenticate capabilities will be assigned to the subkeys.

Run the following command to start the master key generation process. Select the set your own capabilities creation process (type 8)

  ▶ gpg --full-generate-key --expert

gpg (GnuPG) 2.2.9; Copyright (C) 2018 Free Software Foundation, Inc.

@rene-d
rene-d / colors.py
Last active April 11, 2025 17:22
ANSI color codes in Python
# SGR color constants
# rene-d 2018
class Colors:
""" ANSI color codes """
BLACK = "\033[0;30m"
RED = "\033[0;31m"
GREEN = "\033[0;32m"
BROWN = "\033[0;33m"
BLUE = "\033[0;34m"
@johnburnmurdoch
johnburnmurdoch / .block
Last active March 25, 2023 06:13
Spirograph effect in HTML canvas
license: mit
height: 545
scrolling: no
border: no
@Myfanwy
Myfanwy / custom css for reveal.js slideshow in R
Last active August 20, 2023 16:58
Custom css for reveal.js slideshow
/**
* A simple theme for myfanwy.github.io
*
* reveal.js is Copyright (C) 2011-2012 Hakim El Hattab, http://hakim.se
*/
<link href='http://fonts.googleapis.com/css?family=Megrim' rel='stylesheet' type='text/css'>
<link href='http://fonts.googleapis.com/css?family=Raleway:300,400,700' rel='stylesheet' type='text/css'>
/*********************************************
@awesomebytes
awesomebytes / ipython_to_file.md
Created March 16, 2016 10:38
Save iPython session to a python file as code

Save an iPython session commands/code to a file

You must use the magic method %save:

In [1]: %save?
Type:       Magic function
String Form:<bound method CodeMagics.save of <IPython.core.magics.code.CodeMagics object at 0x7fb5d25bb1d0>>
Namespace:  IPython internal
File: /usr/lib/python2.7/dist-packages/IPython/core/magics/code.py
@oanhnn
oanhnn / using-multiple-github-accounts-with-ssh-keys.md
Last active April 21, 2025 09:17
Using multiple github accounts with ssh keys

Problem

I have two Github accounts: oanhnn (personal) and superman (for work). I want to use both accounts on same computer (without typing password everytime, when doing git push or pull).

Solution

Use ssh keys and define host aliases in ssh config file (each alias for an account).

How to?

  1. Generate ssh key pairs for accounts and add them to GitHub accounts.
@palimadra
palimadra / stackedit-markdown-cheat-sheet
Last active March 31, 2022 23:16
Cheat Sheet for Markdown on stackedit.io
<!---
Author: Pali Madra
URL: http://palimadra.tumblr.com
Description: Cheat sheet for markdown on stackedit.io at http://www.stackedit.io
Version: 1.0
Last updated: 10/26/2014
--->
<!--- HEADING --->
# Header 1 #
@todgru
todgru / starttmux.sh
Last active September 26, 2024 04:28
Start up tmux with custom windows, panes and applications running
#!/bin/sh
#
# Setup a work space called `work` with two windows
# first window has 3 panes.
# The first pane set at 65%, split horizontally, set to api root and running vim
# pane 2 is split at 25% and running redis-server
# pane 3 is set to api root and bash prompt.
# note: `api` aliased to `cd ~/path/to/work`
#
session="work"
@MohamedAlaa
MohamedAlaa / tmux-cheatsheet.markdown
Last active April 20, 2025 21:04
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname

tmux cheatsheet

As configured in my dotfiles.

start new:

tmux

start new with session name: