Skip to content

Instantly share code, notes, and snippets.

@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 / 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 / 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
@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
@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 / default lv size
Created June 27, 2020 05:17
default ubuntu-vg/ubuntu-lv size after autoinstall
root@ubuntu-00:~# lvdisplay
--- Logical volume ---
LV Path /dev/ubuntu-vg/ubuntu-lv
LV Name ubuntu-lv
VG Name ubuntu-vg
LV UUID mb4yCN-v2A3-MJ0K-ri6z-ClR8-Gtb3-2950UI
LV Write Access read/write
LV Creation host, time ubuntu-server, 2020-05-16 18:59:24 +0000
LV Status available
# open 1
@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 / daemon.json
Created July 14, 2020 03:06
/etc/docker/daemon.json
{
"data-root": "/data/docker-data",
"log-driver": "json-file",
"log-opts": {
"max-size": "40m",
"max-file": "100",
"compress": "true"
},
"bip": "192.168.127.5/24",
"default-address-pools":[
# 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