Skip to content

Instantly share code, notes, and snippets.

@tlhakhan
tlhakhan / expand filesystem
Last active June 27, 2020 05:22
expand ubuntu-vg/ubuntu-lv
---
- name: expand the root filesystem
lvol:
lv: ubuntu-lv
vg: ubuntu-vg
size: 80%VG
resizefs: true
...
@tlhakhan
tlhakhan / build_empty_iso.sh
Created May 5, 2020 21:02
Build an empty iso file
#!/bin/bash
IMAGE=empty.iso
BUILD=/dev/null
mkisofs -r -V "Empty ISO" -J -l -o $IMAGE $BUILD
@tlhakhan
tlhakhan / ubuntu2004.ipxe
Last active December 21, 2023 15:50
iPXE script for deploying Ubuntu 20.04 autoinstall nocloud-net method
#!ipxe
# ubuntu focal 20.04
# $seedfrom used to find the user-data and meta-data files by nocloud-net provider for cloud-init.
# the trailing slash is important, the cloud-init sticks 'meta-data' or 'user-data' right after it, without prepending a forward slash.
set seedfrom http://repo/files/ubuntu2004/
# $base url is where the vmlinuz and initrd live.
# they were fished out from the live-server iso file. the iso file is also in this directory.
set base http://repo/files/ubuntu2004
@tlhakhan
tlhakhan / user-data.yml
Last active June 30, 2023 02:39
Ubuntu 20.04 example autoinstall user-data file
#cloud-config
autoinstall:
version: 1
early-commands:
- systemctl stop ssh # otherwise packer tries to connect and exceed max attempts
- hostnamectl set-hostname ubuntu-00 # update hostname even for the installer environment
- dhclient # re-register the updated hostname
network:
@tlhakhan
tlhakhan / remapCapsLockToEsc.reg
Created July 23, 2019 12:04
remap caps lock to escape for windows
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Keyboard Layout]
"Scancode Map"=hex:00,00,00,00,00,00,00,00,03,00,00,00,3a,00,46,00,01,00,3a,00,00,00,00,00
# Reload the file with Prefix r.
bind r source-file ~/.tmux.conf \; display "Reloaded!"
set -g mouse off
set -g default-terminal "screen-256color"
# bar style
set -g status-style fg=white,bold,bg=black
setw -g window-status-style fg=cyan,bg=black
setw -g window-status-current-style fg=white,bold,bg=red
@tlhakhan
tlhakhan / gist:c980c3c526d23190bed353110772f906
Created January 13, 2018 16:45
godoc web service on CentOS
yum install -y epel; yum makecache
yum install -y golang-godoc golang-docs
cat < 'eof' > /etc/systemd/system/godoc.service
[Unit]
Description = golang godoc web server
[Service]
ExecStart=/usr/bin/godoc -http :8080
Restart=always
@tlhakhan
tlhakhan / centos.pac
Last active July 14, 2018 18:31
centos: good packlist
# goodies
lsof
tree
# info tools
net-tools # provides ifconfig, netstat
bind-utils # provides host
# performance tools
sysstat
@tlhakhan
tlhakhan / my-rpms.sh
Last active April 1, 2017 20:47
Offline software repo
#!/bin/bash
#
# let's make an offline repo of mfu software
#
# deps
yum install -y yum-utils-1.1.31-40.el7.noarch
#
@tlhakhan
tlhakhan / ansible-rpm-build.sh
Last active December 3, 2019 19:53
Ansible - Building RPM
#!/bin/bash
#
# let's make an ansible rpm for offline deployment
#
yum makecache
yum -y update
# rpm build deps