Skip to content

Instantly share code, notes, and snippets.

View M1lan's full-sized avatar

Milan M1lan

View GitHub Profile
@M1lan
M1lan / template.bash
Last active July 30, 2025 21:17
Bash template
#!/usr/bin/env bash
##
# Note: almost always, we /want/ to inherit the encapsulating shell
# environment. If we don't want or "trust" that environment, we can
# run scripts from within a clean shell environment like this:
# #!/usr/bin/env -iS -- bash
#
# If anyone knows about an actual use case for this, pls let me know.
#!/usr/bin/env bash
## bash examples for RH134 - milan santosi
## intro / explanation
# first line always magic line. it's needed when your O/S can't figure out from file-ending (.bash, .sh). IMHO the best way to find the bash shell interpreter (NOT just "/bin/sh") on any given unix environment (also: Docker environments!) is to ask "env" to return preferred path to bash. 99% of the time it's /usr/bin/bash and/or /bin/bash, but with asking env, we can be sure...
# file endings are optional. It matters more if chmod +x is set. The magic line is most important when script is called as argument of other command (such as `bash myscript.sh`). If script is not in $PATH, use "./" to call: `./script.sh`. Otherwise `echo $PATH` and move script to a directory that's listed. Or don't run script standalone but with `bash myscript.sh`
## simple if then
@M1lan
M1lan / Dockerfile
Created October 5, 2016 14:25 — forked from yefim/Dockerrun.aws.json
Build a Docker image, push it to AWS EC2 Container Registry, then deploy it to AWS Elastic Beanstalk
# Example Dockerfile
FROM hello-world
@M1lan
M1lan / reclaimWindows10.ps1
Created August 11, 2016 22:35 — forked from alirobe/reclaimWindows10.ps1
"Reclaim Windows 10" turns off a bunch of unnecessary Windows 10 telemetery, removes bloatware, and privacy invasions. Review and tweak before running. Scripts for reversing are included and commented. Forked from http://pastebin.com/gQxCUkLP
##########
# Tweaked Win10 Initial Setup Script
# Primary Author: Disassembler <disassembler@dasm.cz>
# Original Version: 1.4, 2016-01-16
# Tweaked based on personal preferences for @alirobe 2016-03-23 - v1.4.1
# NOTE: MAKE SURE YOU READ THIS SCRIPT CAREFULLY BEFORE RUNNING IT + ADJUST COMMENTING AS APPROPRIATE
# This script will reboot your machine when completed.
##########
# Ask for elevated permissions if required