Skip to content

Instantly share code, notes, and snippets.

View soda92's full-sized avatar

Maple soda92

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...

@davidruhmann
davidruhmann / Base64.html
Last active December 18, 2024 02:33
[Javascript][HTML] Dynamically Change FavIcon with Base64 Image.
<!-- Green R0lGODlhEAAQAPewAFSeAFWfAFafAFegAFigAFmhAFqiAFuiAF2jAF+kAGClAGKmAGSnAGWoAGepAGqqAGurAHCuAHOwAHeyAHu0Bn62DIS5F4W6Goy+Jo/PEJHQFJLQF5TRGZXRHJbSH5vUHpLBMpTCNZjFPJvGPZ7IP5fSIJjTJJvUIJrUJ5zUIZ7VJZvUKp/WKJ3VLp7VL57VMJ/WMaDWK6HXLaXYKqPXMKDWNKDWNaHWNqHXN6LXOaPXO6TYNKXYNabZOKTYPaXYPqjaPaTLQqTMQ6vPRqbZQafZQ6vQR6rbQqjaRanaR6rbSqvbS63cUK7cUq/dVLLTSrTUS7jXTrvYT7LeU7LdVbHdWLHeWbPeXbTfX7bfXr7aUbXfYbbgUrfgXrjgX7fgZbjhYrrhZrnhaLvia7ziarzia73ibb3jbL3ibr7jbsLcU8PdVMjgV8ziWc3jWs7jWtDkW9HlXMDkdMHkdcHldcLld8LleMPlesPle8PmesXmfsbnfcbmf8bngcbogsfog8jng8nohsnoh8roh8rpicvoicvpi8zpjMzpjc3qkc7qkM/qk8/rk8/rlNHrltPrm9HsmdLsmdLsm9TtntTtn9btodbtotfupNfupdjup9nvqtrwrtzwr9zwsdzwst7xtN/xt+DyuuHyvOX0xOn2zer20Oz31O341+/42vD53fH54PL64vP64/P65PX76P///wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
@Snegovikufa
Snegovikufa / mouseover.xaml
Created February 21, 2014 09:38
XAML mouse over button background
<Style TargetType="{x:Type Button}">
<Setter Property="Background" Value="Green"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type Button}">
<Border Background="{TemplateBinding Background}">
<ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"/>
</Border>
</ControlTemplate>
</Setter.Value>
@myusuf3
myusuf3 / delete_git_submodule.md
Created November 3, 2014 17:36
How effectively delete a git submodule.

To remove a submodule you need to:

  • Delete the relevant section from the .gitmodules file.
  • Stage the .gitmodules changes git add .gitmodules
  • Delete the relevant section from .git/config.
  • Run git rm --cached path_to_submodule (no trailing slash).
  • Run rm -rf .git/modules/path_to_submodule (no trailing slash).
  • Commit git commit -m "Removed submodule "
  • Delete the now untracked submodule files rm -rf path_to_submodule
@evantoli
evantoli / GitConfigHttpProxy.md
Last active July 31, 2025 12:13
Configure Git to use a proxy

Configure Git to use a proxy

In Brief

You may need to configure a proxy server if you're having trouble cloning or fetching from a remote repository or getting an error like unable to access '...' Couldn't resolve host '...'.

Consider something like:

@robertpainsi
robertpainsi / commit-message-guidelines.md
Last active July 31, 2025 11:19
Commit message guidelines

Commit Message Guidelines

Short (72 chars or less) summary

More detailed explanatory text. Wrap it to 72 characters. The blank
line separating the summary from the body is critical (unless you omit
the body entirely).

Write your commit message in the imperative: "Fix bug" and not "Fixed
bug" or "Fixes bug." This convention matches up with commit messages
@santisbon
santisbon / Search my gists.md
Last active July 19, 2025 15:46
How to search gists.

Enter this in the search box along with your search terms:

Get all gists from the user santisbon.
user:santisbon

Find all gists with a .yml extension.
extension:yml

Find all gists with HTML files.
language:html

@ammgws
ammgws / missing_ufw_samba.md
Last active May 28, 2025 11:00
Missing ufw samba application profile in /etc/ufw/applications.d

Am using a samba share on Ubuntu 16.04 server, and wanted to enable Samba traffic in ufw using sudo ufw allow from 192.168.8.0/24 to any app Samba comment 'allow samba from local' which returned the error "ERROR: Could not find a profile matching 'Samba'".

Cause: I was using the minimal amount of tooling required to use Samba (cifs-tools) on my server, which doesn't include the Samba application file.

Fix: install the samba package... or manually create the file:

sudoedit /etc/ufw/applications.d/samba

[Samba]
title=LanManager-like file and printer server for Unix
@topin89
topin89 / get_processes_dlls_threads.py
Created June 12, 2018 20:52
For Windows, get all processes, theirs modules (aka DLLs) and threads in Python 3
#Based on recipe http://code.activestate.com/recipes/576362-list-system-process-and-process-information-on-win/
#also hosted here https://github.com/ActiveState/code/blob/master/recipes/Python/576362_List_System_Process_Process/recipe-576362.py
#by winterTTr Dong , http://code.activestate.com/recipes/users/4164498/
#updated by topin89
#License: MIT
from ctypes import c_long , c_int , c_uint , c_char , c_ubyte , c_char_p , c_void_p, c_size_t, c_ulong, c_wchar
from ctypes import windll
from ctypes import Structure
from ctypes import sizeof , POINTER , pointer , cast
@Pagliacii
Pagliacii / win_api_test.py
Last active January 9, 2025 10:49
Use ctypes to call WIndows API
#!/usr/bin/env python3
# _*_ coding:utf-8 _*_
import ctypes
import os
from ctypes import windll, wintypes
from typing import Optional
NULL: int = 0