Skip to content

Instantly share code, notes, and snippets.

View watter's full-sized avatar

Leslie H Watter watter

View GitHub Profile
@watter
watter / merge-resourcespace-languages.sh
Last active September 30, 2015 11:27
Merge PHP internationalization Strings
#!/bin/bash
# I've got to merge some translated string from resourcespace into a new file.
# But... it's php with a sentence in a row, and every sentence was assigned to a position in a vector.
# So, the new en.php got seven hundred and something more strings than the pt-BR.php file. I've got to merge the translations into a new file which I could do the rest of the translation.
# The problem with this merge was that I didn't want to miss the comments of the original file.
# So I chose to do it by shell scripting ;-)
@watter
watter / i-link-trac-ticket
Created September 12, 2012 13:47
Function that inserts a link to our trac instalation depending on which server it is located
@watter
watter / .htdocs
Created December 6, 2012 18:34
htdocs that adds DER mimetype to the current directory so firefox users can import easily a certificate
AddType application/x-x509-ca-cert der
AddType application/pkix-cert der
@watter
watter / gist:5060067
Created February 28, 2013 20:57
script to verify md5 of a file built in hudson and deploy it manually simply and clean only transfer the file when md5 is different from the local one :D
#!/bin/bash
cd /tmp
rm /tmp/cas.*
echo `w3m -dump http://hudson.server/hudson/job/CAS/ws/target/cas.war/*fingerprint*/ 2> /dev/null | grep MD5: | cut -f 2 -d : | sed 's/^ //g'`" /opt/jboss-as-7.1.1/standalone1/deployments/cas.war" > /tmp/cas.md5
md5sum --status -c /tmp/cas.md5
if [ $? -eq 1 ]; then
@watter
watter / gist:5144466
Created March 12, 2013 16:36
how to get your tags from an org-mode file
$ egrep ":[a-zA-Z_-]+:" todo.org | grep '^*' | egrep -o ":[a-zA-Z_-:]+:+" | tr : '\n' | sort -u
@watter
watter / gist:5716566
Created June 5, 2013 19:32
moneylog emacs mode helper functions scratch
(defun mlog-almoco ()
(interactive)
(start-process "mount /media/Leslie"
(get-buffer-create "*mount-buffer*")
"/bin/mount"
"/media/Leslie")
(sleep-for 5)
(load-file "/media/Leslie/moneylog/moneylog.el")
(pop-to-buffer (find-file-noselect "/media/Leslie/moneylog/almoco.txt"))
(delete-other-windows)
@watter
watter / gist:5730830
Created June 7, 2013 17:15
moneylog helper functions
(defun mlog-almoco ()
(interactive)
(start-process "mount /media/Leslie"
(get-buffer-create "*mount-buffer*")
"/bin/mount"
"/media/Leslie")
(sleep-for 5)
(load-file "/media/Leslie/moneylog/moneylog.el")
(pop-to-buffer (find-file-noselect "/media/Leslie/moneylog/almoco.txt"))
(delete-other-windows)
@watter
watter / i-reg-data.el
Last active December 23, 2015 11:39
looking for a date /changing emacs point inside a well formated file
(defun i-reg-data (&optional tag)
"Inserts/format an account record. It should be used with moneylog
2009-08-15 -29.00 visa | Cicles Radar - Mesa para a bicicleta"
(interactive)
;; use or not org function to prefill the date
(set 'use-org "T")
;; pre-fills the today variable with today's date
(if (string= use-org "T")
(setq today (org-read-date)) ;; use org
(setq today (format-time-string "%Y-%m-%d")) ;; do not use org
@watter
watter / .saveplace-emacs.el
Last active August 29, 2015 13:55
save place of cursor between emacs session
;; it just opens the place where I had the point
(require 'saveplace)
(setq-default save-place t)
@watter
watter / slides.org
Created February 12, 2014 18:10
configuração DHCP exemplo

default-lease-time 600; max-lease-time 7200; option subnet-mask 255.255.255.0; option routers 192.168.1.1; option domain-name-servers 200.106.80.11, 200.106.1.5; option domain-name “example.com.br”; subnet 192.168.1.0 netmask 255.255.255.0 { range 192.168.1.10 192.168.1.100; }