8 Jan 2010

Linux Shtuff Posts

Author: admin | Filed under: General Info

Hi,

When I started this blog, I started it for my own benefit so I could remember those little tweaks or fixes which escape memory at crucial times when a needed repair or a new issue arose that I had never dealt with before. When I would research these issues, I would come across great posts and information I wanted to remember and posted that information here. I did not give credit where credit was due regarding those posts and if you find something that was posted by you, please let me know and I will credit the post to you. I cannot remember where I pulled all of the information from so, if you see something that is yours, do not fret, I am not stealing your shtuff, I am posting it so all can read and learn from the mistakes and information I have gathered. Most of the posts are mine, but not all. Thank you all for your patience and information you have shared to better improve the linux experience.

Oh and by the way, if you see a post that has outdated or incorrect information, please, please, pretty please let me know so I can update it. Believe it or not, I use this site also and I want my information to be up to date as well. Thanks again for visiting.

Comments Off
15 Mar 2012

File Password Protection

Author: admin | Filed under: General Info

How do I password protect / encrypt a file within Linux using OpenSSL ?

The file we will encrypt will be the file secretfile.txt.As you can see it is just a plain text file.

Encrypt File

Use the openssl comand to encrypt your file and then test the new file is fully encrypted.

$ openssl aes-256-cbc -salt -in secretfile.txt -out secretfile.txt.aes
enter aes-256-cbc encryption password:
Verifying – enter aes-256-cbc encryption password:

$ cat secretfile.txt.aes
binary data

Decrypt File

Decrypt the file and then confirm the decypted file is readable.

$ openssl aes-256-cbc -d -salt -in secretfile.txt.aes -out secretfile.txt
enter aes-256-cbc decryption password:

$ cat secretfile.txt
This is a secret file that we do not want anyone to read.

====================================== Read the rest of this entry »

Comments Off
12 Mar 2012

RetroShare

Author: admin | Filed under: General Info

From sourceforge.net

RetroShare is a Open Source cross-platform, private and secure decentralised communication platform. It lets you to securely chat and share files with your friends and family, using a web-of-trust to authenticate peers and OpenSSL to encrypt all communication.

