↓
 

Computer Aid

Ph: 0402 133 866

  • Home
  • Blog
  • Contact
  • Web Services
    • Websites
    • SEO
    • Hosting
    • Domain Names
    • Portfolio
Home→Categories Linux

Category Archives: Linux

cleanup the email buildup in cpanel

Computer Aid Posted on 3 December, 2013 by Luigi Martin3 December, 2013

Ive had this ongoing problem with emails on hosted domains that use linux cpanel.

I’ve had this issue for over 8 years, and across 3 different hosting companies, so it must be quite widespread, yet nobody seems to be interested in fixing it.

So what’s the problem?

While using a pop3 email account, the hosting server accumulates email files that get downloaded to the email client.

Even if the email client is configured to delete the emails from the server after download, the cpanel server still keeps these emails… indefinitely!

In the early days, I would routinely get warnings about my disk storage reaching maximum capacity (ie I was running out of space).

After some investigation, I found that emails were the culprit, and there was nothing in place to fix it, other than to login to the cpanel, and manually remove the large number of files.

I managed to create my own solution, using my unix knowledge:

I created a cron job, which would run daily, which would scan all the mail folders, and delete any files that were older than, say, 60 days.

So as long as I checked my mail at least once every 60 days, then my system wouldn’t delete any undelivered emails.

Since starting my own hosting company, I have found this technique very useful in preventing my own customers from having similar problems.

So exactly what do I do?

If you are familiar with cron and unix scripts, the command looks something like:

13 3 * * * find ~/mail -name "*.*.*.*.*" -type f -mtime +60 -exec rm '{}' ;

In simple terms, what this means is:

at 3:13 in the morning, every day, execute the command:

find ~/mail -name "*.*.*.*.*" -type f -mtime +60 -exec rm '{}' ;

And the command means: search the folders under the mail folder, and find a file that has 4 dots in the name (*.*.*.*.*)

the -type f makes sure it only finds files, and not folders, or other weird stuff.

the -mtime +60 means make sure the files have been modified over 60 days ago

the -exec rm ‘{}’ ; means use the rm command (ie delete) on each file found ( the ‘{}’ will substitute the file name), and the ; means this is the end of the -exec part on the command.

Try this at your own risk… this has the potential to delete your whole website, so be extra careful, and don’t just blindly copy/paste what I wrote.

I tested the command by using the ls command, instead of rm… that way I could see which files would get deleted, without deleting anything!

Besides the risk of not knowing what you’re doing, the only problem with this system, is that it doesn’t seem to work if you use IMAP eg it can happen if you use smartphones/ipads/tablets/IMAP email clients… particularly if you rely on the email programs “auto-detect” system, then you probably find that the cleanup just doesn’t work.

In this case, besides some careful customer education, the only option is to use an email redirection to something like gmail , so that you use the large gmail storage, rather than the more limited hosting storage.

Posted in Linux, Technical | Tagged buildup, cpanel, cron, email

mapping network drives on a qnap NAS vpn

Computer Aid Posted on 3 September, 2012 by Luigi Martin3 September, 2012

I have recently installed a few QNAP NAS servers far various business customers.

Since I’m not very familiar with NAS servers in general, and since one customer specifically requested VPN access via the NAS server, I decided to see what was achievable with this type of NAS server.

The number of options available is staggering, and its all Linux-based.

The QNAP servers can do:

  • Microsoft, Linux and Apple networking
  • Webserver file serving
  • itunes server
  • Apple time machine support
  • VPN
  • Joomla, WordPress, phpMyAdmin, vtigerCRM, Magento, etc
  • print server
  • database server
  • backup server
  • uPNP media server support for various protocals
  • Multimedia Station for serving Audio, Video, and Photos
  • Surveillance camera support

In this particular case, I just wanted to enable VPN support, and map a network drive, so that a remote application could access data files on the server

Enabling and configuring VPN is quite easy, as the QNAP website guides you through the process (I decided to use PPTP, as it seemed much simpler to setup).

