Skip to content

Instantly share code, notes, and snippets.

@Seefin
Seefin / backup.sh
Created March 23, 2015 09:41
A backup script using rsync and etckeeper, written in bash.
#!/bin/bash
# Backs stuff up. This script uses rsync to back stuff up to the backup drive. It
# is *not* version control, so it only has a single copy of the tree; this increases
# speed and keeps the file IO time to a minimum.
# !!!
# THIS SCRIPT CAN AND WILL DELETE THINGS FROM THE DESTINATION.
# !!!
# To pass in a non-standard source and destination, run this script like so:
# backup.sh <SRC> <DEST>
#
@developius
developius / README.md
Last active April 1, 2026 15:21
Setup SSH keys for use with GitHub/GitLab/BitBucket etc

Create a new repository, or reuse an existing one.

Generate a new SSH key:

ssh-keygen -t rsa -C "your_email@example.com"

Copy the contents of the file ~/.ssh/id_rsa.pub to your SSH keys in your GitHub account settings (https://github.com/settings/keys).

Test SSH key:

@eddiejaoude
eddiejaoude / README.md
Last active September 18, 2024 07:21
Install Firefox addon/extension with no user interaction
@YuriyGuts
YuriyGuts / linux-mint-install-everything.sh
Last active February 4, 2026 10:54
[DEPRECATED: use https://github.com/YuriyGuts/linux-setup instead] A script to install most of the necessary software on a fresh Linux Mint installation. Uses Google Drive to import settings for specific applications. Latest revision: Linux Mint 21.1 Vera / Ubuntu 22.04
#!/bin/bash
# =========== CONFIG =============
# Assuming we'll set the Google Drive folder to ~/GoogleDrive
GOOGLE_DRIVE_FOLDER=$HOME/GoogleDrive
# ================================
# =========== ESSENTIAL ALIASES ==========
INSTALL='sudo apt install --yes'
@davehull
davehull / Resolve-WindowsGUID.ps1
Last active June 12, 2026 11:38
Useful for resolving some Windows GUIDs to human friendly values
<#
.SYNOPSIS
Resolves many Windows GUIDs to human friendly values.
.DESCRIPTION
Resolve-WindowsGUID.ps1 takes a GUID from a Windows system and attempts
to return a human friendly value from either a static list or from a
dynamically generated list of LogProvider GUIDs. There are undoubtedly
other GUIDs in use throughout Windows that will not fall into either of
these sets. If you encounter a GUID that you can't resolve via this
@flbuddymooreiv
flbuddymooreiv / passgitgpg.md
Last active February 23, 2026 10:59
Setting up pass on git with a gpg key

The following shell transcript shows how to:

  • Create a GPG key
  • Create a pass database
  • Add git support to the pass database
  • Create a remote git repository
  • Push the pass database to the remote git repository
  • Fetch and display your passwords from another host

It is assumed that the pass package has been installed on both the first and second computers.

@rponte
rponte / copying-rsync.sh
Last active February 23, 2023 09:30
Copying all files from a directory to another using rsync (only difference)
# don't forget the slash (/) at end of dir
rsync -av original-uploads/ uploads/
# the best way to keep target-dir synchronized with source-dir (even deleted files are synchronized)
rsync -auvz --delete original-uploads/ uploads/
# synchronizing local-dir into remote-dir (in the end we'll have a dir on remote machine as this: ~/my-files/original-uploads)
# warning: pay attention to the lack of slash in original-dir
rsync -auvz --delete original-uploads rponte@triadworks.com.br:~/my-files
@yvele
yvele / get-npm-package-version.sh
Last active April 27, 2024 04:19
Extract version from package.json (NPM) using bash / shell
# Version key/value should be on his own line
PACKAGE_VERSION=$(cat package.json \
| grep version \
| head -1 \
| awk -F: '{ print $2 }' \
| sed 's/[",]//g' \
| tr -d '[[:space:]]')
echo $PACKAGE_VERSION
@YuriyGuts
YuriyGuts / gist-clone-all.py
Last active February 26, 2024 05:32
Clones all GitHub Gists for the specified user.
#!/usr/bin/env python
"""
Clone all GitHub Gists for the specified user.
Copyright (c) 2018 Yuriy Guts
usage: gist-clone-all.py [-h] user token
positional arguments:
user Which user's Gists to clone.