2TB+ disk in linux

Today I was installing a system. I had a storage pool and carved out a 2.5TB disk as .qcow2 and did my centos6 install on that disk. After install when I looked to new os via virt-man I realized it did not see the drive at all. After some search I realized there is always […]

Read More

X-forwarding in Vagrant

I was trying to get x-forwarding work on vagrant for using mysql workbench on my dev vagrant box and was able to do that by adding following to my vagrant file Vagrant.configure(2) do |config| … config.ssh.forward_x11 = true end And after VM is up vagrant ssh — -X was all I had to do to […]

Read More

Fetch a remote file in a puppet resource

Puppet file source only accepts puppet:// or file:// URIs I was trying to get a file downloaded from our repo and was able to do this file{ ‘/usr/local/sbin/tape’: ensure => directory, owner => ‘root’, group => ‘root’, mode => ‘0755’, }-> exec{‘get_TS3500CLI’: command => “/usr/bin/wget -q ftp://ftp.software.ibm.com/storage/358x/3584/TS3500CLI/TS3500CLI.jar -O /usr/local/sbin/tape/TS3500CLI.jar”, creates => “/usr/local/sbin/tape/TS3500CLI.jar”, }-> In this […]

Read More

Adding new disk to lvm and extending filesystem

Our server had only 20GB of disk space. I had multiple partitions on LVM. We were running out of space on /var and /var/log partitions. After initial dump of existing logs usage was fine but it was going to go up soon again. I was planning to add more space to it and did this […]

Read More

Some frequently used SSL commands

Some frequently used SSL commands Generate a new private key and matching Certificate Signing Request (eg to send to a commercial CA) openssl req -out MYCSR.csr -pubkey -new -keyout MYKEY.key Generate a certificate siging request for an existing private key openssl req -out MYCSR.csr -key MYKEY.key -new Generate a certificate signing request based on an […]

Read More

Bash readarray

Today I learned a cool way to read lines from the standard input into the indexed array. On bash using readarray I was able to read input into a variable array. readarray myarray < list.txt   for i in "${myarray[@]}" do echo "$i" # or do whatever with individual element of the array donereadarray myarray […]

Read More

Test a port on a remote system without telnet

Recently I learned netcat can be useful tool to find out if a port is accessible on a remote system. nc remoteip port < /dev/null; echo $?nc remoteip port < /dev/null; echo $? This will return 0 if port is open and return 1 if port is closed

Read More

Oracle password with special characters

So recently I had to connect to a database via sqlplus where I did not have tnsnames.ora and password has a special character. Without tnsnames.ora your cli looks like Sqlplus emre/p@ssword@(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP) (HOST=myoracle.host)(PORT=1521))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=myoraservicename)))Sqlplus emre/p@ssword@(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP) (HOST=myoracle.host)(PORT=1521))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=myoraservicename))) Do you notice @ in my password that causes the issue on our case here. This will give you ERROR:ORA-01017: invalid […]

Read More

Log to remote syslog server in ubuntu

I needed to send my servers logs to a remote syslog server. Its an easy config change in ubuntu 12.04. Under /etc/rsyslog.d/ there is a configuration file called 50-default.conf. Simply edited line *.*;auth,authpriv.none -/var/log/syslog*.*;auth,authpriv.none -/var/log/syslog is the entry which logs to /var/log/syslog to *.*;auth,authpriv.none @remote.syslogserver.com:514*.*;auth,authpriv.none @remote.syslogserver.com:514 Then restart service sudo service rsyslog restartsudo service rsyslog […]

Read More

How to install TSM client on Ubuntu x86_64

Recently I had to setup our servers with TSM clients. Instructions here work for v6.r3 you can download client from ftp://ftp.software.ibm.com/storage/tivoli-storage-management/patches/client/ Currently IBM has rpm and I used alien to convert those to deb. After you download and extract tar archive from IBM (link above) If you do not have alien on your system simply […]

Read More