Terminal color schemes for .Xdefaults or .Xresources file

terminal.png

These can all be used by urxvt, xterm, aterm, and others. Enjoy.

Continue reading ‘Terminal color schemes for .Xdefaults or .Xresources file’ »

Stop ssh brute force attack using SuSEfirewall

suse.png

Edit /etc/sysconfig/SuSEfirewall2:

#do not open ssh ports here
FW_SERVICES_EXT_TCP=""
FW_CONFIGURATIONS_EXT=""

#add this rule
FW_SERVICES_ACCEPT_EXT="0.0.0.0/0,tcp,22,,hitcount=3,blockseconds=60,recentname=ssh"

#Restart firewall:
rcSuSEfirewall2 restart

Now attacker will just have three attempts to break in.

256 colors in vim

vim.png

XTerm and most other modern terminal emulaters support 256 colors.

To enable colors on XTerm you will need to run the configure scripts with the --enable-256-color switch, in addition you may also need to set your TERM environment variable to xterm-256color.

Continue reading ‘256 colors in vim’ »

Get rxvt-unicode with 256 color support on Ubuntu

ubuntu.png

rxvt-unicode (commonly called urxvt) already has 88 color support, and for most things, this is fine. But sometimes you just want a tad more, maybe for vim color themes.

So here’s my build log of compiling rxvt-unicode with the 256 color patch on Ubuntu Hardy, and debianizing (packaging) it.

Continue reading ‘Get rxvt-unicode with 256 color support on Ubuntu’ »

Use tabs to open multiple files in vim

vim.png

Editing multiple files at once is made easier in the vim text editor with the use of tabs. Vincent Danen goes over the basic tab commands and shows you how to combine them with key bindings to make the most of a powerful editing tool.
Continue reading ‘Use tabs to open multiple files in vim’ »

phpinfo from the command line

PHP.gif

Display information about your php install on the command line with the following:

echo “<?php phpinfo(); ?>” | php | less
simple enough.

How to repair a corrupt table in MySQL

mysql.jpg

Occasionally, under circumstances involving high load on the server, multiple INSERTs and UPDATEs, coupled with many SELECTs (see Section 28.5 for the syntax of SQL code), or hardware failure, your database server may corrupt a table. This is something it shouldn’t happen, but of course this doesn’t help you if it does. According to the MySQL manual on Corrupted MyISAM Tables, you can get corrupted tables if some of the following things happens:

  • The mysqld process being killed in the middle of a write.
  • Unexpected shutdown of the computer (for example, if the computer is turned off).
  • A hardware error.
  • You are using an external program (like myisamchk) on a live table.
  • A software bug in the MySQL or MyISAM code.

and the typical symptoms for a corrupt table are:

  • You get the error
    Incorrect key file for table: '...'. Try to repair it

    while selecting data from the table.

  • Queries don’t find rows in the table or return incomplete data.

Continue reading ‘How to repair a corrupt table in MySQL’ »

Installing Perl modules from CPAN

Perl.gif

There are several ways to get Perl modules from CPAN installed on your unix-based system. Keep in mind that there is always more than one way to do it with Perl, and this is no different. Before embarking upon any installation, it’s a good idea to download the module, unzip it and check out the documentation. In general, though, most modules are installed in the same method.

The simplest way to get Perl modules installed is to use the CPAN module itself. If you are the system administrator and want to install the module system-wide, you’ll need to switch to your root user.
Continue reading ‘Installing Perl modules from CPAN’ »

Make vulnerability auditing easy with portaudit on FreeBSD

freebsd.png

There are a number of things I like about FreeBSD, more than any Linux distribution I’ve ever used. Some of those are advantages shared by no Linux distribution I’ve used, and some are advantages shared by a few Linux distributions but not others — but no Linux distribution shares all of these advantages (even discounting things no Linux distribution has, like a BSD-licensed kernel).

Continue reading ‘Make vulnerability auditing easy with portaudit on FreeBSD’ »

Display FreeBSD System information

freebsd.png

FreeBSD comes with different utilities, which can be use to gathered the information as per your needs. uname command is use to print system information. dmesg command is use to print kernel ring buffer information. sysctl command is use to configure kernel parameters at runtime as well as to read hardware information.

Continue reading ‘Display FreeBSD System information’ »

Pages: 1 2 3 4 5 6 7 8 ...51 52 53 Next