SOHO : Small Office Home Office
Freeware - Opensource software tips, tricks, tweaks & fixes for managing, securing, improving the performance of SOHO Desktop, Laptop, Networks

Thursday, March 29, 2012

Syslog file is not readable, read access may be denied


User permissions in syslog files are 640 but for LogAnalyzer to work syslog files must be readable by www-data. Below are the steps to make syslog readable

1. First add a new group by using this command, we call the group logadmin in this sample.
     groupadd logadmin

2. Now we add the www-data user to the new created logadmin group!
     usermod -a -G logadmin www-data

3. Verify the success by using this command:
     groups www-data

4. Now it is time to edit the /etc/logrotate.conf configuration file. Search for the default "create" command, and change it to the following:
     create 640 root logadmin
The next time logrotate will run, the logfiles will become readable to the webserver by default.

What is Log Analyzer?
The LogAnalyzer project provides an easy to use but powerful front end for searching, reviewing and analyzing network event data, including syslog, windows event log and many other event sources. It focusses on the user-interface side of this project, so the data itself needs to be gathered by another program, for example the stock syslogd, rsyslog (often the distro's default syslogd), WinSyslog or MonitorWare Agent. LogAnalyzer works equally well on Linux and Windows. It is a free, GPLed open source application written mostly in php. 




Continue Reading...

How to make syslog files readable by default on ubuntu?

We installed LogAnalyzer for easy analysis and reporting of the server.  For this syslog files must be readable by www-data. Below are the steps to make syslog readable

1. First add a new group by using this command, we call the group logadmin in this sample.
     groupadd logadmin

2. Now we add the www-data user to the new created logadmin group!
     usermod -a -G logadmin www-data

3. Verify the success by using this command:
     groups www-data

4. Now it is time to edit the /etc/logrotate.conf configuration file. Search for the default "create" command, and change it to the following:
     create 640 root logadmin
The next time logrotate will run, the logfiles will become readable to the webserver by default.

What is Log Analyzer?
The LogAnalyzer project provides an easy to use but powerful front end for searching, reviewing and analyzing network event data, including syslog, windows event log and many other event sources. It focusses on the user-interface side of this project, so the data itself needs to be gathered by another program, for example the stock syslogd, rsyslog (often the distro's default syslogd), WinSyslog or MonitorWare Agent. LogAnalyzer works equally well on Linux and Windows. It is a free, GPLed open source application written mostly in php. 
Continue Reading...

Wednesday, March 28, 2012

WHAT'S THE DIFFERENCE OpenVZ and Xen VPS?


Below, we provide you with a basic chart of the largest differences between  OpenVZ VPS Hosting and Xen VPS Hosting.



OpenVZ VPS Hosting  Xen VPS Hosting
Speed Fastest Fast
Custom Kernel Compiling  Not possible Yes, Compile anyway!
VM Isolation Shares host nodes kernel. Does not have complete isolation Complete isolation from other containers. The abuse of other VM's will not affect yours
Overselling Yes, overselling can be done Overselling is not allowed as resources are dedicated
Running JAVA Don't even look at me Look at me. I'll treat you much better then OpenVZ
Stability Least reliable due to not having total isolation - shared kernel Most reliable due to having complete isolation
Continue Reading...

Hide blogger post footer in home page

Sometimes you may wonder how to change the way some components appear on your homepage such as Default Post Footer.  To hide default Blogger Post Footer from your homepage.




Steps:
1. Go to Blogger Dashboard

2. Click on your Blog Title.

3. Jump to Template tab from left pane. 
Note: Before editing your template, you may want to save a copy of it. 

4. Now click on Edit HTML button.

5. Click Proceed button to view Template Editor.

6. Tick on Expand Widget Templates

7. Find below code in your template

8. Now paste following code snippet after ]]></b:skin>.

9. Preview your blog to confirm changes and Save template.


Continue Reading...

Monday, March 26, 2012

Install ioncube loader in ubuntu

IonCube protects software written using the PHP programming language from being viewed, changed, and run on unlicensed computers.
1. Download ionCube loaders to suite your system architecture
wget http://downloads.ioncube.com/loader_downloads/ioncube_loaders_lin_x86.tar.gz
2. Extract
tar zxvf ioncube_loaders_lin_x86.tar.gz
3. Move to a permanent location
mv ioncube /usr/local/lib
4. Add reference to your php.ini file (sudo nano /etc/php5/apache2/php.ini)
zend_extension = /usr/local/lib/ioncube/ioncube_loader_lin_5.2.so
There are a few versions of the loader in the tar archive and you must  choose the one as your php version ( check php version with command  php -v )
5. Restart apache
/etc/init.d/apache2 restart
6. Verify
Print phpinfo() and notice the following red rectangular, "with the ionCube PHP Loader v4.0.1, copyright(c) 2002-2010, by ionCube LTD"
Continue Reading...

Saturday, March 24, 2012

Allow only encrypted connections for both incoming and outgoing with rtorrent

What does encryption Do?

The RC4 encryption obfuscates not only the header but the entire stream. This means that it’s very hard for your ISP to detect that the traffic you are generating comes from BitTorrent.

Note that RC4 uses more CPU time than the plain encryption or no encryption. It is however harder to identify for traffic shaping devices


This can be achieved by modifying the .rtorrent.rc file
  • Quit all rtorrent sessions
  • Add / modify this line in rtorrent config file ( .rtorrent.rc located in the users home folder)  
encryption = require,allow_incoming,require_RC4
  • Restart rtorrent.
  • Check for E flag to all connected peers
( Click on image to enlarge )
Continue Reading...

Monday, March 19, 2012

How to add & remove users by command line in ubuntu?

To add a user you must use be root or use the sudo command. Here are the commands:

