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 --level2345 on
chkconfig httpd --level2345 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 aliasesaliasstart_centos='VBoxManage startvm "CentOS" --type headless'aliascentos='ssh -p 2222 root@localhost'
Make twitter useful:
# goto http://code.google.com/p/python-twitter/ on ubuntu:apt-getinstall python-twitter
#!/usr/bin/env python# -*- coding: UTF-8 -*-# Albertux (Alberto Isaac Ayala Esquivias)importre, twitter
importsubprocess##################### 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.textfor s in statuses]
last_msg = msgs[0]
flag = re.findall(r"REGEX",last_msg,re.I)iflen(flag)>0:
subprocess.call(stop)else:
subprocess.call(start)
using bash:
watch -n60 ./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:
#!/usr/bin/env pythonimport 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/bashtime-o output.log $CMD# -o: command not found, using /bin/dash works/usr/bin/time-o output.log $CMD# works/usr/bin/time$CMD2> 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:
#!/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 Jobrequire"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.textend
url
endopen("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_indexdo| item, i|puts"#{i+1}. #{item.title} ( "+ bitly(item.link)+" )"endend
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.eachdo| 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_indexdo| item, i|puts"#{i+1}. #{item.title} #{item.link}"if i <10endendendend
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)