Skip to content

Instantly share code, notes, and snippets.

View noushi's full-sized avatar

Reda NOUSHI noushi

  • EDC4IT
  • EMEA Literally
View GitHub Profile
@brianclements
brianclements / dkcleanup.sh
Last active November 13, 2023 10:49
Bash script helper to remove Docker images and containers.
#!/bin/bash
# options:
# remove stopped containers and untagged images
# $ dkcleanup
# remove all stopped|running containers and untagged images
# $ dkcleanup --reset
# remove containers|images|tags matching {repository|image|repository\image|tag|image:tag}
# pattern and untagged images
# $ dkcleanup --purge {image}
@XVilka
XVilka / TrueColour.md
Last active April 8, 2024 14:02
True Colour (16 million colours) support in various terminal applications and terminals

THIS GIST WAS MOVED TO TERMSTANDARD/COLORS REPOSITORY.

PLEASE ASK YOUR QUESTIONS OR ADD ANY SUGGESTIONS AS A REPOSITORY ISSUES OR PULL REQUESTS INSTEAD!

@havenwood
havenwood / bench.md
Last active December 12, 2015 05:49
Entirely Unscientific Benchmark of Primes in Various Ruby Implementations

Unscientific Benchmark

The Benchmark

def is_prime? n
  (2...n).all? { |i| n % i != 0 }
end

def sexy_primes n
@leifg
leifg / Vagrantfile
Last active November 12, 2023 08:31
Add a second disk to system using vagrant
file_to_disk = './tmp/large_disk.vdi'
Vagrant::Config.run do |config|
config.vm.box = 'base'
config.vm.customize ['createhd', '--filename', file_to_disk, '--size', 500 * 1024]
config.vm.customize ['storageattach', :id, '--storagectl', 'SATA Controller', '--port', 1, '--device', 0, '--type', 'hdd', '--medium', file_to_disk]
end
@danielbeardsley
danielbeardsley / memcache-stats.sh
Created August 2, 2012 08:05
Pipe memcache stats into Graphite
#!/bin/bash
if [ "$1" != "report" ]; then
echo "Usage:" >&2
script="`basename $0`"
echo " nohup $script report > /var/log/memcache-stats.log &" >&2
exit 1
fi
GRAPHITE_SERVER=localhost
@jmervine
jmervine / bm_test.rb
Created July 22, 2012 01:35
Benchmark A/B Test Suite
#!/usr/bin/env ruby
require 'benchmark'
# require libs here
iterations = ARGV[0]||100000 # pass in iterations or
@fernandoaleman
fernandoaleman / Linux Static IP
Created March 23, 2012 16:20
How To Configure Static IP On CentOS 6
## Configure eth0
#
# vi /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE="eth0"
NM_CONTROLLED="yes"
ONBOOT=yes
HWADDR=A4:BA:DB:37:F1:04
TYPE=Ethernet
BOOTPROTO=static

tmux cheatsheet

As configured in my dotfiles.

start new:

tmux

start new with session name: