This file contains hidden or 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
from ftplib import FTP | |
# Server connection string | |
remoteUrl = 'ftp.debian.org' | |
ftp = FTP(remoteUrl) | |
# Login | |
ftp.login() | |
# Switch to folder |
This file contains hidden or 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/bash | |
# Check to see if the data is already downloaded | |
if [[ -e ./waterData ]]; then | |
echo "Water data already downloaded reading from cache"; | |
else | |
# Data isn't downloaded so grab it from the web | |
echo "No cached data found downloading water data..."; | |
wget -O waterData "http://nwis.waterdata.usgs.gov/ca/nwis/uv/?search_station_nm=russian%20river&search_station_nm_match_type=beginning&county_cd=06097&index_pmcode_00400=1&index_pmcode_00095=1&index_pmcode_00010=1&index_pmcode_63680=1&group_key=NONE&sitefile_output_format=html_table&column_name=agency_cd&column_name=site_no&column_name=station_nm&range_selection=date_range&begin_date=2008-01-01&end_date=2008-12-31&format=rdb&date_format=YYYY-MM-DD&rdb_compression=value&list_of_search_criteria=county_cd%2Csearch_station_nm%2Crealtime_parameter_selection"; | |
# Convert line endings to unix style (The site is currently providing Windows Style) |
This file contains hidden or 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
server_names_hash_bucket_size 64; | |
server { | |
listen 80; | |
server_name sample.com www.sample.com; | |
location / { | |
proxy_redirect off; | |
proxy_set_header X-Real-IP $remote_addr; | |
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; |
This file contains hidden or 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
[Unit] | |
Description=IP Lookup | |
After=docker.service | |
[Service] | |
TimeoutStartSec=0 | |
Restart=always | |
ExecStartPre=-/usr/bin/docker kill lookup | |
ExecStartPre=-/usr/bin/docker rm lookup | |
ExecStartPre=-/usr/bin/docker pull icecreammatt/lookup |
This file contains hidden or 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
#cloud-config | |
coreos: | |
update: | |
reboot-strategy: off | |
etcd: | |
discovery: https://discovery.etcd.io/<token> | |
addr: $private_ipv4:4001 | |
peer-addr: $private_ipv4:7001 | |
fleet: |
This file contains hidden or 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/bash | |
# git pre-commit hook that runs an clang-format stylecheck. | |
# Features: | |
# - abort commit when commit does not comply with the style guidelines | |
# - create a patch of the proposed style changes | |
# modifications for clang-format by [email protected] | |
# This file is part of a set of unofficial pre-commit hooks available | |
# at github. |
This file contains hidden or 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
//* Resets the timeout, or wakes the overlay. | |
mousemove: function(inSender, inEvent) { | |
if (this.isOverlayShowing()) { | |
this.resetAutoTimeout(); | |
} else if (this.shakeAndWake) { | |
this.showFSControls(); | |
} | |
}, | |
//* Sets _this.visible_ to true and clears hide job. | |
showFSControls: function(inSender, inEvent) { |
This file contains hidden or 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/bash | |
# Pad a list of images with 0's | |
# %03d means pad with 3 0's, 4.jpg renamed to 004.jpg | |
images=$(ls *.jpg) | |
for image in $images; | |
do | |
echo $image | |
value=$(echo $image | sed 's/.jpg//') | |
padded=$(printf "%03d" $value) | |
echo $padded.jpg |
This file contains hidden or 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
vagrant@vagrant-ubuntu-trusty-64:~$ docker ps -a | |
2014/10/05 07:08:23 Get http:///var/run/docker.sock/v1.12/containers/json?all=1: dial unix /var/run/docker.sock: permission denied | |
vagrant@vagrant-ubuntu-trusty-64:~$ sudo gpasswd -a vagrant docker | |
Adding user vagrant to group docker | |
vagrant@vagrant-ubuntu-trusty-64:~$ sudo service docker restart | |
docker: unrecognized service | |
vagrant@vagrant-ubuntu-trusty-64:~$ sudo service docker.io restart | |
docker.io stop/waiting | |
docker.io start/running, process 4628 | |
vagrant@vagrant-ubuntu-trusty-64:~$ docker ps -a |
This file contains hidden or 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
echo "Check for updates? [Y/n] \c" | |
read CHECK_FOR_UPDATE | |
case "$CHECK_FOR_UPDATE" in | |
(N|n) echo "Skipping" ;; | |
*) echo "installing" ;; | |
esac |