Friday, May 18, 2018

Turn a list into a CSV file

Hello today I'm showing you two simple ways to turn a list that is in a column into a comma separated list that is on one line. You can do this one of two ways, with a BASH for loop or with SED.

We are going to use list.txt which is a small list of solar objects for this example. 


for s in $(cat list.txt)
do echo -en "$s, "
-note - if you don't want spaces or commas use "$s" instead

man@earth> ./BASHscript
earth, moon, mars, venus, saturn,

cat list.txt |  sed ':a;N;$!ba;s/\n/, /g'

As you can see the SED statement is much shorter.

man@earth> ./SEDscript
earth, moon, mars, venus, saturn,

I hope someone out there finds this useful. If you have any questions or comments please post them below.

Monday, March 26, 2018

Free Books

We all love free stuff, right? So in this post I list some sites that I found that offer free books. It is also important to protect the rights of content creators, so I'm only listing free books that are totally legal to download. If you know of any sites that offer free books please provide a link in the comments below.

Free Novels
Free Books from publisher BAEN
Lots of totally free books books on the BAEN website from may different publishers and genre types.

Free public domain audio books. These books are several different languages. Librivox is a non-commercial, non-profit and ad-free project. They get most of their texts from Project Gutenberg, and the Internet Archive hosts their audio files (for free!).

Project Gutenberg
This a site that hosts free ebooks in many in the public domain. They also have ebooks in several different languages

Verkaro Audiobooks
This site has many free audio books. they used to be called The books span many different genre.

This site has over 33,000 eBooks to choose from. These books are in many different genres.

Internet Archive
This site is a non-profit library of millions of free books, movies, software, music, websites, and more.

"BookBub features limited-time offers for the best free books in over twenty genres, from both top-tier publishers and critically-acclaimed independent authors. These free ebooks are available on all devices, including Kindle, Nook, iPad, and Android. Check out some of our current selections" -

Believe it or not, Google has a lot of free books on there site. Though some of the books are just excerpts of books for sale.

Free IT text books
DevOps books
This is a absolutely free collection of free It professionals or people who want to get into IT.

Free PDF Books
Free technical books and  lectures in PDF form.

Safari Books Online
Safari books online is the place to get Oreilly IT books. It is not exactly free, but you can get a free trail.

I hope this info will hope some get some free and legal books. Don't forget there is also the public library. Please fee free to post any additional info on free and legal books below in the comments.

Tuesday, March 13, 2018

Free Dev Ops Tech Books

Below is a link for some free to some free IT books. Just go to the link and pick the book or books you want and down load the PDF. Feel free to share and read.

Free Dev Ops Books

Thursday, December 28, 2017

Free Cryptocurrency Payed Directly to your Wallet

There are many sites that offer free cryptocurrency. These sites are called faucets they give tiny amounts of cryptocurrency in exchange for showing you adds. Many of these faucets make you come back repeatedly before you can withdraw the funds to your cryptocurrency wallet. I have found some faucets that payout immediately and/or directly to your wallet, no more waiting.

So far I have only found the one faucet for Bytecoin and a few related faucets for the Waves coin. Using these websites will not make you rich, but free money is free money and the ads on the sites are not excessive. One interesting thing about the Waves coin is that it is a Proof of Stake (PoS) coin, meaning that holding the waves coin in the Waves wallet will earn you more Waves coin.

Faucets rules
All of the the Faucets listed below will allow you to withdraw once per hour. All but one of the faucets below track you using your IP address. In order to withdraw more then that you will need more then one external IP address. The WavesGo faucet tracks you via the waves wallet address, so for example if you have 2 Waves wallet address then you can withdraw 2 times an hour.

Bytecoin (BCN)

The Bytecoin faucet is managed by the developers and maintainers of Bytecoin.

This faucet can be used once an hour per IP address. They have recently switched to a manually payout system so you will not get the BCN instantly. You will however get the payout in a timely manner.

The Waves faucets are managed by the Waves stacking or mining pools. This is to promote the Waves coin and to encourage Proof of Stake (PoS) mining of the Waves coin.

This is the best and most reliable Waves faucet. You will get some Waves coins as well as some WavesGo (WGO) tokens. This faucet can be used once hour, per wallet address.  Will work though a VPN.

You will get some Waves coins and the option to get some random tokens. This faucet can be used every hour per IP address.

You will get some Waves coins and the option to get some random tokens. This faucet can be used every hour per IP address.

You will get some Waves coins and the option to get some random tokens, usually Mercury (MER) tokens. This faucet can be used every hour per IP address.

If you want to withdraw BCN or Waves from the faucets you will need a wallet.

Go to the Bytecoin website for a list of Bytecoin (BCN) wallets.

