Skip to content

Instantly share code, notes, and snippets.

@jpawlowski
jpawlowski / msys_hetzner-etc_network_interfaces
Created August 12, 2012 12:06
Debian network configuration for Proxmox VE server running on a Hetzner host
# /etc/network/interfaces
#
auto lo
iface lo inet loopback
# device: eth0
iface eth0 inet manual
# IPv4 bridge
# (connect ONLY your firewall/router KVM instance here, this is the WAN device!)
@mikeclarke
mikeclarke / test.sh
Created November 25, 2013 05:39
Simple bash script that uses Docker to build a test container, run tests inside the container, tag successful builds, and clean up after itself.
#!/bin/bash
sudo docker build -t $JOB_NAME/$BUILD_NUMBER .
DB_NAME="/$JOB_NAME-$BUILD_NUMBER-db"
DB_CONTAINER=$(sudo docker run -d -name $DB_NAME <private repository URL>/database-schema)
sudo docker run -link $DB_NAME:db -t $JOB_NAME/$BUILD_NUMBER nosetests
sudo docker tag $JOB_NAME/$BUILD_NUMBER <private repository URL>/${JOB_NAME}-master
sudo docker push <private repository URL>/${JOB_NAME}-master >/dev/null
sudo docker kill ...
sudo docker rm ...
sudo docker rmi ...
@Cenness
Cenness / oneliners.sh
Last active January 30, 2025 11:59
bash oneliners
systat -ifstat 1
netstat -tulpn | grep :80
chcon -R -t httpd_sys_content_t /path/to/file
semanage port -a -t http_port_t -p tcp %port%
nmap %uri% -p- -PN
@clcollins
clcollins / run-docker-container.sh
Last active December 19, 2022 09:04
Bash script to easily setup and run Docker containers to test any given project
#!/bin/bash
# Set to true to just see what command
# would be run
DRY_RUN=false
TITLE='MY-TEST-CONTAINER'
IMAGE='MY-IMAGE'
# Local volume to be mapped into the container any time you run it
# usually with config files or whatnot
@kekru
kekru / Docker connect to remote server.md
Last active March 21, 2025 01:29
Connect to another host with your docker client, without modifying your local Docker installation

Run commands on remote Docker host

This is how to connect to another host with your docker client, without modifying your local Docker installation or when you don't have a local Docker installation.

Enable Docker Remote API

First be sure to enable the Docker Remote API on the remote host.

This can easily be done with a container.
For HTTP connection use jarkt/docker-remote-api.

Copy Img
diskutil list
diskutil unmountDisk /dev/rdisk2
sudo dd bs=1m if=2017-09-07-raspbian-stretch-lite.img of=/dev/rdisk2 conv=sync
Copy wpa_supplicant.conf to boot Folder
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
country=AU
@kekru
kekru / install-docker-client.sh
Created November 29, 2017 21:21
Install Docker Client (CLI) on Linux
#!/bin/bash
set -e
DIR=~/install-docker-client-temp
mkdir -v --parents $DIR
#https://get.docker.com/builds/Linux/i386/docker-latest.tgz | tar xvz --directory $DIR
curl https://download.docker.com/linux/static/edge/x86_64/docker-17.11.0-ce.tgz | tar xvz --directory $DIR
mv -v $DIR/docker/docker /usr/local/bin/docker
chmod +x /usr/local/bin/docker
@htruong
htruong / chroot-to-pi.sh
Last active July 27, 2025 12:36
Chroot to pi sd card
#!/bin/bash
# This script allows you to chroot ("work on")
# the raspbian sd card as if it's the raspberry pi
# on your Ubuntu desktop/laptop
# just much faster and more convenient
# credits: https://gist.github.com/jkullick/9b02c2061fbdf4a6c4e8a78f1312a689
# make sure you have issued
@genadyp
genadyp / linux-apps.md
Last active March 10, 2025 09:06
Linux Apps

Graphics

pastel - A command-line tool to generate, analyze, convert and manipulate colors

Image Viewers

xnview - Image Viewer. Image resizer, batch image converter and more

nomacs - free, open source image viewer, which supports multiple platforms. You can use it for viewing all common image formats including RAW and psd images.

@RichardBronosky
RichardBronosky / README.md
Last active February 24, 2025 04:59
Using cloud-init for cloudless provisioning of Raspberry Pi

Installing cloud-init on a fresh Raspbian Lite image

This is a work in Progress!

Purpose

This mainly demonstrates my goal of preparing a Raspberry Pi to be provisioned prior to its first boot. To do this I have chosen to use the same cloud-init that is the standard for provisioning servers at Amazon EC2, Microsoft Azure, OpenStack, etc.

I found this to be quite challenging because there is little information available for using cloud-init without a cloud. So, this project also servers as a demonstration for anyone on any version of Linux who may want to install from source, and/or use without a cloud. If you fall into that later group, you probably just want to read the code. It's bash so everything I do, you could also do at the command line. (Even the for loop.)