Skip to content

Instantly share code, notes, and snippets.

@craig-m
craig-m / README.md
Last active May 18, 2024 01:49
Packer Vagrant VirtualBox Ubuntu 22.04 install with Cloud-Init

Ubuntu Packer VirtualBox

A simple Packer + Vagrant VirtualBox install of Ubuntu live-server 22.04 (x86) using Cloud-Init, and documentation of my host desktop.

host setup

A fresh install of any supported LTS or the latest Ubuntu desktop version is good. I have tested this on ubuntu 18.04.6 running on an i5-4570 (4 core 3.20GHz) with 16GB of RAM, a nearly 10 year old computer. Get a dedicated machine, it need not be fancy or new.

Update and get setup with some tools + deps first:

@dante11235
dante11235 / install-teleport.sh
Last active April 7, 2022 09:43 — forked from vairisingh/install-teleport.sh
Script to install Teleport on a system
#!/bin/bash
export version=v8.0.7
export os=linux
export arch=amd64
#####################################
curl -O https://get.gravitational.com/teleport-$version-$os-$arch-bin.tar.gz
tar -xzf teleport-$version-$os-$arch-bin.tar.gz
@vairisingh
vairisingh / install-teleport.sh
Created June 27, 2020 03:39
Script to install Teleport on a system
#!/bin/bash
export version=v4.2.8
export os=linux
export arch=amd64
#####################################
curl -O https://get.gravitational.com/teleport-$version-$os-$arch-bin.tar.gz
tar -xzf teleport-$version-$os-$arch-bin.tar.gz
@fevangelou
fevangelou / Software RAID 1 setup on Ubuntu Server 20.04.md
Last active March 1, 2024 01:02
Software RAID 1 setup on Ubuntu Server 20.04 (or newer)

Looking to create a Software RAID 1 setup for your 2-disk server on Ubuntu Server 20.04?

Screen Shot 2020-06-05 at 20 55 31

Let's start with the basics: the official guide by Ubuntu (https://ubuntu.com/server/docs/install/storage) is outdated/wrong. And as of March 2021 it's possible that there's a bug as well with how the bios_grub partitions are created when using multiple disks.

Now on to the solution:

  • Select "Custom storage layout" when you reach the storage configuration step of the installer.
  • If the disks have existing partitions, click on each disk under AVAILABLE DEVICES and then select REFORMAT. This will (temporarily) wipe out the partitions.
@dylanmckay
dylanmckay / facebook-contact-info-summary.rb
Last active March 12, 2024 22:46
A Ruby script for collecting phone record statistics from a Facebook user data dump
#! /usr/bin/env ruby
# NOTE: Requires Ruby 2.1 or greater.
# This script can be used to parse and dump the information from
# the 'html/contact_info.htm' file in a Facebook user data ZIP download.
#
# It prints all cell phone call + SMS message + MMS records, plus a summary of each.
#
# It also dumps all of the records into CSV files inside a 'CSV' folder, that is created
@htruong
htruong / chroot-to-pi.sh
Last active May 17, 2024 13:12
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
@brendangregg
brendangregg / dockerpsns.sh
Last active August 23, 2023 10:11
docker ps --namespaces
#!/bin/bash
#
# dockerpsns - proof of concept for a "docker ps --namespaces".
#
# USAGE: ./dockerpsns.sh
#
# This lists containers, their init PIDs, and namespace IDs. If container
# namespaces equal the host namespace, they are colored red (this can be
# disabled by setting color=0 below).
#
@walbert947
walbert947 / c7-nat-router.sh
Last active April 9, 2024 15:35
Configure a simple IPv4 NAT router on CentOS 7
# NOTE: This gist includes the '.sh' extension to enable syntax highlighting
# on the gist web viewer. However, it is NOT intended to be run as a script.
# These are just notes I took.
################################################################################
#
# CentOS 7 - Simple IPv4 NAT Router
#
# This gist provides a brief walkthough on setting up a simple NAT router on
# CentOS 7 that will allow multiple machines on an internal network to share

Compiling an optimized ATLAS on Ubuntu 12.04

  1. Download the latest ATLAS source from http://sourceforge.net/projects/math-atlas/files/. I'm using version 3.10.1
  2. Download the latest Netlib LAPACK from http://www.netlib.org/lapack/. I'm using version 3.4.2
  3. Turn off frequency scalings on your chip so that you can get reliable timings. This is essential to get a good ATLAS build
  sudo apt-get install cpufreq-info cpuspeed cpufrequtils sysfsutils
  # set each core to the "performance" governor, so that the clock frequency doesn't go down when idle
  # I have 8 cores, which is why I need to do this 8 times
  sudo cpufreq-selector -c 0 -g performance
@jmchilton
jmchilton / create_galaxy_users.py
Created January 7, 2013 15:07
Place in galaxy home directory and run to create users.
from scripts.db_shell import *
from galaxy.util.bunch import Bunch
from galaxy.security import GalaxyRBACAgent
bunch = Bunch( **globals() )
bunch.engine = engine
# model.flush() has been removed.
bunch.session = db_session
# For backward compatibility with "model.context.current"
bunch.context = db_session
security_agent = GalaxyRBACAgent( bunch )