Waves Lite wallet
The Waves Lite wallet can also can also be used to hold Bitcoin, Ethureum,  Litcoin, and Zcash. The wallet also has a builtin exchange called DAX. The DAX exchange can be used to sell the tokens you get. The wallet is also needed to do Proof of Stake pool mining.

Many exchanges will not except small payments to there exchange wallets. Bittrex will not except the tokens or the Waves coin from the faucets as the payment amount is to small. The HitBTC exchange will except the BCN and Waves faucet payouts, but the free tokens from the Waves faucet be lost.

Current Bytecoin (BCN) and Waves prices

Sometimes the faucets will stop working or are under maintenance, so if it is not working check back later. I hope this was helpful. If you have any questions or comments please post them below. If you know of any faucets that payout to your wallet, and not to a site like CoinPot or Faucet Hub, please let me know.

My Waves wallet address 

My BCN wallet address

Tuesday, April 4, 2017

Manually Update Plugins on a Nessus Scanner (Windows)

I had an issue the other day with one of my Nessus Vulnerability Scanners which is being managed by Security Center. In Security Center the status of one of the Nessus scanners showed "Plugin Out of Sync". I tried to push the plugins to the Nessus scanner from the Security Center, but I was getting a status error of "Connection timed out".  So basically I was getting a latency issue on the connection. The Nessus scanner and the Security Center are in different states, so this may be why there is so much latency. I just built this Nessus scanner, so there were just too many plugins to be pushed over the wire by Security Center. To fix this issue, I just manually copied the plugins to the Nessus scanner. Then I manually loaded the plugins into the Nessus scanner. After I did this, I have not had this issue again.

Manually updating the Plugins can sometimes fix error or scanner status of "Protocol error". These instructions work on Nessus 5x and 6x, when managed by Security Center 4x or 5x.

Follow the instructions below to manually install plugins for the Nessus scanner on a Windows computer. For Linux computers click here.

1. Login to the Nessus scanner.

2. Open PowerShell or the Windows command line (CMD) as privileged user.

3. Stop the Nessus service
# net stop "Tenable Nessus"

4. Remove the Nessus scanner from Security Center

5. Reset the scanner
# …\Program Files\Tenable\Nessus>nessuscli fetch fix --reset

6. Connect the Nessus scanner
# …\Program Files\Tenable\Nessus>nessuscli fetch –security-center

7. Load the plugins into Nessus
# …\Program Files\Tenable\Nessus>nessuscli update plugins_file.tar.qz

8. Start the Nessus scanner
# net start “Tenable Nessus”

9. Login to the web interface for Nessus and verify that the configuration is complete.

10. Login to the web interface for the Security Center. Add the Nessus scanner back and verify connectivity.

Your done.

Related posts
On this Blog

Monday, March 20, 2017

Turn off BEEP in BASH

Sometimes your on a computer that has speakers and if your on the termial it keeps beeping. This can be annoying if all your doing is using the tab key to use auto complete. Who ever thought that making the terminal beep was a good idea? Anyway below are some ways to get ride of the beeps.

In /etc/inputrc file add the line below.
set bell-style none

Put the line below in a profile. If you want to set it globally but in /etc/profile, otherwise set it in bash_profile, .bashrc, and/or .profile.
setterm -blength 0

This will make the beeping sound go away for good. If you have any questions or comments please post them below.

Wednesday, March 15, 2017

How to clear Nessus Plugin 42873 on Security Center

I use Security Center with Nessus scanners from Tenable to do vulnerability scanning on my servers. Sometimes the scanner finds hits on itself, such as a hit on plugin 42873 "SSL Medium Strength Cipher Suites Supported" on the Security Center. Below I show the steps needed to disable 3DES on Security Center..

To disable 3DES within Security Center do the following:
1. Open the file /opt/sc/support/conf/sslciphers.conf

2. Search for DES-CBC3-SHA

3. After the colon that precedes the above string, add an exclamation mark which is the signal to disable the given cipher.

4. The whole string should look like :!DES-CBC3-SHA:

Once complete, restart the SC service and complete a rescan and this vulnerability should be remediation.

To clear the other part of this hit, make sure the server is using SSL ciphers have encryption key length of over 112 bits. 

Reference Plugin 42873

Monday, February 20, 2017

Rename & Combine Audio Book files into one audio book.

I like to listen to audio books and I get them them from places such as Audible, books on CD, the library or LibriVox. The issue is that all these places present the files to you in different ways. You can get one big file or a lot of small files. They all use different naming conventions which can make organizing your books difficult. To play my audio books I use the iBooks app from Apple and the Audible app form Audible, on my iPod Touch. Apples iBooks app works well but is missing some features that the Audible app has such as the bookmarking feature. The Audible app is really bad at playing books that are broken up into several files. The app will play the files out of order or show each file as a separate book.

