Skip to content

Instantly share code, notes, and snippets.

@mingliangguo
mingliangguo / websocat-install.sh
Last active May 3, 2024 17:08
install websocat in ubuntu
# libssl-dev and pkg-config are required in order to build websocat
#
apt-get update && apt-get install -y curl build-essential libssl-dev pkg-config
curl https://sh.rustup.rs -sSf | sh
export PATH=$HOME/.cargo/bin:$PATH
cargo install --features=ssl websocat
@EvgenyOrekhov
EvgenyOrekhov / A simple Docker and Docker Compose install script for Ubuntu.md
Last active May 5, 2024 20:06
A simple Docker and Docker Compose install script for Ubuntu

A simple Docker and Docker Compose install script for Ubuntu

Usage

  1. sh install-docker.sh
  2. log out
  3. log back in

Links

@makeittotop
makeittotop / oom-killer-explanation.gist
Last active March 25, 2024 17:23
Excellent discussion on OOM-Killer
Out of Memory (OOM) refers to a computing state where all available memory, including swap space, has been allocated.
Normally this will cause the system to panic and stop functioning as expected.
There is a switch that controls OOM behavior in /proc/sys/vm/panic_on_oom.
When set to 1 the kernel will panic on OOM.
A setting of 0 instructs the kernel to call a function named oom_killer on an OOM.
Usually, oom_killer can kill rogue processes and the system will survive.
The easiest way to change this is to echo the new value to /proc/sys/vm/panic_on_oom.
# cat /proc/sys/vm/panic_on_oom 1
@alexandrpaliy
alexandrpaliy / gist:28451226280698dfbb26
Created November 13, 2014 13:29
Steam info 20141113
Processor Information:
Vendor: GenuineIntel
CPU Family: 0x6
CPU Model: 0x3c
CPU Stepping: 0x3
CPU Type: 0x0
Speed: 3600 Mhz
4 logical processors
4 physical processors
HyperThreading: Unsupported
@wdullaer
wdullaer / install.sh
Last active April 2, 2024 20:33
Install Latest Docker and Docker-compose on Ubuntu
# Ask for the user password
# Script only works if sudo caches the password for a few minutes
sudo true
# Install kernel extra's to enable docker aufs support
# sudo apt-get -y install linux-image-extra-$(uname -r)
# Add Docker PPA and install latest version
# sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 36A1D7869245C8950F966E92D8576A8BA88D21E9
# sudo sh -c "echo deb https://get.docker.io/ubuntu docker main > /etc/apt/sources.list.d/docker.list"
@soarez
soarez / ca.md
Last active May 3, 2024 00:04
How to setup your own CA with OpenSSL

How to setup your own CA with OpenSSL

For educational reasons I've decided to create my own CA. Here is what I learned.

First things first

Lets get some context first.

@rothgar
rothgar / main.yml
Last active March 8, 2024 07:16
Generate /etc/hosts with Ansible
# Idempotent way to build a /etc/hosts file with Ansible using your Ansible hosts inventory for a source.
# Will include all hosts the playbook is run on.
# Inspired from http://xmeblog.blogspot.com/2013/06/ansible-dynamicaly-update-etchosts.html
- name: "Build hosts file"
lineinfile: dest=/etc/hosts regexp='.*{{ item }}$' line="{{ hostvars[item].ansible_default_ipv4.address }} {{item}}" state=present
when: hostvars[item].ansible_default_ipv4.address is defined
with_items: groups['all']