Skip to main content

Posts

Multiple JDK on Windows

 Installation of JDK is straight forward for Windows, just download JDK and install. There are situation where certain type of program require specific version of JDK and JRE. In such case you will have more then one version of JDK installed on your machine and you will have to switch JDK version based on the need of the program.  Configure Java Set up System Environment variable JAVA_HOME = C:\Program Files\Java\jdk-11.0.8\bin In Path variable append extra entry for JAVA_HOME Path = %JAVA_HOME% Check environment variable and Java in cmd echo %JAVA_HOME%  java -version Switch JDK   Just edit the JAVA_HOME system variable and point to new JDK location. You don't have to change Path variable. JAVA_HOME = C:\Program Files\Java\jdk-1.8\bin

Installing JDK on MacOS

Check the version of JDK installed and the path on your MacOS /usr/libexec/java_home -V Check this instance/version of the JDK is currently running on your MacOS java --version The above command will show the currently used JDK and JRE If you have multiple instances of JDK installed on your MacOS and want to switch the version based on the required environment. You can do so by following the below steps: Edit ~/.bash_profile and set JAVA_HOME environment variable export JAVA_HOME=$(/usr/libexec/java_home -v 1.8) In case of MacOS BigSur export JAVA_HOME=$(/usr/libexec/java_home -v 1.8.0)  The above command will switch the JDK version to 1.8 Reload the changes to the environment source ~/.bash_profile

Installing JDK on Ubuntu

  OpenJDK To install Open JDK 11 LTS sudo apt-get install openjdk-11-jdk or  sudo apt install default-jdk Oracle JDK For Oracle JDK you have to manually download from the Oracle JDK website and install it. PPA doesn't work well anymore. Manage JAVA   If you have multiple JDK on your machine, you can configure which version to be used using the following command by selecting one. sudo update-alternatives --config java

Get the serial number of a computer using command

