Posts by abx21
Shell session logging
2pam_tty_audit.so
How come no one ever told me about this! A while ago we were tasked to find a way to log all commands executed by root. I know bash_history is easily manipulated so I spent some time on google trying to find a logging shell, then got distracted by something shiny and forgot all about this task. Turns out the linux auditing system has a built-in tty logging accounting module that will log all tty sessions! Just add this to your pam stack (/etc/pam.d/system-auth on redhat and clones):
session required pam_tty_audit.so disable=* enable=root
Then run a few commands as root, and the aureport command will become your friend:
audit]# aureport --tty -ts today
TTY Report =============================================== # date time event auid term sess comm data =============================================== 1. 11/22/2009 00:07:52 132278 1040 ? 4294962295 bash "hello world",<ret>
UPDATE:
You need a newer version of the audit rpm package, tty info will be collected but aureport does not know how to display them.
Android Envy
0I dunno, maybe its just due to the fact that I have had my first-get iPhone for 2 years, but I must admin that I am starting to wonder if its time to move to an Android based phone. I’ll admin that there wouldn’t be much resistance from my wife, after I signed the contract with AT&T I convinced her to switch carriers when her contract was up. She got a pretty decent Sony Ericsson flip phone and has had nothing but trouble in dealing with AT&T making changes to her account since I am listed as the primamry account holder. Also she was used to the great coverage her former carrier Verizon had in the area and is constantly frustrated by the constant call drops.
I was really excited by the idea of Google Voice, and since I have received my inivite I have been using it pretty regularly, including international long distance calls to family. I was really kind of bummed out when the google voice app got rejected. In fact I even jailbroke my phone to get the non google produced app.
Then I see phones like this and it makes it me start to wonder.
My First issue with FIOS
0Well, ok I am not 100% sure it has anything to do with FIOS specifically, but the timing sure is right. Ever since I converted my old Verizon phone service to FIOS, my uncle in Italy cannot call me. I think the call is routed all the way here to the US, but he hears the Verizon Lady telling him the number he has dialed is not in service. To top things off he still gets charged for the call. To Verizon’s credit they did raise this issue to their second level swithing support people who assured me that everytihng was fine on their end and this must be an issue with the Italian telco. If that is the case why are they getting the Verizon lady? This is a deal breaker for me, if I can’t get this to work I might have to take up Comcast’s offer to pay for my cancellation fee and go back to them with my tail between my legs.
How to thin provision an exsiting VMWare disk on ESXi without virtual center
10If you are like me then after you installed ESXi you went and created a ton of virtual hosts, then realized that you were short on disk space. In doing research on using NFS as a datastore, I read how by default images on NFS were thin provisioned. In a bit of a jealous moment, I wondered why I didn’t have that option. I learned that by using the RCLI appliance it is possible to convert. “Vmkfstools -i” is your friend. First you must shutdown your VM, in this case called “test-vm”. Then from the RCLI run the vmkfstools command as follows:
vmkfstools -i /vmfs/volumes/datastore1/test-vm/test-vm.vmdk /vmfs/volumes/datastore1/test-vm/testvm-thin.vmdk -d 'thin' -a lsilogic
The command prompt on the RCLI appliance will not return until the copy/conversion is done, but you can see the progress graphically in the tasks windows on your VI client. Once the copy is done, go into the settings of your VM, delete the hard disk, and add a new hard disk pointing to the “thin” vmdk you created. Boot your vm, if it all works then you can use the datastore browser to delete the thick vmdk and you are done.
Fios is available in Malden!
1Finally. Just for some background I got a letter asking me to preorder Verizon Fios services last July. I was told then then in about 6 weeks an installer would be coming out. Well, its is now 13 months later and its finally going to happen. The town I live in, Malden, Massachusetts granted Verizon a franchise licenses in April. I beleive one of the requirements was that Verizon offer services to everyone and not cherry-pick neighborhoods as had happened in other cities and towns around here. My install date is in a few weeks.
Now, a few words of warning, the first time I went to order online I selected all my packages, hit enter, got assigned an install date, then started getting “Sorry, we cannot complete this transaction” errors. I tried again the next day and I was able to place the order. Then I started reading forums and blogs about Fios, and realized that the price quoted during the online ordering was way to high. Apparently there are bundle prices available, so I called up Verizon and for $130ish I will get
Unlimited local/long distance – Call Waiting – Voicemail
20/5 Internet
Every Channel except the premium movie channels
1 Cable Card
1 HD/DVR (no charge on this for a year)
That is about what I pay now for just cableTV and internet, so I get phone server pretty much for free. I think I am going to call Comcast and give them a chance to give me a better deal, I love capitalism.
Linux commands I can’t live without: screen
0I don’t immagine that Screen needs a big introduction. For those that don’t know, screen is a window-manager. One might ask I use XTerm or Konsole or Terminal in gnome, what do I use this for??? Well one of the big features of screen is that you can detach you session from you current console, go to a different computer, and reconnect to the same screen session. You can start a command process at work, drive home, and reconnect to the still running window.
To start a new screen session just type “screen”. You will see a welcome screen, just start typing away as if you are in a regular terminal session. Need a new window? “CTRL-A c” will create one. “CTRL-A p” goes to your previous screen, “CTRL-A n” goes to your next screen. When you get to the last screen it just goest back to the first one.
So now you are ready to detach, “CTRL-d” detaches. When you want to reconnect, I usually do a “screen -dr”, the d will detach the screen session if I had forgotten to before exiting then connect.
One feature I use a lot, especially when working with network gear, is the screenloging. I connect to my router, type “CTRL-A H” to create a logfile, anything on the screen after that will get logged to the screenlog file. Then if I do a “show run” my router config is saved incase I mess things up.
One final usage of screen that I empoy is as a serial interface, I connect my routers via serial to my linux laptop, then fire up screen like this “screen 9600 /dev/ttyS0″ and voila. Buy a bunch of usb serial dongles and build your own Serial Console server this way. Turn on screenlogging and you can capture router error messages ghetto style.
How to Patch ESXi 3.5 Update 2
0At least this is how I did it…
Download the patch file here, then scp it over to your RCLI host. You have an RCLI instance somewhere right? If not there is an appliance you can download also from VMWare. Once the file is on the RCLI instance, you can use the vihostupdate command as follows:
vihostupdate --server ip_address_of_your_ESXi_host -i -b ESXe350-200807812-O-BG.zip
And enter your admin user and password at the prompt. You won’t notice to much going on from your VI Client screen. After the vihostupdate command is done, you will notice a little “reboot needed” message in your VI Client. I set the time and date back to the correct date, re-enabled NTP then shutdown my VM’s, and rebooted the ESXi host. It was back up withing 3 minutes, all in all a pretty simple process.
ESXi… EPIC FAIL!!!
0“This product has expired, Be sure that your host machine’s date and time are set correctly.”
Way to go, I had to set the clock back to last week on my ESXi console. There goes my VMWare consolidation proposal at work.
I wouldn’t want to be the poor developer that forgot to take out the “if date = august 12 2008 then fail” line of code.