This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# INFO | |
docker | |
docker info | |
# PROCESSES | |
docker ps -a # list processes | |
docker ps -l # most recent stopped container | |
# IMAGES | |
docker images # lists docker images |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Current date PST | |
SELECT FROM_UTC_TIMESTAMP(FROM_UNIXTIME(UNIX_TIMESTAMP()),"PST"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# | |
# World Clock | |
# | |
# Set up: place .sh in a folder; add alias to rc file; | |
# e.g. alias wt='~/sh/world_clock.sh' | |
# | |
# Access available time zones in /usr/share/zoneinfo | |
# To add a time zone, simply add to TIME_ZONES. For | |
# time zones directly in root folder, add with ., |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.text.SimpleDateFormat | |
import java.util.{Calendar, Date} | |
/** Set date format */ | |
val sdf = new SimpleDateFormat("yyyyMMdd") | |
/** Current date */ | |
val calendar = Calendar.getInstance() | |
/** First day previous month */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Parameters | |
FILES="file1 file2 file3 file4" | |
CURDATE=$(date +%Y%m%d) | |
SOURCE="/foo/bar/" | |
# Move files from eout to user dir | |
for FILE in $FILES; do | |
mv ${SOURCE}/${FILE} ${FILE} | |
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Find occurance per character | |
sed 's/\(.\)/\1\n/g' file.txt | sort | uniq -c > char-occurance.txt | |
# Identify rows containing non-ASCII characters and redirecting to file | |
grep -P -n "[\x83-\xFF]" file.txt > file-non-ascii.txt | |
# Remove non-ASCII characters from file | |
LANG=C sed -i.bak -e 's/[\d128-\d255]//g' file.txt | |
# Delete header row |