Features

  • Serverless, encrypted Chat & Filetransfer
  • Multiple simultaneous downloads / uploads
  • Search Friends
  • Messages
  • Forums
  • UPnP / NAT-PMP port forwarding support
  • GnuPG Authentication
  • OpenSSL Encryption
  • Plugins support
  • Graphical User Interface written with Qt4 toolkit
  • System tray integration
  • RetroShare provides:

  • Reliable Identification and Authentication of your friends.
  • Plus an Introduction Scheme which connects you to the friends of your friends, and facilitates network growth.
  • Encrypted Communication, ensuring all shared information is known only to you and your peers.
  • A Communication Platform which can potentially support services such as Secure Email, File Sharing, Streaming, Video or Voice over IP, Photos, Wall and Messaging
  • A Decentralised Social Sharing Network designed **For the People** with no dependancies on any corporate system or central servers.
  • Comments Off
    12 Mar 2012

    sl

    Author: admin | Filed under: General Info

    From practicalthought.com

    sl takes the most common use of Unix ls, to display the files in a directory compactly in multiple columns, and makes it substantially more useful.

    sl groups files by purpose so you can mentally organize many files quickly; for instance, it collects HTML and PHP files together, as opposed to leaving them mixed up with supporting images, CSS, and JavaScript. sl points out interesting files, which include those that have been recently modified, read relatively recently, are relatively large, have warnings, or need to be checked in to or out of version control.

    sl is also aesthetically pleasing due to attention to layout and filtering as well as limiting color and text annotations to salient information.

    Download Script sl

    From practicalthought.com

    Comments Off
    16 Feb 2012

    Malware site scanner

    Author: admin | Filed under: General Info

    Hi,

    I don’t usually recommend a lot of web based tools but I had to mention this one, sitecheck.sucuri.net. This quick little web based malware/site scanner just saved me about 2 weeks worth of work by locating a segment of .js that was causing a malware warning to be thrown only in certain browsers and anti-virus scanners.

    Because the .js was new and buried about 9 layers deep in a wordpress plugin, it would have been nearlly impossible to locate by hand. This tool pulled it up in about 30 seconds. Well done sir web scanner…

    sitecheck.sucuri.net

    Comments Off
    13 Feb 2012

    CSF/LFD install guide for Plesk

    Author: admin | Filed under: General Info

    From diademblogs.com

    Config Server Firewall (csf) and Login Failure Daemon (lfd) is a robust firewall solution having Stateful Packet Inspection (SPI), Login/Intrusion Detection and Security application for Linux servers. Although it is more compatible with CPanel we have been able to use the same for the Plesk hosting control panel also and it is running fine. Please visit the below link for more information.
    From http://www.configserver.com

    I have listed the installation steps for CSF / LFD.Login to your server with ‘root’ user and issue below commands :
    Change directory to either /root or /usr/local/src , which ever you normally use for such installations

     cd /usr/local/src

    [Remove any old source that might be present]

    Download and untar the source for installation

     wget http://www.configserver.com/free/csf.tgz<br />
     tar -xzf csf.tgz

    Run installation script

     cd csf<br />
     sh install.sh

    Read the rest of this entry »

    Comments Off
    24 Jan 2012

    clearing the arp cache in linux

    Author: admin | Filed under: General Info

    You can clear the arp cache using following commands

    Current arp cache

    root@server [~]# arp -n<br />
    Address      HWtype  HWaddress           Flags Mask  Iface<br />
    70.167.140.1 ether   00:00:0C:9F:F0:04   C           eth0<br />

    Clearing arp cache with verbose

    root@server [~]# ip -s -s neigh flush all<br />
    70.167.140.1 dev eth0 lladdr 00:00:0c:9f:f0:04 ref 42 used 17/0/65 REACHABLE

    *** Round 1, deleting 1 entries ***
    70.167.140.1 dev eth0 ref 42 used 0/0/0 INCOMPLETE

    *** Round 2, deleting 1 entries ***
    *** Flush is complete after 2 rounds ***

    current entries

    root@server [~]# arp -n<br />
    Address      HWtype  HWaddress           Flags Mask  Iface<br />
    69.167.140.1 ether   00:00:0C:9F:F0:04   C           eth0<br />

    You can also delete specific arp entries using the two following command

    root@server [~]# arp -d 192.168.1.1<br />
    root@server [~]# arp -d 192.168.1.2<br />

    <br />
    Add a static arp entry<br />
    root@server [~]# arp -s 192.168.1.10 00:00:93:12:04:57

    tested on CentOS release 5.7 (Final)

    Comments Off
    16 Jan 2012

    Villustrator

    Author: admin | Filed under: General Info

    From bilalquadri.com

    Here is a nice little addition to vi or vim. You can create a custom theme for vi/vim and download it to use locally. Nice!

    From their FAQ:

    Where do I put the colorscheme I just downloaded?
    The colorscheme should be put in “~/.vim/colors”. If those directories don’t already exist, you will need to create them.

    I’m using Vim in the terminal. How can I use my colorscheme outside of gvim?
    There are few things to note here:
    • Make sure you tell Vim how many colors your terminal supports. Just add this line to your .vimrc file in your home directory:
    let &t_Co=256

    Use 88 instead of 256 if that’s what your terminal supports.
    • Download and unzip this plugin into the ~/.vim directory. After that, you should be set.

    How do I change my colorscheme?
    Just type “:colorscheme ” in Vim without the quotes. Tochange the default colorscheme, just add that line to your .vimrc file in your home directory.

    From bilalquadri.com

    Comments Off
    10 Jan 2012

    Reset visual and editor to use Vim

    Author: admin | Filed under: General Info

    Hi,

    I ran across a small issue where the client wanted to use vim as the default editor for crontab as opposed to pico. I was able to modify this by using the following commands;

    EDITOR=vim;
    export EDITOR
    VISUAL=vim;
    export VISUAL=vim

    and done…

    Now, when editing crontab, it uses vim. Simple.

    Comments Off
    3 Jan 2012

    Install Mongodb

    Author: admin | Filed under: General Info

    From mongodb.org
    From if-not-true-then-false.com
    From php.net

    To install mongodb, add the appropriate repo information below for your distribution version (x86_64 or i686) to /etc/yum.repos.d/10gen.repo:

    vim /etc/yum.repos.d/10gen.repo

    add

    <br />
    [10gen]<br />
    name=10gen Repository<br />
    baseurl=http://downloads-distro.mongodb.org/repo/redhat/os/x86_64<br />
    gpgcheck=0

    or

    [10gen]
    name=10gen Repository
    baseurl=http://downloads-distro.mongodb.org/repo/redhat/os/i686
    gpgcheck=0

    then run

    yum update && yum install mongo-10gen mongo-10gen-server

    Check the basic mongodb configuration settings before starting MongoDB (default settings are usually good)

    <br />
    vim /etc/mongod.conf

    logpath=/var/log/mongo/mongod.log
    port=27017
    dbpath=/var/lib/mongo

    Read the rest of this entry »

    Comments Off
    20 Dec 2011

    Edit cPanel nameserver IP’s

    Author: admin | Filed under: General Info

    As of WHM 11.30, the nameservers’ IP assignments are now read from the Zonefiles and actual DNS queries after recent updates. If you are not seeing the needed IPs in /etc/nameserverips please do not attempt to edit that file, as it is now overwritten by cPanel.

    Check under WHM: Main >> DNS Functions >> Nameserver IPs for current nameserverips

    (Solutions may depend on the cPanel version)

    Problem
    The updated A entries and/or NS entries are not retained:
    Solution(s)
    Add the needed nameservers to the /etc/hosts file

    vim /etc/hosts

    Add (append) a new line, one per IP, onto the existing hosts file such as:

    123.456.789.012     ns1.domain.com

    OR

    123.456.789.012     ns1.domain.com ns2.domain.com

    Then run the updatenameserverips script:

    /scripts/updatenameserverips

    Check under WHM: Main >> DNS Functions >> Nameserver IPs again to see if it worked, if not continue

    Delete the nameserverips.cache file

    rm  /var/cpanel/nameserverips.cache

    Then modify /var/cpanel/nameserverips.yaml to suite

    vim /var/cpanel/nameserverips.yaml

    Then run the updatenameserverips script again