Skip to content

Instantly share code, notes, and snippets.

View marcoamorales's full-sized avatar
🐢
i like turtles

Marco A Morales marcoamorales

🐢
i like turtles
View GitHub Profile
@marcoamorales
marcoamorales / remindme.py
Last active August 29, 2015 14:17
remind me two switch between sitting up and standing up
#!/bin/python2
'''
This script sends a notification every 45 minutes to remind you to switch
between standing and sitting.
'''
from gi.repository import Notify
from time import sleep

Keybase proof

I hereby claim:

  • I am marcoamorales on github.
  • I am marcoamorales (https://keybase.io/marcoamorales) on keybase.
  • I have a public key whose fingerprint is 8E01 9F2B F768 F534 EBFB 0E4B A3B9 C0AD 26D6 79E4

To claim this, I am signing this object:

@marcoamorales
marcoamorales / gist:344fe733ff93e375f8c5
Created September 3, 2014 03:02
Install yaourt and its dependency.
#!/bin/bash
packages=(package-query yaourt)
if [[ $(pacman -Qs base-devel) == "" ]]; then
pacman -S base-devel
fi
cd /tmp;
for pkg in "${packages[@]}"
do
mkdir $pkg
cd $pkg
@marcoamorales
marcoamorales / NexusChecker.py
Created November 14, 2012 05:48
This script searches for the specific button in the Google Play store that appears when the phone is in stock and you are able to buy it. It will send you an email as a notification.
'''
Nexus Notification Script
This script searches for the specific button in the Google Play store that appears
when the phone is in stock and you are able to buy it. It will send you an email
as a notification.
written by: Marco A Morales
http://www.marcoamorales.com
'''
@marcoamorales
marcoamorales / gist:1860898
Created February 18, 2012 20:12
Feed MYSQL a hell bunch of XML files and give you some sort of idea how many still need to be fed.
#!/bin/sh
start_time=`date +%s`
route="/home/marco/files/Edison-Zaragoza/*.xml"
total_count="ls -1 $route| wc -l"
counter=0
for file in $route; do
echo There are $((total_count - counter)) remaining files to load into the DB.
let counter+=1
query="\g LOAD XML LOCAL INFILE '$file' INTO TABLE vcx.cdr_collection ROWS IDENTIFIED BY '<cdr>' (b3, b9, e6, f0);"
@marcoamorales
marcoamorales / mysqlscript.sh
Created February 18, 2012 01:02
Feed a DB a bunch of XML files
#!/bin/sh
# route="/home/marco/files/*"
route="/media/USB-JGP/*"
for file in $route; do
query="\g LOAD XML LOCAL INFILE '$file' INTO TABLE vcx.cdr_collection ROWS IDENTIFIED BY '<cdr>';"
echo "Executing the following query"
echo $file