But once I had established a VPN connection, what next? How do I map a network drive?

I eventually found the solution as follows:

While you are configuring the server via the web admin panel, go to: Application Servers -> VPN Service

make a note of the VPN client pool. it should be something like:

172.19.0.2 – 192.19.0.254

That means the server will appear on the VPN client as: 172.19.0.1

After that, mapping from the windows command line (cmd.exe) is quite easy.

Lets assume that the servers folder share is SDRIVE, the server username is joe (password is pass), and you want to map the folder share to drive W:

You type:

net use w: \172.19.0.1SDRIVE pass /user:joe /persistent:yes

after that, you can use the w: as if it was a local (albeit slower) drive.

Although I haven’t been able to test it yet, I have heard that you can lose internet access unless you go to the advanced ipv4 settings of your network settings, and disable the setting: use default gateway on remote network.

Posted in Business, Linux, Technical | Tagged map, NAS, qnap, VPN

Qnap re-launch process smbd and stunnel

Computer Aid Posted on 9 August, 2012 by Luigi Martin9 August, 2012

While setting up a QNAP NAS server, I cam across an unusual problem.

Apparently its quite common to have the server generate warnings that say:

  • Re-launch process [smbd]
  • Re-launch process [stunnel]

This happens every minute, so it makes it difficult to monitor for “real” problems.

At first, I decided to just re-install the firmware, and that got rid of the warnings until I restored the configuration backup file… then it was generating the usual of warnings again.

I didn’t want to re-enter all the settings manually, so I tried deleting and re-created the RAID system (didn’t help)

I saw a brief mention on a forum, that a bad RAID setup can cause these errors.

So I tried the following:

  • Restore to factory defaults
  • Initialise the drives (and wait until the initialisation is complete… it can take hours)
  • retore configuration backup file

That worked!

It looks like I might have done some important configuration changes while the drives were initialising… I guess patience is the key in this case!

Posted in Business, Linux, Technical | Tagged qnap, smbd, stunnel

EasyPeasy networking disabled

Computer Aid Posted on 13 December, 2011 by Luigi Martin13 December, 2011

I recently had a strange problem with my EasyPeasy Netbook.

It took a very long time to start (maybe the battery went flat while in hibernation).

After about a 30 minute wait for startup, I found that the networking was disabled.

Hovering the mouse over the WiFi network symbol at the top of the screen gave the message: Networking Disabled

Ok, I flick the netbook switch to turn off the wifi, and after it goes off, I switch it back on again.

As usual, the WiFi light goes from amber to blue (and the bluetooth also switches on again)… but linux still says networking disabled.

I don’t want to waste much time on this, so a quick internet search finds 2 solutions:

  • delete /var/lib/NetworkManager/NetworkManager.state
  • edit /var/lib/NetworkManager/NetworkManager.state (change the line “NetworkingEnabled” from false to true, save, then restart easypeasy)

I didn’t want to risk deleting a system file, so I edited the state file, and after a restart, everything was back to normal.

Posted in Linux | Tagged EasyPeasy, networking, wifi

HP Mini 1001TU WiFi on Ubuntu Netbook (EasyPeasy 1.6)

Computer Aid Posted on 16 August, 2010 by Luigi Martin16 August, 2010

I have a HP Mini 1001TU netbook with a failed 60Gb HDD (which was running Windows XP).

I removed the HDD. It was a 1.8″ drive, which is difficult/expensive to replace.

I decided to get a 16GB SD card and install Linux.

This will make the Netbook slightly lighter, and also extend battery life slightly.

I decided to install EasyPeasy 1.6 (a variation on Ububtu Netbook).

Installing linux to an SD card can be tricky:

Don’t install the “liveCD” image directly to the SD card, as it will always think that its a read-only media, and any changes you make will not last once you restart the Netbook.

