Skip to content

Instantly share code, notes, and snippets.

View obatiuk's full-sized avatar
🇺🇦
#StandWithUkraine

Oleksii Batiuk obatiuk

🇺🇦
#StandWithUkraine
View GitHub Profile
@scy
scy / fix-expanded-svn-id.sh
Created September 12, 2012 10:28
Un-expand $Id$ in a git-svn repository, with some special powers
#!/bin/sh
# The problem:
#
# You have a clean git-svn working copy and, for example, rsync the files from
# the production server into it in order to find out whether some files have
# been changed directly on the server, without committing.
#
# However, the files on the production server possibly have $Id$ expanded, and
# now you're seeing a _lot_ of changed files which contain no differences except
@ckirsch
ckirsch / gpgmulti
Last active October 21, 2022 12:33
Symmetrically encrypt multiple files with GnuPG
#!/bin/bash
###############################################################################
## name : gpgmulti.sh (original by Nick Montpetit)
## purpose : symmetrically encrypts/decrypts multiple files using GnuPG
## usage : gpgmulti.sh [-c] file_pattern
###############################################################################
# encrypt all non-gpg files recursively:
# find . -type f -not -name .DS_Store -not -name "*.gpg" -print0 | xargs -0 -o gpgmulti.sh -c
@abtrout
abtrout / pass.md
Created July 8, 2014 14:51
Using password-store with git repository synching

Password-store keeps your passwords (or any other sensitive information) saved in GnuPG encrypted files organized in ~/.password-store. For more information about GPG, consult the GNU Privacy Handbook.

Getting started

To get started, install pass and generate a keypair.

$ brew install pass
$ gpg --gen-key
$ gpg --list-keys
@abesto
abesto / dependency-report.gradle
Created July 24, 2015 14:06
Gradle: multi-project dependency graph
task dependencyReport {
doLast {
def file = new File("project-dependencies.dot")
file.delete()
file << "digraph {\n"
file << "splines=ortho\n"
rootProject.childProjects.each { item ->
def from = item.value
from.configurations.compile.dependencies
.matching { it in ProjectDependency }
@bahmutov
bahmutov / README.md
Last active October 4, 2023 08:35
Single command to run Node with local file access

Goal: run a simple NodeJS application inside a Docker container

Subgoal: give it access to local files.

docker run -it --rm --name example -v "$PWD":/usr/src/app -w /usr/src/app node:5-slim node index.js

output:

#!/usr/bin/env bash
# mac-set-hostname.sh - This script will set the local machines name and
# domain information. Two parameters are required: <machine name> <domain name>
# Bash "strict" mode
set -euo pipefail
IFS=$'\n\t'
if [[ $# -lt 2 ]]; then
echo "You must pass 2 parameters, the host name and the domain name."
@jwalanta
jwalanta / OpenWrt detect new device and send text message.md
Last active February 10, 2024 09:16
Detect new network devices connecting to OpenWrt and send text message
@hannesbe
hannesbe / syno-vpn-keepalive.sh
Last active January 4, 2024 13:53
Script to keep VPN alive on Synology DSM. Checks if IP is pingable and if not: disconnect VPN, reconnect VPN & add routes
# syno-vpn-keepalive.sh
# ---
# Script to keep VPN alive on Synology DSM.
# Checks if IP is pingable and if not:
# disconnect VPN, reconnect VPN & add routes
# ---
# Modify vars:
# - CHECKIP: IP to check to be pingable before reconnecting VPN
# - NAME (Synology VPN name),
# - ID (Synology VPN ID), SSH to NAS & run this to find ID
@ageis
ageis / YubiKey-GPG-SSH-guide.md
Last active March 16, 2024 13:18
Technical guide for using YubiKey series 4 for GPG and SSH

YubiKey 4 series GPG and SSH setup guide

Written for fairly adept technical users, preferably of Debian GNU/Linux, not for absolute beginners.

You'll probably be working with a single smartcard, so you'll want only one primary key (1. Sign & Certify) and two associated subkeys (2. Encrypt, 3. Authenticate). I've published a Bash function which automates this slightly special key generation process.

# ubuntu.daniguardiola.me - start
# fix for yarn global path
export PATH="$(yarn global bin):$PATH"
# fix ~/.local/bin path
export PATH="$HOME/.local/bin:$PATH"
# put android sdk tools on path