Category: OS

  • 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…

  • 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…

  • 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…

  • Virus scanning for file uploads with clamav/php

    Download and install the following packages, in case your repository has those package just use the management tool to install. Ubuntu/Debian/Mint # apt-get install clamav clamav-db clamd clamav-devel php-devel Redhat # yum install php-devel # wget http://pkgs.repoforge.org/clamav/clamav-0.97.7-1.el5.rf.i386.rpm # wget http://pkgs.repoforge.org/clamav/clamav-db-0.97.7-1.el5.rf.i386.rpm # wget http://pkgs.repoforge.org/clamav/clamd-0.97.7-1.el5.rf.i386.rpm # wget http://pkgs.repoforge.org/clamav/clamav-devel-0.97.7-1.el5.rf.i386.rpm # rpm -Uvh clam* # freshclam # service clamd…

  • Create CSR and implement in apache

    These steps are used to generate a CSR to get the SSL certificate signed with verisign. The filenames used are just examples. $ /usr/bin/openssl genrsa -rand /dev/urandom -out <web_root>/domain_name.key 2048 $ /usr/bin/openssl req -new -key <web_root>/domain_name.key -out <web_root>/domain_name.csr Country Name (2 letter code) [GB]: State or Province Name (full name) [Berkshire]: Locality Name (eg, city)…

  • Install rich text editor in mediawiki

    The WYSIWYG extension enables a more intuitive editing of pages on a MediaWiki-based site Download the package suitable for your mediawiki version http://www.mediawiki.org/wiki/Extension:WYSIWYG#Download $ unzip WYSIWYG.zip $ cp -prf WYSIWYG $media_wiki/extensions/ $ vi LocalSettings.php added require_once(“$IP/extensions/WYSIWYG/WYSIWYG.php”); $wgGroupPermissions[‘*’][‘wysiwyg’]=true; $wgGroupPermissions[‘registered_users’][‘wysiwyg’]=true; define permissions as per your requirements.

  • Install multiple python in Linux

    $ wget http://www.python.org/ftp/python/2.7.3/Python-2.7.3.tgz $ tar xvzf Python-2.7.3.tgz $ cd Python-2.7.3 $ ./configure $ make $ sudo make altinstall // do not use make install it might break the // system python dependent packages, otherwise use a different prefix // during compile.

  • Upgrade php to 5.3 – directadmin

    # cd /usr/local/directadmin/custombuild # ./build set php5_ver 5.3 # ./build update # ./build php n # /etc/init.d/httpd restart This may break your softaculous, if it cannot load the correct ioncube. Site error: the file /usr/local/directadmin/plugins/softaculous/images/inc.php requires the ionCube PHP Loader ioncube_loader_lin_5.3.so to be installed by the site administrator. Edit your php.ini to fix it #…