What I do instead is:

  • Make a bootable liveCD from a cheap 1GB USB drive (unetbootin is good for this)
  • Boot from the USB drive, while the blank 16Gb SD card is inserted into the SD slot.
  • Start the “install EasyPeasy” application, and make sure you install to the SD card.
  • Shutdown the netbook, and make sure you remove the USB drive.
  • start the netbook and press F10 -> System Configuration -> Boot options -> boot device priority -> make sure the first boot device is: “USB single flash Reader”
  • Now the Netboot will always boot from the SD card.

My next challenge was getting the WiFi wireless network going.

Everything seemed to be in place, the netbooks WIFi button was in the ON position, but I would not see any wireless network on the network icon (top-right of the screen)

After a lot of searching around, I found the solution was actually quite simple:

  • Make sure the netbook is connected to the internet via the ethernet cable.
  • Click the “System” tab on the bottom-left of the main screen
  • Click on “Hardware Drivers” (near the bottom of the System page).
  • Click “broadcom STA wireless driver”, then install.
  • Once the driver has been downloaded and installed, I usually remove the ethernet cable and restart the netbook.
  • The network icon now allows me to connect to WiFi networks… it works just like any windows-based system… simple!
Posted in Linux | Tagged 1001tu, EasyPeasy, wifi

eee 1001ha and linux (EasyPeasy 1.6) and WiFi problems

Computer Aid Posted on 10 June, 2010 by Luigi Martin10 June, 2010

Based on my last post, you will know that I am now configuring a new Asus EEE 1001HA laptop.

My customer wants linux, so after some investigation, I decide that EasyPeasy linux is a good choice for a netbook.

Luckily, the 1001ha has the 160Gb drive split into 2 80Gb partitions (ordinarily I would be annoyed at this, and merge the 2 partitions, but this means I’ll be able to dual-boot Linux and XP).

First I download EasyPeasy, and configure it onto a 2Gb SD card,

Then, I boot from the SD card, so that I’m running EasyPeasy in live-CD mode.

I run the HDD installation within EasyPeasy, I select the non-XP partition, but I’m worried that it will delete the MBR, such that I will not be able to boot XP anymore…

Well, here is pleasant surprise: The MBR is overwritten, but the “Grub” boot menu includes Windows XP… So Easy Peasy was smart enough to detect XP, and added it to the boot menu. Very nice.

EasyPeasy is easy to learn, but I found 1 major problem with the eee 1001HA: I couldn’t get WiFi to work.

Apparently, the 1001ha uses the RT3090 WiFi chip (which supports the new 802.11N standard), but the Linux drivers are very patchy in this area.

I found a forum that suggested using the WiCD Network manager… I tried it, but that didn’t work either.

I eventually discovered that there is a bug with the driver for the RT3090 chip… but I also found a workaround at: https://bugs.launchpad.net/ubuntu/+source/linux/+bug/541620

Post 21 shows what to do:

As root:

mkdir -p /etc/Wireless/RT2860STA/
touch /etc/Wireless/RT2860STA/RT2860STA.dat

It seems like the driver is expecting to find the file RT2860STA.dat in a specific folder (that doesn’t exist in EasyPeasy).

Oh well, I’ve done lots of grumbling about Microsoft… I guess this is my first complaint about Linux… it can have poor programming standards.

Posted in Linux, Technical | Tagged 1001ha, EasyPeasy, wifi

Archives

Categories

Recent Comments

  • Sue Jones on outlook error 0X800ccc0e while sending emails
  • Blair Newmann on AdSmartMedia advertising
  • Private Investigator in GTA on Divorce, consent orders, and superannuation splits: getting the wording correct

Tags

802.11g ADSL amd android bigpond broadband bsod defender dell email exitjunction firefox firewall gmail Google google contacts ie7 infection internet connection ISP laptop Linux m1188a ntldr is missing office 2007 outlook outlook express password power supply problems ram registry repair install sata scam slow telstra thunderbird usb vista wifi windows 7 wireless wordpress xp
Copyright © 2005-2015 Computer Aid
↑