The every day things from Thalamus' life.

Thalamus' Blog

31 August, 2010

remount root filesystem – read/writable

Filed under: ComputerStuff_en — Thalamus @ 10:52

Had a problem today at work … a server didn’t have the necessary ‘_netdev’ entry in /etc/fstab after a reboot. It rendered me in desperate need for editing the /etc/fstab – but, I was not able … since it had become ‘ro’. So, after a telephone to your ‘guru’ – he logged on to the server by ILO and was able to remount the root filesystem by issuing

# mount -n -o remount,rw /

I knew what needed to be done – but, did I remember HOW to do it ? Making myself a note of it … for the future ! 🙂

Update: Found that RedHat advice is the following.

# mount /proc
# mount -o remount,rw /

To me it seems like RedHat forgot to supply ‘-n’ in their tip. However, examining the mount options I wonder why … the default option for ‘/’ ain’t

errors=remount-ro

… instead of ‘defaults’ ?

Definitely something I should have a closer look at …

• • •
 

14 August, 2010

Netcat on steroids – aka Socat, and clean out flash cookies.

Filed under: ComputerStuff_en — Thalamus @ 14:30

While browsing the web today – I came upon a utility I haven’t explored before. Socat. This utility can do all the ‘netcat’ stuff, but so much more. From the description of the socat utility.“Socat is a command line based utility that establishes two bidirectional byte streams and transfers data between them. Because the streams can be constructed from a large set of different types of data sinks and sources (see address types), and because lots of address options may be applied to the streams, socat can be used for many different purposes. “

Socat homepage.

Firefox and other browsers – can if you want them to. Clean up your tracking cookies and alike simply by adjusting the settings in the browser. But, did you know that this is not really always enough ? If they run some kind of flash on their pages – and … you have flash enabled. Well – they might use the flash cache storage for cookie related information. So, I wiped my cache with this command

rm -rf $HOME/.macromedia/Flash_Player/#SharedObjects/

Problably going to make a small cron script that eradicates that automatically.

• • •
 

2 August, 2010

tcpdump – syn packets

Filed under: ComputerStuff_en — Thalamus @ 10:04

Had an application that didn’t do much at work today. Googled and came to this link, telling me how to track only tcp syn packets.

I modified it a bit …

# tcpdump -ne dst port 80 and 'tcp[13] & 2 == 2'tcpdump and host [destination ip address]

We definately found a culprit – a java application that kept connecting without doing anything useful.

• • •
 

1 August, 2010

Perl one liner

Filed under: ComputerStuff_en — Thalamus @ 01:45

I haven’t used perl one line fixes much before. So, I struggled a bit when I decided to fix several web pages in one sweep. The html files looked like this ….

<html>
<body>
<address>
some@email.com
</address>
</body>
</html>

– where the goal was to delete the text between the address tags – including the email address. I even had to post this question to the perlmongers asking for help. Their suggestion worked right of the bat – but, they also pointed me in the direction of what I did wrong. So. this is their alternative solution.

perl -i.bak -ne 'print unless /[emailaddr] / ..m![emailaddr]' *.html

This will work – in my example. But, not if there are several hits for this pattern.

My final solution became.

 perl -i.bak -0777 -ne '(s![emailaddr]\s*(\w[-._\w]*\w@\w[-._\w]*\w.\w{2,3}\s*[emailaddr])!!mgi); print' *.html
• • •