Archive for the ‘ Tech Tips ’ Category

One of my staff asked me on how to upload a 345MB SQL dump file he extracted from one of our DB servers to another server. He told me that he is having a problem doing this task using PhpMyAdmin because of the 2MB limitation found PhpMyAdmin’s import screen.

I know that the procedure below is very basic to others but still, allow me to give you the easiest way on how to upload an SQL dump file to another server:

  1. Upload the .SQL dump file to your target MySQL server via FTP or SFTP.
  2. Type the command below:
    mysql --user=username –password=password DB_name < dumpfile.sql
  3. Congratulations!

NOTES:

  1. The command used above will upload the table(s) and records inside dumpfile.sql to an existing database named DB_name.If the “CREATE TABLE” portion in the dumpfile.sql is present then it will create the table(s) inside DB_name, provided that the table(s) is (are) not yet in the DB_name.
  2. If the table(s) is (are) already in the DB_name and you just want to insert records inside the table(s), you need to remove the “CREATE TABLE” portion inside the dumpfile.sql. Just make sure that the fields of the existing table are the same with the fields in the dumpfile.sql you want uploaded.

Popularity: 2% [?]

SAMBA Installation HOWTO

Samba is a free software re-implementation of SMB/CIFS networking protocol, originally developed by Australian Andrew Tridgell. Samba is released under the GNU General Public License. The name Samba comes from SMB (Server Message Block), the name of the standard protocol used by the Microsoft Windows network file system.

I am posting some basic steps below on how to implement a simple samba server using slackware linux with IP address 192.168.0.5 for linux newbies out there:

STEP 1: Download and unpack the Samba source codes

#cd /usr/local/
#wget_http://mirrors.dotsrc.org/samba/samba-3.2.0.tar.gz
#tar -xzvf samba-3.2.0.tar.gz

STEP 2: Compile and install Samba

#cd samba-3.2.0/source
#./configure
#make
#make install

STEP 3: Configure Samba

#cd /etc/samba
#pico smb.conf (or use your favorite text editor like vim)

Copy and paste the sample config below:

[global]
workgroup = lintekfileserver
server string = akalainmonglinuxto
security = user
log file = /var/log/samba.%m
load printers = yes
max log size = 100
socket options = TCP_NODELAY

[home]
comment = Home Directory
path = /home/lintek/
valid users = lintek
writable = yes

STEP 4: Add a samba user and set the password

Make user you have an existing linux user named lintek (based on the configuration above), if you don’t have then you can use the command below:

#adduser lintek

NOTE: Make sure that lintek user’s home directory is /home/lintek

#smbpasswd -a lintek
New SMB Password:
Retype new SMB Password:

STEP 5: Start the server

#chmod 755 /etc/rc.d/rc.samba
#/etc/rc.d/rc.samba start
Starting Samba: /usr/sbin/smbd -D
/usr/sbin/nmbd -D

STEP 5: Mount SMB share from another Linux Machine

#mount -t smbfs -o username=lintek,password=lintektalaga //192.168.0.5/lintek /mnt/lintek

CONGRATULATIONS! You have successfully created a very simple samba server.

Popularity: 1% [?]

The pagefile.sys file is the Virtual Memory file used by your Windows computer. If you have limited RAM, your windows machine to run programs and store data. It swaps out some of the RAM data to the page file and then reuses the freed up RAM.

You can improve the security of a computer running Windows if you delete pagefile.sys everytime you shut down your Windows machine.

How to do this?

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management

Add the following registry keys:

Value Name: ClearPageFileAtShutdown
Value Type: REG_DWORD
Value: 1

You need to restart your computer for the changes to take effect.

Popularity: 1% [?]

The situation:

I was able to upgrade from Wordpress 2.3 to Wordpress 2.5.1 couple of days ago.

The problem:

Everything went well until I found out that my hosting provider is blocking the IP address of my workstation everytime I am writing a new post. I  informed my hosting provider about the problem and they were generous enough to unblock my IP address. However, I noticed that my IP is getting blocked everytime I am accessing post-new.php page and it will take me 5 to 10 minutes before my IP address gets unblocked after closing the post-new.php page. It was a bit different scenario compared to the  total block I exprerienced previously.

The solution:

Downgrade Wordpress to 2.3.3 version, unfortunately, Wordpress seems to have no information about this.  In this regard, I created a simple steps on how to downgrade your Wordpress installation in less technical ways below:

1. Do not delete your upgraded wordpress database.
2. Backup is not necessary, you don’t even need to restore your Wordpress database from your backup.
3. Delete all upgraded Wordpress files except wp-content folder, the files inside it and wp-config.php (temporarily renaming the files instead of deleting them is also a good practice e.g. index.php to index.php2)
4. Upload all the files extracted from Wordpress 2.3.3 ZIP file downloaded from Wordpress website.
5. Take note that Wordpress 2.5 has a new password hashing system, therefore you cannot login yet from your downgraded WP website. To solve this problem, go to http://your.blog.com/wp-login.php?action=lostpassword to reset your password.
6. Login to  http://your.blog.com/wp-login.php after resetting your password and follow the last instruction.

YOUR WORDPRESS INSTALLATION HAS BEEN DOWNGRADED! HAPPY BLOGGING!

NOTE: I was in an infinite ping from the computer I am using to my website when I was writing this post and my IP address did not get blocked anymore. I don’t know what’s inside Wordpress 2.5.1’s post-new.php which is causing my hosting provider to block my IP address everytime I am accessing it, but downgrading to 2.3.3 has solved my problem.

Popularity: 1% [?]

 

To disable your Windows XP time display, ADD the following Windows XP registry hack:

Hive: HKEY_LOCAL_MACHINE
Key: Software\Microsoft\Windows\CurrentVersion\Policies\Explorer
Name: HideClock
Type: REG_DWORD
Value: 1

Enjoy!

Popularity: 1% [?]

How do you display your server’s open ports and the process that owns them? You can use the commands below to accomplish this (make sure you run them as root):

#sudo lsof -i
#sudo netstat -lptu

Below are sample output of the commands above:

Popularity: 1% [?]