Firts Week August

domingo, 8 de agosto de 2010 Albertux 3 comentarios

First Week August

I know the last month was fucking lazy, but August I think is different, the first week:


CentOS 5.5 setup on VirtualBox with LAMP

Download the netinstall ISO from mirrors:
- CentOS-5.5-i386-netinstall.iso
- CentOS-5.5-x86_64-netinstall.iso

[HTTP Setup]
Website name: mirror.centos.org
CentOS Directory: centos/5.5/os/i386

After many screens select only server

Set up LAMP on CentOS 5.5 Server:

yum install mysql-server # mysql server
yum install php-mysql # php with mysql
/etc/init.d/mysqld start # start mysql (password empty)
# put mysqld and httpd in run levels
chkconfig mysqld --level 2345 on
chkconfig httpd --level 2345 on # httpd is all ready

If you want to start CentOS on background:

# Port forward SSH to 2222 localhost:
VBoxManage modifyvm "CentOS" --natpf1 "guestsssh,tcp,,2222,,22"
# Port forward HTTP to 8080 localhost:
VBoxManage modifyvm "CentOS" --natpf1 "guestshttp,tcp,,8080,,80"
# bash aliases
alias start_centos='VBoxManage startvm "CentOS" --type headless'
alias centos='ssh -p 2222 root@localhost'

Make twitter useful:

#  goto http://code.google.com/p/python-twitter/ on ubuntu:
apt-get install python-twitter
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
# Albertux (Alberto Isaac Ayala Esquivias)
import re, twitter
import subprocess
####################
# TWITTER  ACCOUNT #
username='_________'
password='_________'
####################
####################
# EXECUTE COMMANDS #
start = ["command","param1","param2"]
stop = ["command","param1","param2"]
####################
####################
api = twitter.Api(username, password)
statuses = api.GetUserTimeline(USER_YOU_FOLLOW)
msgs = [s.text for s in statuses]
last_msg = msgs[0]
flag = re.findall(r"REGEX",last_msg,re.I)
if len(flag) > 0:
    subprocess.call(stop)
else:
    subprocess.call(start)

using bash:

 watch -n 60 ./twitter_check

3taps heartbeater (latency of post):


Myself:




Dr Martin Luther King Jr Pics:


Hackerdojo pics:





Random pics:
P0rn knowledge:

Damn I lost this pin of #hackerdojo :’(


Personal projects:

w@nder July

domingo, 1 de agosto de 2010 Albertux 2 comentarios

wander July – wonder July

#include "family.h"

This month was good.


Some days I go to #hackerdojo on Mountain View


A simple tweet script using python-twitter

#!/usr/bin/env python
import twitter, sys
api = twitter.Api(USERNAME, PASSWORD)
if (len(sys.argv) < 2):
    sys.exit()
tweet = sys.argv[1]
status = api.PostUpdate(tweet[0:140])
print status.text

howto use:

./tweet "tweet from command line"

qTranslate 2.5.8 works good on WordPress 3.0.1, edit qtranslate.php:

// only replace the next line:
define('QT_SUPPORTED_WP_VERSION', '3.0');
// for this:
define('QT_SUPPORTED_WP_VERSION', '3.0.1');

time command (stderr) on bash maybe cause problems you need to use the full path or use another shell (using ubuntu lucid lynx):

#!/bin/bash
time -o output.log $CMD # -o: command not found, using /bin/dash works
/usr/bin/time -o output.log $CMD # works
/usr/bin/time $CMD 2> output.log # works

Yep I have the driver license (from DMV not Tropicana):


family/friends this photos are chronologically:






3taps
Now I’m using Amazon EC2 to handle the information and scripts I have for www.3taps.com


Many moves/changes in this month, some projects in my head. (the next week maybe running one of them)


TODO 4 August:

  • Make and follow a schedule
  • Start up www.ayalasoft.net
  • Cut my hair (maybe)
  • Get a car (I hope so)
  • Make a blueprint for world domination
Categories: personal Tags:

Switch DNS

jueves, 1 de julio de 2010 Albertux Sin comentarios
#!/bin/bash
# Author: Albertux (Alberto Isaac Ayala Esquivias)
# Script: switch the nameservers (DNS)
 
