Skip to content

Instantly share code, notes, and snippets.

@jesbrd
jesbrd / idle.sh
Created July 9, 2018 02:08 — forked from ikbear/idle.sh
Docker image entrypoint idle script
#!/bin/bash
echo "This is a idle script (infinite loop) to keep container running."
echo "Please replace this script."
cleanup ()
{
kill -s SIGTERM $!
exit 0
}
@jesbrd
jesbrd / serialportstream-install.sh
Last active July 7, 2018 04:56
Build, Install SerialPortStream on Ubuntu 16.04
#!/bin/bash
# Build, Install SerialPortStream
# https://github.com/jcurl/SerialPortStream
@jesbrd
jesbrd / bos.md
Last active June 22, 2018 02:39
Boondocks OS Source Builder helper script.
@jesbrd
jesbrd / build-boondocks-os-in-lxc-container.md
Last active March 6, 2019 03:06
Boondocks OS Yocto Build in an LXC Container
@alirezaomidi
alirezaomidi / openconnect.sh
Last active November 28, 2023 12:04
Script to connect and disconnect to/from openconnect without pain
#!/bin/bash
# This script connects the computer to a vpn server using openconnect without pain
prog_name=$(basename $0)
# CHANGE YOUR_VPN_SERVER_DOMAIN to the VPN server you know like example.com
domain=YOUR_VPN_SERVER_DOMAIN
function help {
@drmalex07
drmalex07 / README-oneshot-systemd-service.md
Last active June 25, 2024 17:52
An example with an oneshot service on systemd. #systemd #systemd.service #oneshot

README

Services declared as oneshot are expected to take some action and exit immediatelly (thus, they are not really services, no running processes remain). A common pattern for these type of service is to be defined by a setup and a teardown action.

Let's create a example foo service that when started creates a file, and when stopped it deletes it.

Define setup/teardown actions

Create executable file /opt/foo/setup-foo.sh:

@n0ts
n0ts / remote_bash.sh
Created May 1, 2014 06:35
execute bash script from remote site
# http://stackoverflow.com/questions/5735666/execute-bash-script-from-url
bash <(curl -s http://mywebsite.com/myscript.txt)
# http://stackoverflow.com/questions/4642915/passing-parameters-to-bash-when-executing-a-script-fetched-by-curl
curl http://foo.com/script.sh | bash -s arg1 arg2
@jwebcat
jwebcat / gist:5122366
Last active June 20, 2024 13:35 — forked from lemenkov/gist:1674929
Properly download from github using wget and curl
wget --no-check-certificate --content-disposition https://github.com/joyent/node/tarball/v0.7.1
# --no-check-cerftificate was necessary for me to have wget not puke about https
curl -LJO https://github.com/joyent/node/tarball/v0.7.1