So to fix the issues described above I recommend that you rename and/or combine all the files from one book into one file. Below I show the BASH script I wrote to fix this issue. I wrote and tested this script on a Mac. This script will also work on Linux and UNIX operating systems. After the files are combined the finder didn't show the right length for the audio book but when I imported the file into iTunes everything displayed right and the file worked fine.

The script below shows how to combine several MP3 files into one file. I put a comment after each command explaining what it is doing. If you have any questions about the script below ask it in the the comment section below.

Put contents of files here
# This script was created on 20170216
# This script was created to combine MP3 files form audio books into one file.
# usage ./script-book bookname
if [ -z "$1" ]
    echo -e "Please rerun the script with desired file name at the end \n 
              Example: ./script-book bookname"
    exit 1
# The if statement checks for $1 variable. 
# If no variable is present then the gives error message and exits 

for s in $(ls |grep .mp3|egrep -v '(png|jpg)'|awk '{print $NF}')
# egrep removes pictures
# $NF gives the last column in the file name. This removes the spaces in the name.
do mv *$s $1$s
# This renames the files
cat *$s >> $1.mp3
# Cat combines the files
rm *$s
# Removes old files
ls -lh

In order to make the script work, copy it into the same directory the audio books files are located in. In the example below the script is called script-book and the ls command shows the script in the same directory as the audio book files.

man@earth> ls
The Hot Gate 001.mp3    The Hot Gate 021.mp3    The Hot Gate 041.mp3
The Hot Gate 002.mp3    The Hot Gate 022.mp3    The Hot Gate 042.mp3
The Hot Gate 003.mp3    The Hot Gate 023.mp3    The Hot Gate 043.mp3
The Hot Gate 004.mp3    The Hot Gate 024.mp3    The Hot Gate 044.mp3
The Hot Gate 005.mp3    The Hot Gate 025.mp3    The Hot Gate 045.mp3
The Hot Gate 006.mp3    The Hot Gate 026.mp3    The Hot Gate 046.mp3
The Hot Gate 007.mp3    The Hot Gate 027.mp3    The Hot Gate 047.mp3
The Hot Gate 008.mp3    The Hot Gate 028.mp3    The Hot Gate 048.mp3
The Hot Gate 009.mp3    The Hot Gate 029.mp3    The Hot Gate 049.mp3
The Hot Gate 010.mp3    The Hot Gate 030.mp3    The Hot Gate 050.mp3
The Hot Gate 011.mp3    The Hot Gate 031.mp3    The Hot Gate 051.mp3
The Hot Gate 012.mp3    The Hot Gate 032.mp3    The Hot Gate 052.mp3
The Hot Gate 013.mp3    The Hot Gate 033.mp3    The Hot Gate 053.mp3
The Hot Gate 014.mp3    The Hot Gate 034.mp3    The Hot Gate 054.mp3
The Hot Gate 015.mp3    The Hot Gate 035.mp3    The Hot Gate 055.mp3
The Hot Gate 016.mp3    The Hot Gate 036.mp3    The Hot Gate 056.mp3
The Hot Gate 017.mp3    The Hot Gate 037.mp3    The Hot Gate 057.mp3
The Hot Gate 018.mp3    The Hot Gate 038.mp3    The Hot Gate 058.mp3
The Hot Gate 019.mp3    The Hot Gate 039.mp3    The Hot Gate 059.mp3
The Hot Gate 020.mp3    The Hot Gate 040.mp3    script-book

Note- Make sure the script is executable before you run the command as shown below. Alternately you can also run the script by bash before the command if you don't know how to make the script executable. Example: bash ./script-book bookname

In the example below the I show how to execute the script and show example output. This shows that the script combined the files listed above and named the file TheHotGate and removed all the old unneeded files.

man@earth> ./script-book TheHotGate
total 447744
-rw-r--r--  1  arich   staff    219M  Feb 20 11:34    TheHotGate.mp3
-rw-r--r--  1  arich   staff    624B   Feb 20 11:33    script-book

I hope this helps anyone who is having a similar issue.

Links to places to get audio books.



Thursday, December 1, 2016

How to Reset a Nessus Scanner

The other day I installed a new Nessus Vulnerability Scanner which is a security scanner that is often controlled Security Center, both of which are Tenable products. After I finished the install and configured the Nessus scanner to be managed by Security Center.  I tried to log back into the scanner and discovered I was locked out. So I figured I could just reinstall the Nessus scanner, after all it only take a few minutes to do. I reinstalled Nessus and I was still locked out, what gives. Below are the steps used to get back into the scanner. I later found an even easier way to get back into the Nessus scanner, which I also posted below.

Follow the steps below to uninstall the Nessus scanner and remove the configuration files.

1. Optional - Stop the nessusd service
root@earth> service nessusd stop

2. To uninstall Nessus remove the Nessus package
root@earth> rpm -e nessus-package

