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
sudo add-apt-repository -y ppa:libreoffice/libreoffice-4-1 | |
sudo apt-get install \ | |
libreoffice=1:4.1.6-0ubuntu1~trusty1~ppa1 \ | |
libreoffice-base=1:4.1.6-0ubuntu1~trusty1~ppa1 \ | |
libreoffice-base-core=1:4.1.6-0ubuntu1~trusty1~ppa1 \ | |
libreoffice-core=1:4.1.6-0ubuntu1~trusty1~ppa1 \ | |
libreoffice-calc=1:4.1.6-0ubuntu1~trusty1~ppa1 \ | |
libreoffice-draw=1:4.1.6-0ubuntu1~trusty1~ppa1 \ | |
libreoffice-impress=1:4.1.6-0ubuntu1~trusty1~ppa1 \ |
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
function date_difference(from_date, to_date) { | |
if (to_date < from_date) { | |
return date_difference(to_date, from_date); | |
} | |
var DAY_IN_MS = 1000 * 60 * 60 * 24; | |
// count first day | |
from_date = new Date(from_date.getTime() - DAY_IN_MS); |
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 json, pickle | |
def dump_data(data, path): | |
""" | |
Stores an object in a json or pickle file. | |
""" | |
if path.endswith('.json'): | |
t = 'json' | |
elif path.endswith('.pickle'): |
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
DIGIT = /[0-9]/ | |
LETTER = /[a-z]/i | |
class Lexer | |
def self.lex(input) | |
output = [] | |
it = CharIterator.new(input) | |
peek = it.next |
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
RewriteEngine On | |
RewriteCond %{HTTPS} off | |
RewriteRule ^(.*)$ https://%{HTTP_HOST}/$1 [R=301,L] |
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
# Adapted from `man postsuper` (in earlier tail versions, one could write the shortcut `tail +2` to skip the first line) | |
mailq | tail -n +2 | grep -v '^ *(' | awk 'BEGIN { RS = "" } | |
# $7=sender, $8=recipient1, $9=recipient2 | |
{ if ($8 == "someone@example.com" && $9 == "") | |
print $1 } | |
' | tr -d '*!' | postsuper -d - |
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/bash | |
if [ -n "$1" ] | |
then | |
host -t mx $1 | awk '{print $7}' | sed 's/.$//' | |
fi |
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/ruby | |
# uppercase characters | |
uchar = 'A-ZÄÖÜÁÀÉÈ' | |
# lowercase characters | |
lchar = 'a-zäöüßáàéè' | |
# all characters | |
char = uchar + lchar | |
# whitespace characters |
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/bash | |
if (( $# != 3 )); then | |
echo "Usage: $0 ftp.example.com ftp-user ftp-password" | |
exit 1 | |
fi | |
SERVER=$1 | |
USER=$2 | |
PASS=$3 |
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/bash | |
# | |
# This Source Code Form is subject to the terms of the Mozilla Public | |
# License, v. 2.0. If a copy of the MPL was not distributed with this | |
# file, You can obtain one at http://mozilla.org/MPL/2.0/. | |
# | |
# A simple updater for Mozilla Firefox Nightly in Linux multi-user environments. | |
# | |
# Choose your OS, architecture and destination here: | |
NIGHTLY_OS='linux' |
OlderNewer