September 16, 2016
I wanted to connect to a remote server and setup a tunnel for my MariaDB replication ( yes I migrated to MariaDB ),
the only problem was that sometimes the net is erratic and can’t connect right away on boot time.
Found a code online to check for ping reply, if it does, continue with the tunneling.
I modified this to suit my needs.
In summary, the script checks for a ping reply from Google infinitely. Once it receives a response, it then creates the tunnel.
Source for the code here
((count = 0))
while [[ $count -ne 1 ]] ; do
ping -c 1 184.108.40.206
if [[ $rc -eq 0 ]] ; then
((count = 1)) # If okay, flag to exit loop.
if [[ $rc -eq 0 ]] ; then # Make final determination.
screen -dm -S tunnel autossh -M 0 -o "ServerAliveInterval 60" -o "ServerAliveCountMax 3" -p <PORT> <IP_ADDRESS> -L <LOCAL_TUNNEL_PORT>:localhost:<MYSQL_PORT>
echo `date` >> log.txt
echo "Tunnel Timeout...." `date` >> log.txt
August 15, 2016
I ran into this problem after upgrading/intalling MariaDB, the config file was missing.
To regenerate the config file… try executing…
dpkg --force-confmiss -i /var/cache/apt/archives/mysql-common*.deb
July 30, 2016
I recently updated to Ubuntu 16.04.1 LTS from 14.04 and ran into this problem as not having my network adapter detected on startup.
No network adapter, no connection to the internet, no updates…
I did some research and digging and it seems that starting Ubuntu 15.04, as quoted from one of the forums..
“…starting with systemd/udev will automatically assign predictable, stable network interface names for all local Ethernet, Wlan and Wwan interfaces.”
Whole info at this link.
Well there it was, no more eth0 on default installation. The system gave me ens160 as a network adapter name.
One way of fixing it is to retain the new name and just rename the network name in the interface file to the new naming scheme. Sample here
How to revert to the old naming scheme?
Here are some tips and tricks.
- Edit your grub file, this is located at /etc/default/grub
- Look for GRUB_CMDLINE_LINUX=””
- Add net.ifnames=0 biosdevname=0 between the double quotes.
- Save and create new grub config by executing the command grub-mkconfig -o /boot/grub/grub.cfg
- If your using dhcp, no need to rename your network name in the interface file back to eth0.
- Reboot system after that.
April 27, 2016
Had a problem with a fresh install of MySQL 5.7 using more than normal memory.
Researching around the net, one feature that was added (5.6?) that fixed my problem was performance schema ( performance_schema ).
Disabling is easy enough as adding performance_schema=0 in my.cnf config file.
Thanks to Joel Abraham for the fix.
March 9, 2016
I had a problem connecting to a remote server that has its ports blocked by the ISP. So technically, I can’t port forward my way into the server. The only way around this is to SSH connect from my remote server to my main server and access the remote server via reverse SSH tunneling. This tutorial will show the steps on how I connected to my database server on the remote server via port forwarding on my PC and reverse SSH tunneling on my main server.
- Connect from the remote server (B) to the main server (A).
- #> screen autossh -R22222:localhost:22 your_remote_IP_address
- screen – new terminal so you can disconnect and work on other stuffs
- autossh – reconnects if ssh is broken or is disconnected
- -R -> tells the client that the remote port to open for the reverse tunnel
- 22222 -> of course, the port to be used on the other end
- localhost:22 -> anything attached on port 22222 will reach localhost port 22
- your_remote_IP_address – not much explaining needed
- Now on the main server ( A ), to connect to remote server via the SSH tunnel created.
- #> ssh -p 22222 username@localhost -L 4406:localhost:3306
- -p 22222 -> instructs the SSH client to connect to localhost via port 22222
- -L 4406:localhost:3306 -> this tells the client to forward all packets that is sent on port 4406 to localhost and target port 3306. That’s if the connection succeeds, will be on the remote server already.
- On my dev machine, I setup my SSH client ( putty ) to bind to port 99999 and forward it to the main server on port 4406.
- I then have my DB Client attach to port 99999 on connect
Image shown below….
January 30, 2014
I had an office PC converted into a VMWare image and wanted to reduce the image file after cleaning up unwanted files and applications. The compact command for the HDD will not totally reduce the image file size in the HOST OS.
VM Image OS is Windows XP. For linux, I will assume a different process.
To literally reduce file size in the host OS, what I did…
- Free up disk space.
- Zero fill freed up space, I used CCleaner
- Shutdown the VM
- Run again VMWare Player and right click on the VM
- Go to Hard Disk and under Utilities -> Compact
- Finish the compact phase and start the VM again.
- Install any Partitioning software, I used EaseUS.
- After completing the installation, re-size the Hard Disk that has the freed up space to a smaller space that you want
- Apply the re-reize
- Shutdown the VM, the actual size on the Host OS will now have the reduced file size.
You can expand the size again of the partition/hard disk using the partitioning software and it will not affect the actual VM image file size in the host OS until you start adding new files/data into it.
January 9, 2013
I wanted to setup my own Git repository locally and with an accompanying front end GUI. Before Gitorious, I installed Git from scratch and also installed Gitolite. That will be another post later on.
Initially I followed the script from http://blog.kyodium.net/2011/09/install-gitorious-on-ubuntu-1104.html but its based on Ubuntu 11.04, there are some missing packages that was not part of the installation script so I had to run the script manually and jump from one tutorial to the other, but the main flow I used is from that script. This is the documentation of the installation process.
Note: I added the PPA to Git’s updated source so I would be using their latest release not Ubuntu’s Git package. ( Google around for Git’s PPA repository, its easy enough 😉 )
Also I was not logged into root ( which I prefer, so I had to do a lot of sudo-ing =S )
Execute these line-by-line… please don’y copy everything then go pressing enter.
Update your Ubuntu server to latest patches and install the packages bellow.
sudo aptitude install build-essential zlib1g-dev libcurl4-openssl-dev postfix apg geoip-bin libgeoip1 sqlite3 libsqlite3-dev libgeoip-dev libpcre3 libpcre3-dev zlib1g zlib1g-dev libyaml-dev libmysqlclient-dev libonig-dev zip unzip memcached git-core git-svn git-doc git-cvs libreadline-dev openjdk-6-jdk sqlite3 libsqlite3-dev libmagick++3 libmagick++-dev libapache2-mod-xsendfile libxslt1-dev libreadline5 libxslt-dev libxml2-dev imagemagick apache2-dev activemq
Update Ruby Gems
Read the rest of this entry »
December 13, 2012
Yahoo! Mail finally has SSL support, or I just noticed it now.
Anyway.. for those who are paranoid or takes security to another level, like me, you can enable SSL support under the Mail Options, under the Options tab. Just enable the check box and save your settings. You need to reload the page as well as clear your cookies after enabling this feature. I had to clear my cookies for the SSL page to load.
Screen shot below.
November 27, 2012
Sencha ( formerly ExtJS ) has a cool paging toolbar at the bottom of their Grid List component. There are sometimes scenarios that I want to pass values, lets say ID or search terms, for the next/previous page to retrieve. Sadly the buttons ( First, Previous, Next, Last and Refresh ) does not have any onClick event handlers to initialize the parameters before sending to the database. The only thing close to handling this requirement that I found is that you have to set a listener for the beforechange event under Ext.PagingToolbar to initialize the parameters and values before the component sends the data to the server. This way any variables can be set before sending.
The variables that are sent to the server is normally start and limit, what if I want to add a filter to the query? One way is adding baseParams to your data store and change their value using setBaseParam when the beforechange event is fired.
Sample code below.
Read the rest of this entry »
January 30, 2012
Update: This will also work for 5.1 and 5.5.
Note, this is a WhiteBox setup so not all parts are officially supported by VMWare. Specs below…
- i7 2600K
- Gigabyte P67A-UD4 B3
- 8GB DDR3-1866hz 9-9-9
- 1TB Samsung F3 drives
- Intel Gigabit Network card
Now, the issue here is that after a clean install of VMWare Sphere 5, boot-up would take at least 5-9 min to complete from a clean power-on. Compared to an upgrade from VMWare Sphere 4.1U1 which will load all the necessary drivers right away after a restart/power-on. It seems like its not detecting the HDD at all at first glance but soon found its way. Further tests, experiments and research yielded that this is a side-effect on how VMWare handled their installation process in VMWare Sphere 5 compared to 4.1U1. In 4.1U1, it uses the MBR for the boot process by default, while in 5.0 it uses GPT. You can fixed this if you force the installer to use MBR during the installation phase.
Read the rest of this entry »