if [ ! $( id -u ) -eq 0 ]
then
	echo "Run this script as root"
	exit
fi
 
if [ $# -le 0 ]
then
	echo "Usage $0 [open|google|comodo|old]"
fi
 
if  [ ! -f /etc/resolv.conf.bak ]
then
	cp /etc/resolv.conf /etc/resolv.conf.bak
fi
 
case $1 in
	open)
		echo -e "# OpenDNS\nnameserver 208.67.222.222\nnameserver 208.67.220.220" > /etc/resolv.conf
	;;
	google)
		echo -e "# Google Public DNS\nnameserver 8.8.8.8\nnameserver 8.8.4.4" > /etc/resolv.conf
	;;
	comodo)
		echo -e "# Comodo Secure DNS\nnameserver 156.154.70.22\nnameserver 156.154.71.22" > /etc/resolv.conf
	;;
	old)
		cp /etc/resolv.conf.bak /etc/resolv.conf
	;;
esac
Categories: network, unix/linux Tags: ,

SuperHappyDevHouse SHDH 38

lunes, 28 de junio de 2010 Albertux Sin comentarios

SuperHappyDevHouse SHDH 38

http://superhappydevhouse.org/SuperHappyDevHouse38

SHDH: 06/26/2010 03:00 pm – 06/27/2010 06:00 am.

Werewolf Survivors
Werewolf survivors

[The video was edited using avidemux and mencoder]

EOL-EOF

Categories: community, personal Tags: , ,

Ruby Help Me to Find a Job

martes, 22 de junio de 2010 Albertux 1 comentario

Ruby Help Me to Find a Job

On Indeed:

#!/usr/bin/ruby -w
# Autor: Albertux (Alberto Isaac Ayala Esquivias)
# URL/Blog: http://Albertux.AyalaSoft.com
# E-mail/spam: <albertoi7@gmail.com>
# Free Coke License: If you see me some day give me a free coke please.
# Description: This script maybe help people to find a fucking Job
 
require "rss/2.0"
require "open-uri"
require 'net/http'
require 'rexml/document'
 
# You need to change this values:
keywords = "keyword1+keyword2+keyword3"
zipcode = "10101"
 
def bitly(url)
	# Create account on Bit.ly
	login = ""
	api_key = ""
	data = Net::HTTP.get_response(URI.parse("http://api.bit.ly/v3/shorten?login="+login+"&apiKey="+api_key+"&longUrl="+url+"&format=xml")).body
	doc = REXML::Document.new(data)
	doc.elements.each('response/data/url') do |ele|
		url = ele.text
	end
	url
end
 
open("http://rss.indeed.com/rss?q=" + keywords + "&l=" + zipcode + "&sort=date") do | http |
	response = http.read
	result = RSS::Parser.parse(response, false)
	puts "\nChannel: " + result.channel.title + "\n\n"
	result.items.each_with_index do | item, i|
		puts "#{i+1}. #{item.title} ( " + bitly(item.link) +" )"
	end
end

On Craigslist:

#!/usr/bin/ruby -w
# Autor: Albertux (Alberto Isaac Ayala Esquivias)
# URL/Blog: http://Albertux.AyalaSoft.com
# E-mail/Spam: <albertoi7@gmail.com>
# Free Coke License: If you see me some day give me a free coke please.
# Description: This script maybe help people to find a fucking Job.
 
require "rss/1.0"
require "open-uri"
 
def craigslist_reader(feeds)
	feeds.each do | feed |
		open(feed) do | http |
			response = http.read
			result = RSS::Parser.parse(response, false)
			puts "\nChannel: " + result.channel.title + "\n\n"
			result.items.each_with_index do | item, i|
				puts "#{i+1}. #{item.title} #{item.link}" if i < 10
			end
		end
	end
end
 
craigslist_feeds = [
		"http://sfbay.craigslist.org/sof/index.rss",
		"http://sfbay.craigslist.org/web/index.rss",
		"http://sfbay.craigslist.org/eng/index.rss",
		"http://sfbay.craigslist.org/cpg/index.rss"
]
 
craigslist_reader(craigslist_feeds)

Categories: network, web Tags: , ,