Skip to content

Instantly share code, notes, and snippets.

@gadido30
gadido30 / imgpkg-chart.sh
Created August 12, 2023 06:13 — forked from voor/imgpkg-chart.sh
Create an imgpkg bundle from a helm chart with any additional overlays you might need.
#!/usr/bin/env sh
set -eux -o pipefail
CHART_NAME=gitlab-runner
SERVICE_FOLDER=${CHART_NAME}
CHART_REPO_NAME=gitlab
CHART_REPO_URL=https://charts.gitlab.io
HARBOR_REPO=your.repo.example.com
@gadido30
gadido30 / autostart.sh
Created January 23, 2018 21:38 — forked from philcryer/autostart.sh
An example /storage/.config/autostart.sh to do NFS mounting on boot for Raspberry Pi running OpenELEC
#! /bin/sh
(sleep 5;
mount -t nfs 192.168.1.6:/home/media/games -o rw,nolock,tcp,soft,posix,noatime,nodiratime,timeo=600,actimeo=0,nfsvers=3,async,rsize=131072,wsize=131072 /storage/games
mount -t nfs 192.168.1.6:/export/music -o rw,nolock,tcp,soft,posix,noatime,nodiratime,timeo=600,actimeo=0,nfsvers=3,async,rsize=131072,wsize=131072 /storage/music
mount -t nfs 192.168.1.6:/export/videos -o rw,nolock,tcp,soft,posix,noatime,nodiratime,timeo=600,actimeo=0,nfsvers=3,async,rsize=131072,wsize=131072 /storage/videos) &
@gadido30
gadido30 / img2data.js
Created October 10, 2017 08:32 — forked from jfsiii/img2data.js
base64 encoding images in NodeJS
/*
* Complete reworking of JS from https://gist.github.com/803410
* Removes external `request` dependency
* Caveats:
* * No error checking
* * Largely a POC. `data` URI is accurate, but this code cannot simply be inserted into an `express` app
*/
var URL = require('url'),
sURL = 'http://nodejs.org/logo.png',
oURL = URL.parse(sURL),
@gadido30
gadido30 / vm-resize-hard-disk.md
Created September 15, 2017 07:29 — forked from christopher-hopper/vm-resize-hard-disk.md
Resize a Hard Disk for a Virtual Machine provisioned using Vagrant from a Linux base box to run using VirutalBox.

Resize a Hard Disk for a Virtual Machine

Our Virtual Machines are provisioned using Vagrant from a Linux base box to run using VirutalBox. If the Hard Disk space runs out and you cannot remove files to free-up space, you can resize the Hard Disk using some VirtualBox and Linux commands.

Some assumptions

The following steps assume you've got a set-up like mine, where:

@gadido30
gadido30 / PyTorStemPrivoxy.md
Created September 3, 2017 12:45 — forked from KhepryQuixote/PyTorStemPrivoxy.md
Python script to connect to Tor via Stem and Privoxy, requesting a new connection (hence a new IP as well) as desired.

Crawling Anonymously with Tor in Python

adapted from the article "Crawling anonymously with Tor in Python" by S. Acharya, Nov 2, 2013.

The most common use-case is to be able to hide one's identity using TOR or being able to change identities programmatically, for example when you are crawling a website like Google and you don’t want to be rate-limited or blocked via IP address.

Tor

Install Tor.

@gadido30
gadido30 / zram.sh
Created August 9, 2017 08:41 — forked from sultanqasim/zram.sh
ZRAM config for Raspberry Pi 3
#!/bin/bash
# Raspberry Pi ZRAM script
# Tuned for quad core, 1 GB RAM models
# put me in /etc/init.d/zram.sh and make me executable
# then run "sudo update-rc.d zram.sh defaults"
modprobe zram
echo 3 >/sys/devices/virtual/block/zram0/max_comp_streams
echo lz4 >/sys/devices/virtual/block/zram0/comp_algorithm
@gadido30
gadido30 / README.md
Created July 25, 2017 19:16 — forked from bekce/README.md
ldap server with mysql backend

I wanted to build an LDAP server that queries a MySQL server to fetch users and check their passwords. It is mainly used for old software that does not work with custom OAuth2 providers. Redmine is an example of this.

Instructions:

  1. Create the database and table with insert.sql
@gadido30
gadido30 / docker-save-load-images.sh
Created February 2, 2017 04:38 — forked from mathewdgardner/docker-save-load-images.sh
Save / load compressed docker images
#!/bin/bash
# Save docker images
ds() {
docker images | \
cut -d ' ' -f 1 | \
tail -n +2 | \
xargs -t -n 1 -I {} -P 4 \
sh -c 'docker save {} | bzip2 > $(echo "{}" | sed "s/^.*\///").tar.bz2'
}
@gadido30
gadido30 / mkbundle_cygwin.sh
Last active August 29, 2015 14:28 — forked from tebjan/mkbundle_cygwin.sh
Updated script as of May 2013 to compile a Mono/.NET C# application into a native executable using mono's mkbundle with cygwin on Windows. Please comment if something does not work or you have an idea for improvement. Now with icon support.
#!/bin/bash
#
#Usage:
#1.) Install cygwin and make sure you select the following packages:
#- gcc-mingw
#- pkg-config
#- mingw-zlib1
#- mingw-zlib-devel
#
#2.) Install the following Mono release package: "Mono for Windows, Gtk#, and XSP"