Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
A place for everything and everything in its place.
- Loading branch information
Showing
19 changed files
with
251 additions
and
323 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
Here is an assortment of scripts that I've made and/or are in the process of making. You can use them if you think they'll be helpful. Below are some notes about about them: | ||
|
||
## Markdown to PDF Converter ## | ||
|
||
**Work in progress.** | ||
|
||
When complete, this will hopefully work along with Hazel and Dropbox to turn a `.md` file into a PDF with the specified styling. The basis of it turns markdown into HTML and `wkpdf` to go from HTML to PDF. In theory it shouldn't be that hard to do, I just haven't hard a need for it yet so haven't put in the time. | ||
|
||
## Meetup Photo Downloader ## | ||
|
||
This script will download all images at full resolution from a Meetup.com photo gallery. | ||
|
||
Grab to photo album ID from your meetup.com page and run the command like this: | ||
|
||
php ~/path/to/meetup-photo-download.php 1234567 /Directory/To/Save/ filename_prefix. | ||
|
||
## Random ## | ||
|
||
### Garageband to iPad ### | ||
|
||
A python script that powers [this service](http://cl.ly/3w1R1h2o1C1v) that converts a Mac `.band` file for use in Garageband for iPad. Pretty handy, though my main use of Garageband at this point is podcasting and Garageband for iPad doesn't do a great job of supporting long projects. | ||
|
||
### Get Text ### | ||
|
||
A script [I used with Launch Center Pro][text-lcp] as a workaround for appending text to files in Dropbox until there was a better app on the scene. I now [use Notesy][notesy] instead and am just keeping this for reference. | ||
|
||
[text-lcp]: http://hackmake.org/2012/06/27/quick-text-and-fast-learning-with-launch-center-pro | ||
[notesy]: http://hackmake.org/2012/10/12/notesy-and-launch-center-pro | ||
|
||
### Pythonista Slugger ### | ||
|
||
A python script build for use in [Pythonista](http://omz-software.com/pythonista/) that converts a string into a url-ready slug. I use it when copying a title from a draft, convert it, and then have it take my back to Byword. | ||
|
||
## Rename Notes ## | ||
|
||
**Work in progress.** | ||
|
||
A combination of scripts and Hazel rules that checks my Dropbox notes folder for note titles that don't match my tagging convention and list them out in a new note. Editing the text in that note with rename the corresponding note making it easy to review any new notes that were dumped in using nvALT and need to be cleaned up for posterity's sake. |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
## Markdown to PDF Converter ## | ||
|
||
**Work in progress.** | ||
|
||
When complete, this will hopefully work along with Hazel and Dropbox to turn a `.md` file into a PDF with the specified styling. The basis of it turns markdown into HTML and `wkpdf` to go from HTML to PDF. In theory it shouldn't be that hard to do, I just haven't hard a need for it yet so haven't put in the time. |
File renamed without changes.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#!/bin/bash | ||
|
||
I=$1 | ||
PATH='/Users/nickwynja/Dropbox/\[Drop\]/\[Convert\]/' | ||
#PATH = '/Users/brain/Dropbox/\[Drop\]/\[Convert\]/' | ||
#FILENAME=$(basename "$I") | ||
#NAME="${filename%.*}" | ||
NAME='this' | ||
echo $1 | ||
|
||
/bin/markdown2 $I > /tmp/$NAME.html | ||
/usr/bin/wkpdf --source /tmp/$NAME.html --output $PATH $NAME .pdf | ||
/usr/bin/rm /tmp/$NAME.html |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
## Meetup Photo Downloader ## | ||
|
||
This script will download all images at full resolution from a Meetup.com photo gallery. | ||
|
||
Grab to photo album ID from your meetup.com page and run the command like this: | ||
|
||
php ~/path/to/meetup-photo-download.php 1234567 /Directory/To/Save/ filename_prefix. |
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
Binary file not shown.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
#!/bin/bash | ||
|
||
# Schedule this to run once a day with cron. Doesn't matter what time since it parses yesterday's hits (by default). | ||
# I only tested this on the Marco.org server, which runs CentOS (RHEL). No idea how it'll work on other distributions, but it's pretty basic. | ||
|
||
# Required variables: | ||
|
||
if [ "$1" == "hackmake.org" ]; then | ||
LOG_FILE="/var/log/httpd/hackmake-access_log" | ||
REPORT_NAME="hackmake-daily-report" | ||
fi | ||
|
||
if [ "$1" == "nickwynja.com" ]; then | ||
LOG_FILE="/var/log/httpd/nickwynja-access_log" | ||
REPORT_NAME="nickwynja-daily-report" | ||
fi | ||
|
||
RSS_URI="/rss" | ||
REPORT_PATH="/home/blog/Dropbox/Notes/" | ||
|
||
# --- Optional customization --- | ||
|
||
# Date expression for yesterday | ||
DATE="-1 day" | ||
|
||
# Locale for printf number formatting (e.g. "10000" => "10,000") | ||
LANG=en_US | ||
|
||
# Date format in Apache log | ||
LOG_FDATE=`date -d "$DATE" '+%d/%b/%Y'` | ||
|
||
# Date format for report | ||
REPORT_FDATE=`date -d "$DATE" '+%Y-%m-%d'` | ||
|
||
REPORT_FILE=$REPORT_PATH$REPORT_NAME"-"$REPORT_FDATE".md" | ||
|
||
# --- The actual log parsing --- | ||
|
||
LOG_FDATE=`date -d "$DATE" "+${LOG_DATE_FORMAT}"` | ||
DAY_BEFORE_FDATE=`date -d "$DATE -1 day" "+${LOG_DATE_FORMAT}"` | ||
|
||
# Unique IPs requesting RSS, except those reporting "subscribers": | ||
IPSUBS=`fgrep "$LOG_FDATE" "$LOG_FILE" | fgrep " $RSS_URI" | egrep -v '[0-9]+ subscribers' | cut -d' ' -f 1 | sort | uniq | wc -l` | ||
|
||
# Google Reader subscribers and other user-agents reporting "subscribers" and using the "feed-id" parameter for uniqueness: | ||
GRSUBS=`egrep "($LOG_FDATE|$DAY_BEFORE_FDATE)" "$LOG_FILE" | fgrep " $RSS_URI" | egrep -o '[0-9]+ subscribers; feed-id=[0-9]+' | sort -t= -k2 -s | tac | uniq -f2 | awk '{s+=$1} END {print s}'` | ||
|
||
# Other user-agents reporting "subscribers", for which we'll use the entire user-agent string for uniqueness: | ||
OTHERSUBS=`fgrep "$LOG_FDATE" "$LOG_FILE" | fgrep " $RSS_URI" | fgrep -v 'subscribers; feed-id=' | egrep '[0-9]+ subscribers' | egrep -o '"[^"]+"$' | sort -t\( -k2 -sr | awk '!x[$1]++' | egrep -o '[0-9]+ subscribers' | awk '{s+=$1} END {print s}'` | ||
|
||
REPORT=$( | ||
printf "\n## Feed Stats\n\n" | ||
printf "%'8d Google Reader subscribers\n" $GRSUBS | ||
printf "%'8d subscribers from other aggregators\n" $OTHERSUBS | ||
printf "%'8d direct subscribers\n" $IPSUBS | ||
echo "--------" | ||
printf "%'8d total subscribers\n" `expr $GRSUBS + $OTHERSUBS + $IPSUBS` | ||
) | ||
|
||
echo "$REPORT" >> $REPORT_FILE |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.