Windows Open a command prompt (by choosing the Command Prompt item from the Start menu, or typing cmd in the Start menu's " Run " box), and type the following: wmic bios get serialnumber MacOS Go to Utilities. Open the Terminal application and type: ioreg -l | grep IOPlatformSerialNumber Linux Open a shell and type: sudo dmidecode -t system | grep Serial Note: The user will need to have root access to the system.

Enable Dzongkha keyboard on Android 6

The best thing about Android 6.0 for Bhutanese Android phone user was the Dzongkha font support. If you are not getting any official Android 6.0 on your android device then try installing custom ROM like CynogenMod. I presume that you have Android 6.0 on your device, and now lets enable dzongkha keyboard: 1. Install Multiling O Keyboard from Play Store 2. Launch the Multiling O Keyboard and follow the app screen instruction, then you are done.

Install CyanogenMod 13 on Nexus 4

Let me show you how to install CyanogenMod 13 which is build on Android 6.0.1 since Nexus 4 no longer receives update from Google. I will be explaining you using Debian Linux. Download the latest version of CyanogenMod 13 from Official CyanogenMod website  https://download.cyanogenmod.org/?device=mako . I would recommend Stable release only. Make sure to download system image (CyanogenMod Build), recovery image (CyanogenMod Recovery) and Google App from  https://wiki.cyanogenmod.org/w/Google_Apps .  1. You will need Android SDK platform tool and we will be using fastboot and adb.  2. Now boot the phone in recovery mode, hold down Volume Down  + Power button until bootloader appears, then navigate to Bootloader by clicking volume up/down and select by clicking Power button.  3. Open terminal and then navigate to folder where you have placed Android SDK platform tools. Type  sudo ./fastboot oem unlock if your OEM is locked else...

CentOS 7 and RHEL 7 new commands

In CentOS 7/RHEL 7 the 'service' command has now been changed to systemctl. Now the command are: systemctl start sshd.service  The above line will start sshd service. systemctl restart sshd The above line is a short form command. chkconfig command has also changed. Now to enable service during boot is: systemctl enable sshd To disable service during boot is: systemctl disable sshd To check startup list: systemctl list-unit-files --type=service

Install Wordpress on CentOS/RHEL

Download the latest version of Wordpress extract the zipped filw. 1. wget http://wordpress.org/latest.tar.gz 2. tar xzf latest.tar.gz Now assigning to group and setting folder permission. 1. chown -R apache.apache wordpress 2. chmod -R 755 wordpress Configuring Apache 1. cd /etc/httpd/conf.d/ 2. Create a file wordpress.conf 3. wordpress.conf Alias /wordpress /home/wordpress < Directory /home/wordpress> Order allow,deny Allow from all < /Directory> 4. service httpd restart Browse at localhost/wordpress it should show you wordpress site. That's it. You can use the existing mysql connection and connect to wordpress site.

Druknet PPoE VPI/VCI

If you are using Druknet broadband, following are the VPI and VCI value you need to know when you configure in your Wireless Access Point. VPI ( Virtual Path Identifier)  = 0 VCI ( Virtual Channel Identifier)  = 35

Update Kali Linux from ISO image with no network

Mount the ISO to /mnt directory sudo mount -t iso9660 -o loop /path/to/iso /mnt/ Modify the /etc/apt/sources.list Add: deb file:///mnt kali main contrib non-free Comment: Comment out all other repository locations from the file except the about one. Update the system sudo apt-get update sudo apt-get dist-upgrade Un-comment We have now updated the system from the ISO, now we need to un-comment back the official repository locations and comment our newly added ISO repository. Un-mount the ISO sudo umount /mnt

How to connect to remote desktop using linux

Remmina has now been moved to FreeRDP. To connect to remote desktop using freerdp command sudo  xfreerdp /size:800x600 /u:administrator /v:192.168.1.1:3389 with the above command I am connecting to 192.168.1.1 windows server where remote desktop is enabled with the screen resolution 800x600. By default remote desktop works on tcp port 3389.

Clear Zimbra Mail Queue

If you want to clear mail queue from specific email address run the following command in your terminal. Below will remove mail queues, by checking FROM sender. eg. remove all mail queues sent by info@example.com /opt/zimbra/postfix/sbin/mailq | tail -n +2 | grep -v '^ *(' | awk 'BEGIN { RS = "" } { if ($7 == "info@example.comt") print $1 } ' | tr -d '*!' | xargs -rn1 /opt/zimbra/postfix/sbin/postsuper -d Below will remove mail queues, by checking TO sender. eg. remove all mail queues sent to info@example.com /opt/zimbra/postfix/sbin/mailq | tail -n +2 | grep -v '^ *(' | awk 'BEGIN { RS = "" } { if ($8 == "info@example.comt") print $1 } ' | tr -d '*!' | xargs -rn1 /opt/zimbra/postfix/sbin/postsuper -d

Things to do after install Kali Linux

Kali Linux basically come with pen testing packages, but you still need some day to day utilities packages. Here are the list of things that I do after installing Kali Linux. 1. Installing Archiving package sudo apt-get install unrar unace rar unrar p7zip zip unzip p7zip-full p7zip-rar file-roller 2. Installing Gimp sudo apt-get install gimp 3. Installing Virtual Box sudo apt-get install virtualbox 4. Installing Remote Desktop Client sudo apt-get install remmina 5. Installing FTP Client sudo apt-get install filezilla filezilla-common 6. Installing Adobe Flash Player sudo apt-get install flashplugin-nonfree 7. Installing PlayonLinux sudo apt-get install playonlinux Finally adding deb-multimedia.org repository . So that you can install additional multimedia packages on you Debian box. 8. Installing video editing package sudo apt-get install avidemux

Disable Ubuntu Guest Session

Follow the following steps in the terminal sudo -i gedit /etc/lightdm/lightdm.conf If you don't find above line then: sudo gedit /usr/share/lightdm/lightdm.conf.d/50-ubuntu.conf  Add the following line and save allow-guest=false Then reboot the machine

Install Latest LibreOffice in Linux

Download the latest version on LibreOffice from its website. 1. Uncompress the file tar zvxf LibreOfficeXXXX.tar.gz 2. Go to respective folder cd DEBS or cd RPMS 3. Installation dpkg -i *.deb  or yum localinstall *.rpm 4. Desktop Integration cd desktop-integration 5. Install Desktop Integration dpkg -i *.deb or yum localinstall *.rpm * This procedure will work on RedHat & Debian Linux