Monday, February 28, 2011
Thursday, February 10, 2011
Mysql
To dump data from mysql table to txt file:
mysqldump --no-create-info --extended-insert=FALSE --compact psydex_rss_twitter MESSAGES > /tmp/testinsert.sql
(--extended-insert makes every row it's own insert statement)
SELECT col1,col2,col3
INTO OUTFILE '/tmp/file.csv'
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
LINES TERMINATED BY '\n'
FROM table_here
WHERE col1 > 857461
LOAD DATA LOCAL INFILE '/tmp/file.csv'
INTO TABLE table_here
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
LINES TERMINATED BY '\n';
mysqldump --no-create-info --extended-insert=FALSE --compact psydex_rss_twitter MESSAGES > /tmp/testinsert.sql
(--extended-insert makes every row it's own insert statement)
SELECT col1,col2,col3
INTO OUTFILE '/tmp/file.csv'
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
LINES TERMINATED BY '\n'
FROM table_here
WHERE col1 > 857461
LOAD DATA LOCAL INFILE '/tmp/file.csv'
INTO TABLE table_here
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
LINES TERMINATED BY '\n';
Wednesday, January 26, 2011
ASUS RT-N10 with Tomato Firmware
The following outlines steps taken to load the Tomato firmware on an ASUS RT-N10 wireless router. I used Fedora 13 as my desktop to download and update the firmware on the ASUS router.
0. Reset the ASUS to the factory firmware. Turn off the router and hold the reset button in while powering it back on. Stopping pressing the reset button after the power light blinks.
1. Download the firmware which works with the ASUS RT-N10 router. The main Tomato download page is located at http://tomatousb.org/download Look for the link to the Older Firmware Versions. I used the following firmware http://sourceforge.net/projects/tomatousb/files/Rotten/tomato-K26-1.28.9052MIPSR2-beta23-Std.rar/download
2. On your linux box, install tftp.
3. Turn off you network interface
4. Plug Ethernet cable from Linux box into one of the LAN ports on the ASUS RT-N10.
5. Turn on Linux Box network interface
# ifconfig eth0 192.168.1.2 on
6. Flash the ASUS RT-N10
When the tftp> prompt returns, the firmware has been pushed to the router. There is no response from the router to indicate the firmware has completed loading. I waited about five minutes, then powered cycled the router.
On boot-up I hit the router via the url http://192.168.1.1 I was presented with a menu about clearing the NVRAM, which I selected and the router started rebooting. I waited about a minute and hit the URL again, and was presented with the Tomato Web admin page. The default username was admin and the password was admin. Be sure to changed after logging into the router.
I configured my router as wireless ethernet bridge. I followed the guide at http://www.wi-fiplanet.com/tutorials/article.php/3810281/How-to-Set-Tomato-Firmware-for-Wireless-Client-Modes.htm
I have not tried any other firmwares or updates.
0. Reset the ASUS to the factory firmware. Turn off the router and hold the reset button in while powering it back on. Stopping pressing the reset button after the power light blinks.
1. Download the firmware which works with the ASUS RT-N10 router. The main Tomato download page is located at http://tomatousb.org/download Look for the link to the Older Firmware Versions. I used the following firmware http://sourceforge.net/projects/tomatousb/files/Rotten/tomato-K26-1.28.9052MIPSR2-beta23-Std.rar/download
2. On your linux box, install tftp.
# yum install tftp
3. Turn off you network interface
# ifconfig eth0 off
4. Plug Ethernet cable from Linux box into one of the LAN ports on the ASUS RT-N10.
5. Turn on Linux Box network interface
# ifconfig eth0 192.168.1.2 on
6. Flash the ASUS RT-N10
# CD <directory where firmware is located>
# unrar e tomato-K26-1.28.9052MIPSR2-beta23-Std.rar
# tftp 192.168.1.1
tftp> binary
tftp> put tomato-K26-1.28.9052MIPSR2-beta23-Std
When the tftp> prompt returns, the firmware has been pushed to the router. There is no response from the router to indicate the firmware has completed loading. I waited about five minutes, then powered cycled the router.
On boot-up I hit the router via the url http://192.168.1.1 I was presented with a menu about clearing the NVRAM, which I selected and the router started rebooting. I waited about a minute and hit the URL again, and was presented with the Tomato Web admin page. The default username was admin and the password was admin. Be sure to changed after logging into the router.
I configured my router as wireless ethernet bridge. I followed the guide at http://www.wi-fiplanet.com/tutorials/article.php/3810281/How-to-Set-Tomato-Firmware-for-Wireless-Client-Modes.htm
I have not tried any other firmwares or updates.
Friday, January 14, 2011
AWS firewall commands
#show current settings
ec2-describe-group Test
# Authorized to a group
ec2-authorize Test -P tcp -p 53 -o Test -u XXXXXXXXX
#Authorize to internet cidr block (all)
ec2-authorize Test -P tcp -p 8080 -s 0.0.0.0/0
# Revoke
ec2-revoke Test -P tcp -p 8080 -s 0.0.0.0/0
ec2-describe-group Test
# Authorized to a group
ec2-authorize Test -P tcp -p 53 -o Test -u XXXXXXXXX
#Authorize to internet cidr block (all)
ec2-authorize Test -P tcp -p 8080 -s 0.0.0.0/0
# Revoke
ec2-revoke Test -P tcp -p 8080 -s 0.0.0.0/0
Subscribe to:
Posts (Atom)