Skip to content

Instantly share code, notes, and snippets.

@xirkus
xirkus / yubikey+gpupgp+ssh_howto.md
Last active April 25, 2025 08:27
Security Adventures 1. How to get yubikey+gpg+ssh+gitbhub working on MacOS

I've spent the day trying to get this setup working with GitHub and given the number of gotcha's I encountered, it seemed like a good idea to document how I finally got this working with as few hacks as possible. There's a lot of documentation out there (some of it old and misleading) and committing here for posterity will help me remember this when I inevitably need to do this again.

Rationale

Passwords are simply not enough these days. Regardless of the company, breaches (and the associated Personally Identifiable Information harvested) are a matter of not if, but when. There are a number of things you can do to protect yourself, but being on the tin-foil-hat side of paranoia, means there are a few Commandents that I adhere to (and recommend for other folks)[Insert link to Fight Club Rules for the Secure Internet].

That being said, if you use 2-factor authentication and have committed to using a hardware token such as the Yubikey, then you're already ahead of the curve. The problem is that wh

@ekanant
ekanant / docker_compose_mysql_backup.sh
Last active October 25, 2024 13:59
Backup and restore MySQL in docker-compose
#reference https://medium.com/@siriphonnot/backup-and-restore-a-mysql-database-from-a-running-docker-mysql-container-6c932907e21f
#reference https://medium.com/@vineetcic/script-to-take-mysql-database-backup-for-last-7-days-45f97ed067a9
mysqlUser="root"
mysqlPassword="xxxxx"
mysqlHost="127.0.0.1"
DB="my_db"
credentialsFile="/mysql-credentials.cnf"
/usr/local/bin/docker-compose exec -T mysql bash -c "
@Zhendryk
Zhendryk / The Ultimate Windows Development Environment.md
Last active February 21, 2025 02:16
How to set up the ultimate Windows development environment
@hellt
hellt / R1_nokia.cfg
Created June 17, 2020 10:04
R1 Nokia baseline config
# TiMOS-B-14.0.R4 both/i386 Nokia 7750 SR Copyright (c) 2000-2016 Nokia.
# All rights reserved. All use subject to applicable license agreements.
# Built on Thu Jul 28 17:26:53 PDT 2016 by builder in /rel14.0/b1/R4/panos/main
# Generated SUN MAR 13 06:28:52 2016 UTC
exit all
configure
#--------------------------------------------------
echo "System Configuration"
@linuxmalaysia
linuxmalaysia / sysctl-conf.txt
Created June 7, 2020 02:33
sysctl.conf for elasticsearch node
vm.max_map_count=262144
net.core.default_qdisc = fq
net.ipv4.tcp_congestion_control = bbr
net.ipv4.tcp_notsent_lowat = 16384
net.core.somaxconn = 4096
# Increase size of file handles and inode cache
fs.file-max = 20971520
# Do less swapping
@s3rj1k
s3rj1k / HowTo
Last active May 4, 2025 21:37
Ubuntu 20.04.3 AutoInstall
# For recent versions of Ubuntu:
- https://www.pugetsystems.com/labs/hpc/ubuntu-22-04-server-autoinstall-iso/
# Docs:
- https://wiki.ubuntu.com/FoundationsTeam/AutomatedServerInstalls
- https://wiki.ubuntu.com/FoundationsTeam/AutomatedServerInstalls/ConfigReference
- https://cloudinit.readthedocs.io/en/latest/topics/datasources/nocloud.html
- https://discourse.ubuntu.com/t/please-test-autoinstalls-for-20-04/15250/53
# Download ISO Installer:
@marufshidiq
marufshidiq / HOWTO.md
Created April 12, 2020 07:03
Backup and Restore mongodb inside docker-compose container

How to backup

docker-compose exec -T <mongodb_service_name> mongodump --archive --gzip --db <mongodb_database> > dump.gz

How to restore

docker-compose exec -T  mongorestore --archive --gzip &lt; dump.gz
@ragul28
ragul28 / Docker-Export.md
Created January 11, 2020 09:02
Docker Container & image export/import

Export running or paused Container:

  • Export
docker export <dockernameortag> | gzip > mycontainer.tgz
  • Load
gunzip -c mycontainer.tgz | docker load
@tgfarias
tgfarias / main
Last active October 25, 2024 13:59
Docker commands
#Start docker
docker-compose up -d --build --force-recreate
#Import database
docker exec -i [container] mysql -u[user] -p[pass] [database] -v < [path_of_sql_import]
# Backup
docker exec CONTAINER /usr/bin/mysqldump -u root -pPASSWORD DATABASE > backup.sql
docker exec CONTAINER /usr/bin/mysqldump -u root -pPASSWORD DATABASE | gzip > backup.sql.gz
docker exec CONTAINER /usr/bin/mysqldump -u root -pPASSWORD DATABASE | bzip2 > backup.sql.bz2
@hjbotha
hjbotha / free_ports.sh
Last active May 20, 2025 14:10
Free ports 80 and 443 on Synology NAS
#! /bin/bash
# NEWLY ADDED BACKUP FUNCTIONALITY IS NOT FULLY TESTED YET, USE WITH CARE, ESPECIALLY DELETION
# Developed for DSM 6 - 7.0.1. Not tested on other versions.
# Steps to install
# Save this script in one of your shares
# Edit it according to your requirements
# Backup /usr/syno/share/nginx/ as follows:
# # cd /usr/syno/share/
# # tar cvf ~/nginx.tar nginx