For some reason /opt/nessus still exists after the Nessus package is removed

3. Remove the Nessus directory.
root@earth> rm -r /opt/nessus

Note- Don't worry the Nessus the files will be recreated after the reinstall.

Note- If the /opt/nessus directory is not removed, then your account will still be locked. This is because the configuration files will still exist.

4. Now install Nessus
root@earth> rpm -ivh nessus.rpm

5. Go to the Web interface to finish the configuration of the scanner

Installing Nessus and setting it up to be managed by Security Center takes very little time, but you

Create a new user and/or set the user password.

Add user to scanner
root@earth> /opt/nessus/sbin/nessuscli  adduser  newuser

Change password on the nessus scanner
root@earth> /opt/nessus/sbin/nessuscli  chpasswd username

I showed you in a previous post "Reset Admin account on Security Center" how to do this for Security Center.

Related posts on this site:
Reset Admin account on Security Center
Manually Update Plugins for your PVS
Manually Update Plugins on a Nessus Scanner

Thursday, September 22, 2016

Create user account and set password with one command

I often see forum posts where a System Administrators, wants to create local user accounts on several servers and doesn't want to have to have to set the user's password over and over again. Below I share two ways to do this. The first way creates the user account and sets the password in one command. The second method sets the password in a additional command. Ether way can be used in a script, which can speed things up if you need to create one or more accout on servel systems.

Below is an example of creating a user account.
root@earth> useradd -u 25 -g staff -G ftp,users -m -d /export/home/newuser -c "newuser" -s /bin/bash newuser
root@earth> passwd newuser
passwd: Changing password for username
New Password:
Re-enter new Password:
passwd: password successfully changed for newuser

This method can be very time consuming process and would be hard to use in script. Below is an example of how using the -p option in the useradd command, to set the user's password by setting the uses hash.

root@earth> useradd -u 25 -g staff -G ftp,users -m -d /export/home/newuser -c "newuser" -s /bin/bash -p '6$jbvkjjg$qFmFH.bQmmtXzyBY0s9v7Oicd2z4XSIecDzlB5KiA2/jctKu9YterLp8wwnSq.qc.eoxqOmSuNp2xS0ktL3nh/' newuser

This method works on Linux computers, such as SLES and RHEL. It however doesn't work on systems such as Solaris.

Alternately you can also set the users by echoing the password to standard in, as shown below. The major issue with doing it this way is that the password is recorded in the system logs and if your running the command remotely then your sending the password in the clear. So I don't recomend doing it this way.
root@earth> echo password | passwd newuser --stdin

This method works only Linux systems.

Other posts with similar info
Linux User Account Creation & Customization
Adding a new user to a UNIX based system

References pages.
Online man page - useradd
Online man page - passwd

Thursday, September 15, 2016

Setting up NFS & automount on RHEL

I believe that any Linux or UNIX server should start a very minimal build. Meaning that a server should only have the programs or packages installed that are needed for the operation of the server. To make some of my servers a little more functional I decided to install NFS and automount. This is so users can automount home directories and  mount external shares.

Follow the steps below to install NFS and autofs, so you can mount the NFS shares and mount home directories. The example below is on a RHEL 6 server.

To be able to mount NFS share you will need the following packages.


Install the packages
root@server> yum install autofs  nfs-utils  nfs-utils-lib

To enable NFS shares you must add them to the /etc/fstab file. Example below. /export/share  nfs noauto,nosuid,nodev,noguid,noxattr,timeout,sloppy 0 0  /export/cifs  nfs noauto,nosuid,nodev,noguid,noxattr,timeout,sloppy 0 0
repos:/linux_repos /export/repos   nfs auto,ro,nosuid,nodev,noguid,noxattr,timeout,sloppy 0 0

To setup the automount funtion you need to edit the auto.home and auto.master files.
 Add the hostname or IP address line to /etc/auto.home

Add this line to /etc/auto.master
/export/home /etc/auto.home -nolock,nosuid,noguid,nodev,nobrowse,noxattr --timeout 10

Restart services
root@server> service autofs restart
root@server> service rpcbind start
root@server> service nfs start

Ensure that autofs starts at boot
root@server> chkconfig –list autofs

Make mount points
Make the mount pint for all the mount points listed in the /etc/fstab file..
root@server> mkdir /export/share
root@server> mkdir /export/cifs
root@server> mkdir /export/repos

Note- make sure any host names used are added to the /etc/hosts file.

After following the steps above evey should be working. test the configuration by loggingin or becoming a user with a non local home directory. Also try to mount the shares.
root@server> mount /export/share

Check to see if the mount was successful.
root@server> df -h | grep share
Filesystem            Size  Used Avail Use% Mounted on  9.8G  1.9G  7.5G  20%   /export/share

Please let me know if you have any questions.