A Technical Blog

  • Change SoftHSM SO / USER Pin

    we’ll explore how to change these pins using the pkcs11-tool utility, assuming that you already know the existing pin. Why Change User and SO Pins? Changing your User and SO pins is an essential practice to ensure the security of your cryptographic storage. It helps safeguard your sensitive data and maintain the integrity of your…

  • How to Reindex for Better Results – MAC OS X spotlight search

    Spotlight search is a powerful tool on macOS, helping you quickly find files, applications, and information on your computer. However, there are times when you might encounter issues where it doesn’t return the right results. When this happens, reindexing your system can be the solution to improve the accuracy of your searches. I Step 1:…

  • Encrypt secondary disk – Linux

    To set up cryptographic volumes, you need to back up the data first and restore data after the encryption is setup. rsync -Pav <source/> <backup_destination/> Once the backup is completed, install cryptsetupsudo apt install cryptsetup Create the encrypted partitionsudo cryptsetup –verbose –verify-passphrase luksFormat <device_name>Provide passphrase once prompted, you could use fdisk -l to find the…

  • #git switch to branch without merge on local repo

    To switch from master to a branch or branch to another without merge. git branch*master $ git fetch origin <new_branch> $ git checkoutBranch legacy set up to track remote branch legacy from origin.Switched to a new branch ‘new_branch’ $ git pull $ git branch* new_branchmaster

  • git # move directory or file

    Move or rename a file, a directory, or a symlink # clone the repogit clone <repo-url>git mv <source_file_or_directory> <destination>git status # will show the change detailsgit commit -am “comment_for_the_change”git push # push changes to repo

  • DNSSEC with BIND 9.10 and native PKCS#11

    DNSSEC with BIND and native PKCS#11 support (BIND & SoftHSM) Bind 9.10.0-P1 supports the native PKCS#11 mode, instead of the openssl based PKCS#11. You can either compile it with (./configure –enable-native-pkcs11 \ –with-pkcs11=provider-library-path) or install prebuilt packages. Upon writing this blog, Fedora 23, has built-in bind-9.10.3-7.P2 and SoftHSM (Software based HSM) SoftHSM is an implementation…

  • Monitor VMware ESXi hardware without root (Nagios)

    Download and configure the plugin: https://exchange.nagios.org/directory/Plugins/Operating-Systems/*-Virtual-Environments/VMWare/check_esxi_hardware-2Epy/ – Create a new user in ESXi with no access privilege, you need to login to the ESXi directly to do that. – Enable SSH, and add nagios user to root group: # vi /etc/group root:x:0:root,nagios – Check from the command line, if it works ./check_esxi_hardware.py –host https://esxihost:5989 –user…

  • Setup GeoIP (PECL) for piwik geolocation and updating old visits

    GeoIP is the recommended way to accurately determine the location of the visitor, by default geolocation settings may provide in accurate result. To enable GeoIP(PECL) from redhat/centos machines: # yum install php-pecl-geoip #apachectl restart # php -m | grep -i geo geoip From Piwik, Settings –> Geolocation –> GeoIP (PECL) To reindex the old visits:…

  • download rtmp videos

    To download RTMP (http://en.wikipedia.org/wiki/Real_Time_Messaging_Protocol) videos, # apt-get install rtmpdump $ rtmpdump -r < rtmp://url/ > -o < output_file.mp4 > eg: $ rtmpdump -r rtmp://foobar.com/mp4:videos/123/foo.mp4″ -o foo.mp4

  • Send attachments from command line with mutt

    To send e-mails from command line with attachments using mutt. Set the from address with EMAIL= -s – Subject -a – attachment file recipient name -c – for CC -b – for BCC create a text file (eg: /tmp/testmessage) , with the body of the message. EMAIL=”foo@bar” mutt -s “Subject” -a test.doc foo1@bar -c foo2@bar…

  • Could not connect to vmware console https://vcenter_address:7331/

    This usually happens from the vSphere web client while opening a console session with virtual machine. and the log (/var/log/vmware/vsphere-client/logs/vsphere_client_virgo.log) shows something like: [ERROR] Thread-42 System.err INFO:oejsh.ContextHandler:started o.e.j.w.WebApp Context{/console,file:/tmp/jetty-0.0.0.0-7331-console.war-_console-any-/webapp/},/usr/lib/vmware-vsphere-client/server/work/tmp/console-distro/webapps/console.war To fix this set the environment variable VMWARE_JAVA_HOME to proper path: – SSH to vcenter # vi /usr/lib/vmware-vsphere-client/server/wrapper/conf/wrapper.conf – Under Environment variables add: set.default.VMWARE_JAVA_HOME=/usr/java/jre-vmware – Restart…

  • Create bootable USB on OSX

    – Identify the disk number for the USB disk inserted, usually you can find it from the “Name” and “Size” field. Below eg: , We inserted a USB with 4.1 GB size (so as the identified: “disk2”.) Open terminal and execute the following commands: sh-3.2$ diskutil list /dev/disk0 #: TYPE NAME SIZE IDENTIFIER 0: GUID_partition_scheme…

  • Convert Linux Physical Server to VMware virtual machine

    Download and install vCenter Converter on a windows machine. http://www.vmware.com/products/converter Unfortunately this tool does not have a Linux / MAC version. vCenter Converter In case you see an error: “Permission to perform this operation was denied”, right click and run the program as Administrator. Provide the source and destination information, the source is the physical…

  • ESXi host fails with a purple diagnostic screen PSOD

    This happened while converting KVM VMs to VMware and power them on (method used: http://arunnsblog.com/2013/06/10/migrate-kvm-virtual-machines-to-vmware-esxi/) . It works for a while but then the ESXi crashes with PSOD. Version : 5.1.0-799733 There were two sort of PSOD messages observed: 1) Crashed while the VM was running VMware NOT_IMPLEMENTED bora/vmkernel/sched/memsched.c:17724 Code start: 0x41802b200000 VMK uptime: 10:19:25:27.335…

  • Migrate KVM virtual machines to VMware ESXi

    – Shutdown the KVM guest – convert the QCOW2 or RAW format to VMDK format # qemu-img convert image.img -O vmdk image.vmdk – Upload this image to datastore – Create a new virtual machine with this disk image – There might be issues with network interface mapping, fix the network mapping at /etc/udev/rules.d/70-persistent-net.rules

Got any book recommendations?