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 | |
offline=$(mktemp) | |
cat all.csv | while read line | |
do | |
title=$(echo "$line" | cut -d ',' -f 1) | |
module=$(echo "$line" | cut -d ',' -f 2) | |
unit=$(echo "$line" | cut -d ',' -f 3) | |
url=$(echo "$line" | cut -d ',' -f 4) | |
echo "Checking if $url is online..." | |
agent="User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/44.0.2403.89 Safari/537.36" |
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 | |
# Usage: ./upload-img-to-imgur.sh <image file path> | |
# Output: URL to the image on Imgur | |
filepath=$1 | |
content_type="image/png" | |
filename="$(basename filepath)" | |
curl -X POST "http://imgur.com/upload" \ | |
-H "Referer: http://imgur.com/upload" \ | |
-F "Filedata=@$filepath;filename=$filename;type=$content_type" 2>/dev/null | sed 's/^{"data":{"hashes":\["\([^"]\+\).*/http:\/\/imgur.com\/\1/g' | |
echo |
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
#!/usr/bin/env python | |
# Unity indicator for dolar/real currency | |
# Author: Caio Almeida <[email protected]> | |
# 05 Jul 2016 | |
import gobject | |
import gtk | |
import appindicator | |
import os, sys | |
import time |
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
#!/usr/bin/python | |
from __future__ import print_function | |
import prettytable | |
import csv | |
import sys | |
def main(argv): | |
if len(sys.argv) != 3: | |
print('Usage: python csv2table.py [input file] [output]\n') |
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
#!/usr/local/bin/fontforge | |
# Quick and dirty hack: converts a font to truetype (.ttf) | |
# You need to install fontforge: aptitude install fontforge | |
# After that, simply run: fontforge -script otf2ttf.sh FONTNAME.otf | |
# Or, for a bunch of files: for i in *.otf; do fontforge -script otf2ttf.sh $i; done | |
Print("Opening " + $1); | |
Open($1); | |
Print("Saving " + $1:r + ".ttf"); | |
Generate($1:r + ".ttf"); | |
Quit(0); |
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 | |
# Run tests after commit and notify a Slack channel | |
webhook_url="https://<your subdomain>.slack.com/services/hooks/incoming-webhook?token=<your token>" | |
channel="#<your channel>" | |
root=$(git rev-parse --show-toplevel) | |
cd $root | |
repo=$(basename $root) | |
user=$(git config --global --get user.name) | |
output=$(bundle exec rake test) |
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 | |
# This script disables the Drupal modules one by one and checks CPU load | |
# after disabling each. Please run it from the Drupal root. Set the URL below. | |
url='http://localhost/drupal' | |
# Check CPU load on the last minute | |
function cpuload { | |
uptime | sed 's/.*load average/CPU load on the last minute/g' | sed 's/,.*//g' | |
} |