(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
#!/bin/bash | |
while : | |
do | |
zip -r $ZIP_FILENAME $FOLDERNAME && curl -F 'filename=@$ZIP_FILENAME' 'https://api.pcloud.com/uploadtolink?code=$PCLOUD_UPLOAD_CODE' && rm -f $ZIP_FILENAME && sleep $SLEEPTIME | |
done | |
#ZIP_FILENAME: file name of the zip you want to name it | |
#FOLDERNAME: the folder you want to zip | |
#PCLOUD_UPLOAD_CODE: go to pcloud, generate an upload link, you will find the code | |
#SLEEPTIME: the sleep interval for each upload cycle, if you want this to be a loop |
#!/bin/sh | |
################################################################ | |
# Individual channel setting per distinct AP | |
case `uci get system.@system[0].hostname` in | |
"ap1") | |
CHANNELS="36 1" | |
;; | |
"ap2") |
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
#! /bin/bash | |
# vim: sw=2 ts=2 et ai | |
NUM_OLDEST_BACKUPS_TO_KEEP=1 | |
NUM_RECENT_BACKUPS_TO_KEEP=100 | |
NUM_MONTHS_TO_KEEP_DAILY_BACKUPS=4 | |
AUTOMATIC_REMOVAL_THRESHOLD=40 | |
# Deletes old DB backup files from the folder specified as an argument. | |
# |
#Extract Image URLs and WGet Them to a New Server#
This was a fun problem. I needed to move all the images referenced in a CSS file to another server. I didn't want to just grab all the image files as there were a bunch I didn't need. Here is how I went about it. I am sure you could do it in one step but doing it this way gives you a chance to check for errors.
First you may want to use wget http://otherserver/the_css.css
to pull the CSS file on to the target server if it is still on the old server as it was in my case.
User grep to extract the URLs from the css file into another file. (You may need to adjust the regular expression if you have funny characters in your file names) Note the use of the -o
flag that tells grep to only print out that part of the line that matches the expression rather than the entire line.
grep -o '\/path\/to\/files\/[a-zA-Z0-9/.:_-]*' the_css.css > images.txt
function minVersion(version) { | |
var $vrs = window.jQuery.fn.jquery.split('.'), | |
min = version.split('.'); | |
for (var i=0, len=$vrs.length; i<len; i++) { | |
console.log($vrs[i], min[i]); | |
if (min[i] && $vrs[i] < min[i]) { | |
return false; | |
} | |
} | |
return true; |