Skip to content

Instantly share code, notes, and snippets.

@snixon
snixon / centos8-chroot.sh
Created October 3, 2019 21:19
Build a centos8 AWS AMI in a chroot
#!/bin/bash -ex
# Build a new Centos8 install on EBS volume in a chroot
# Run from RHEL8 or CentOS8 instance - eg: ami-0c322300a1dd5dc79 in us-east-1 (RHEL 8 official image)
# Script expects a second EBS volume, I add them as /dev/sdf in the console
# When the script completes, turn the second EBS volume into your new AMI through the console.
# Adjust the section below to match the device names you're using. Defaults are for an m5.large
# m5 series requires the updated device names
@ulidtko
ulidtko / transdeps.hs
Last active October 28, 2019 17:33
Yum dependency walker script
{-# LANGUAGE ViewPatterns, LambdaCase, FlexibleContexts #-}
module Main where
import Control.Applicative
import System.Environment
import System.Exit
import System.IO
import System.Process
import Data.List (nub, sort)
@allanscullion
allanscullion / cleanup_ftp.sh
Created October 27, 2014 17:16
Bash script to remove old files from an FTP server
#!/bin/bash
PROGNAME=$(basename $0)
OUTFILE="/tmp/ftplist.$RANDOM.txt"
CMDFILE="/tmp/ftpcmd.$RANDOM.txt"
ndays=14
print_usage() {
echo ""
@rb2k
rb2k / gist:8372402
Last active February 3, 2025 14:50
A jenkins script to clean up workspaces on slaves
// Check if a slave has < 10 GB of free space, wipe out workspaces if it does
import hudson.model.*;
import hudson.util.*;
import jenkins.model.*;
import hudson.FilePath.FileCallable;
import hudson.slaves.OfflineCause;
import hudson.node_monitors.*;
for (node in Jenkins.instance.nodes) {
@liubin
liubin / cookie.go
Created June 4, 2013 12:44
display cookie in go lang