To add a user. NOTE: do not use the useradd command.
$ sudo adduser <username>


To see the options for adding a user try the man command.
$ man adduser


Add user
Here is a useful example of the useradd command. Why use useradd? It gives a few more options for special cases. To add a user, give her a standard home directory in the /home folder and specify the shell she accesses by default do this:

$ sudo useradd username -m -s /bin/bash 
$ sudo passwd username 

Groups


You might also wish to create a new group for your users.
# sudo addgroup <groupname>


To add a new user to a existing group you would do this:
# sudo adduser <username> audio


To add an existing user to an existing group you can use the same command:
# sudo adduser <username> <groupname>

or
# sudo usermod -aG <groupname> <username>



Delete  user

To remove a user from a system without deleting the users home directory.
# sudo userdel username


To remove the user and delete the users home folder:
# sudo userdel -r username


Continue Reading...

Tuesday, March 13, 2012

Torrent client configuration

In order to apply these tips you need to know your maximum up- and download speed. You can test your bandwidth over here (stop all download activity while testing). 

Note that there’s a difference between kb/s (kilobits/second) and kB/s (kilobytes/second). To be precise, kB/s = kb/s divided by 8. In this tutorial we use kB/s (like most torrent clients do). This means that you might need to calculate your max speed in kB/s yourself if the speedtest only gives you the results in kb\s (so divide by 8 then).

Settings 1-4 can be found in the options, settings or preference tab of most torrent clients.

1. Maximum upload speed
Probably the most important setting there is. Your connection is (sort of) like a pipeline, if you use your maximum upload speed there’s not enough space left for the files you are downloading. So you have to cap your upload speed.

Use the following formula to determine your optimal upload speed…

80% of your maximum upload speed

so if your maximum upload speed is 40 kB/s, the optimal upload rate is 32kB/s

2. Maximum download speed
Although setting your maximum download speed to unlimited may sound interesting, in reality it will only hurt your connection. If you still want to be able to browse properly, set your maximum download speed to:

95% of your maximum download speed

so if your maximum download speed is 400 kB/s, the optimal download speed is 380kB/s

3. Maximum connected peers per torrent
Yet another setting that you don’t want to max out. I experimented quite a lot with the max connected peers settings and came to the conclusion that both high and low number hurt the download speed of a torrent. The following setting worked best for me.

upload speed * 1.3

so if your maximum upload speed is 40 kB/s, the optimal amount of connected peers per torrent is  40 * 1.3 = 52 .  I didn’t noticed a difference for fast or slow connections here.

4. Maximum upload slots
1 + (upload speed / 6)

so if your maximum upload speed is 30 kB/s, the optimal number of upload slots is

1 + (30 / 6) = 6

5.Change the default port.
By default, BitTorrent uses a port 6881-6999. BitTorrent generates a lot traffic (1/3), so isp’s like to limit the connection offered on the these ports. So, you should change these to another range. Good clients allow you to do this, just choose anything you like. If you’re behind a router, make sure you have your ports forwarded (portforward.com) or UPnP enabled.

6.Turn on Encryption
Encrypting your torrents will prevent throttling ISP’s from limiting your BitTorrent traffic. Check out how to enable encryption in Azureus, uTorrent, and Bitcomet, the three most popular torrent clients.


7.Enable DHT
DHT stands for “Distributed Hash Table”. If a web based tracker goes down, the torrents stay alive because peers can act as “nodes” keeping the swarm intact, and the torrent alive. So you could say that the DHT layer serves as a peer-to-peer tracker. The DHT feature is available on Azureus, Bitcomet, uTorrent and several other BitTorrent clients.


To do on windows PC

1. Disable Windows Firewall
It sucks. Windows Firewall hates P2P and often leads a life of it’s own. So disable it and get yourself a decent (free) firewall, Kerio or Zone Alarm for example.

2.Optimize your internet connection
The TCP optimizer is a freeware utility that optimizes your internet connection. I found it very useful and it helped speeding up my connection for regular internet activity and for downloading torrents. Just download it, and move the slidebar to your maximum download rate (note that it’s in kb/s). Don’t try to set it higher because that will hurt your download speeds!
Continue Reading...

Wednesday, February 8, 2012

Find IP range of any ISP with APNIC


  1. Go here http://wq.apnic.net/apnic-bin/whois.pl
  2. Look up one of the IPs you know of in the range
  3. Look for: mnt-lower
  4. Change the Inverse attributes to mnt-lower
  5. Then do a look up for: MAINT-AU-TIAR-AP (example)
  6. Now click search and all the ranges will come up.


Continue Reading...

Saturday, December 10, 2011

Automatic Read More for blogger posts

Auto Read More/Continue Reading with Thumbnail For Blogger


This is a simple hack that will improve the look of your blog and avoid inserting "jump break" manually to every post. By adding few lines of code to the html template  "Read  more" / "Continue reading" is automatically added for every (old / new) blog posts.

Step 1
Go to Dashboard >> Design >> Edit HTML >> Download Template (for back up) >> Click on Expand Widget Templates and look for </head>


Now add following code ABOVE </head>

Step 2
Now look for <data:post.body/>


Add following code ABOVE <data:post.body/>

Also add following code BELOW <data:post.body/>

Step 3
Save your template.


Customization
summary_noimg = 430;
is post cut height without image


summary_img = 340;
is post cut height with image


img_thumb_height = 100;
is thumbnail image height


img_thumb_width = 120;
is thumbnail image width
You can change these values as per your needs.


Note:
In stead of Read More you can write Read Full Article or Continue Reading… or insert an image or something like that. To make a change, edit the second code that you had to add below <data:post.body/> and edit that term Read More to whatever you want.

You can also add the post title to Read more links. To do this replace the code below <data:post.body/> with this code
Continue Reading...