I hereby claim:
- I am fulgorek on github.
- I am fulgorek (https://keybase.io/fulgorek) on keybase.
- I have a public key ASDPjjHlLkufnjQm59hGcuRcUDKbdrKGULJAPbZkCNdXZAo
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
# This is a general-purpose function to ask Yes/No questions in Bash, either | |
# with or without a default answer. It keeps repeating the question until it | |
# gets a valid answer. | |
ask() { | |
# https://gist.github.com/davejamesmiller/1965569 | |
local prompt default reply | |
if [ "${2:-}" = "Y" ]; then | |
prompt="Y/n" |
#1. print the first 10 lines of /var/log/syslog | |
head -n 10 /var/log/syslog | |
#2. print the last 10 lines of /var/log/syslog | |
tail -n 10 /var/log/syslog | |
#3. print the Nth line of /var/log/syslog | |
sed "100q;d" /var/log/syslog (replace 100 for the line number you want to) | |
#4. print username, uid, gid fields from /etc/passwd |
curl -O -L https://dl.bintray.com/mitchellh/packer/packer_0.7.5_darwin_amd64.zip | |
unzip packer_0.7.5_darwin_amd64.zip | |
sudo mv packer_0.7 /usr/local/packer | |
sudo chown $USER /usr/local/packer/ | |
# then update your .bash_profile with the new path e.g.: | |
# export PATH="/usr/local/git/bin:/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/local/packer:$PATH" |
# Machine name. | |
function box_name { | |
[ -f ~/.box-name ] && cat ~/.box-name || echo $HOST | |
} | |
# Directory info. | |
# local current_dir='${PWD/#$HOME/~}' | |
local current_dir='[%c]' | |
# VCS |
#!/bin/sh | |
# PATH TO YOUR HOSTS FILE | |
ETC_HOSTS=/etc/hosts | |
# DEFAULT IP FOR HOSTNAME | |
IP="127.0.0.1" | |
# Hostname to add/remove. | |
HOSTNAME=$1 |
. | |
├── common | |
│ └── s3-buckets | |
├── environments | |
│ ├── ci | |
│ ├── management | |
│ │ ├── files | |
│ │ │ └── user-data.sh | |
│ │ ├── templates | |
│ │ │ └── script.sh.tpl |
ntp ✓ | |
ntpdate ✓ | |
sysstat | |
molly-guard | |
rsyslog | |
ssh (the SSH server) ✓ | |
clamav | |
freshclam (service should be disabled) | |
locales ✓ | |
time zone (TZ) ✓ |
//Write a program that prints the numbers from 1 to 100. with the following conditions: | |
//For multiples of three [3] print “Hello” instead of the number. | |
//For the multiples of five [5] print “World” instead of the number. | |
//For numbers which are multiples of both three [3] and five[5] print “Hello World” instead of the number. | |
// we create a loop which iterate 100 times | |
for (i=0; i<100; i++){ | |
if(i % 15 == 0){ |