Skip to content

Instantly share code, notes, and snippets.

View iahim's full-sized avatar

Mike iahim

View GitHub Profile
@iahim
iahim / alpine.sh
Last active April 16, 2023 19:14
alpine linux shortcuts
# add packages
apk update && apk upgrade
apk add vim curl
# enable service at boot
rc-update add apache2
# start service
rc-service apache2 start
@iahim
iahim / ubuntu-useful-commands.sh
Created February 18, 2023 22:49
ubuntu useful commands
# terminal sharing with others
apt install tmate
# better curl
apt install httpie
# better top
apt install bpytop
# alternate tree
#### make sure you have port 1194 accessible from the internet.
### ===================
### SERVER SIDE
### ===================
### create a folder where you keep the data generated by openvpn
mkdir -p openvpn-data/conf
# ==================
# GSUTIL
# ==================
# copy
gsutil cp test.txt gs://my-bucket/folder/
# remove with multiple threads
gsutil -m rm -r gs://my-bucket/*
# Use a shared / mounted folder to store your backups:
/share/all/
# BACKUP to local shared folder:
tklbam-backup --address file:///share/all/backup-core210
# create a key/password for your backup
tklbam-escrow /share/all/backup-core210-key
# ========================
# SERVER SIDE
# ========================
apt install samba
mkdir -p /share/samba-all
# create user admin with password samba
adduser --home /share/users/admin --no-create-home --shell /usr/sbin/nologin --ingroup sambashare admin
# BEST PRACTICES
# https://docs.docker.com/develop/develop-images/dockerfile_best-practices/#exclude-with-dockerignore
# docker commands I use on a daily basis
docker run -d --rm --name myRedis -p 6379:6379/tcp redis
# interactive mode
#!/bin/bash
# DEFINE COLORS
red='$(tput setaf 1)'
green='$(tput setaf 2)'
yellow='$(tput setaf 3)'
blue='$(tput setaf 4)'
magenta='$(tput setaf 5)'
cyan='$(tput setaf 6)'
gray='$(tput setaf 7)'
@iahim
iahim / git-cheat-sheet.sh
Last active November 23, 2020 12:56
GIT helpful commands
# Just a couple of commands i use on a daily basis.
# GIT IGNORE: https://www.atlassian.com/git/tutorials/saving-changes/gitignore
#========================================
# INITIAL SETUP
#========================================
git config --global user.email "xxx@gmail.com"
git config --global user.name "Mike Dev-VM"
# configure git to follow tags