Linux

$ Random Linux tips and tricks.

Bleeding Edge Graphics Drivers for Kubuntu

posted Jan 13, 2017, 9:31 PM by Ali Janah

Question! How do I install the latest graphics drivers for my GPU (ATI AMDGPU) and the latest mesa under Kubuntu 16.10 (also available for 16.04)?

Answer!  Open up a console then type in the following command:
sudo apt-add-repository 'ppa:paulo-miguel-dias/mesa'
Then push the enter key, and run the next command:

sudo apt update
&& sudo apt upgrade

Note!
after this do a reboot and you should be running the latest mesa and AMDGPU drivers with OpenGL 4, to make sure you can check with the following command:

glxinfo | grep "OpenGL"

Note! If the terminal complains about glxinfo not being available, you should install mesa-utils, just do a:

sudo apt install mesa-utils

Default monitor on dual monitor setup

posted Jun 23, 2016, 12:27 AM by Ali Janah   [ updated Jun 23, 2016, 4:43 AM ]

Question! How to set the default monitor for applications in a dual monitor configuration.

Answer!  Open up a console then type in the following command:

xrandr -q

Identify your primary monitor among the list you get, then type in the following command :

xrandr --output DVI-0 --primary

Note!
Replace DVI-0 by your identified monitor's id.

Convert ZNC logs from version 1.4 to 1.6

posted Jun 2, 2016, 6:30 PM by Ali Janah   [ updated Jun 2, 2016, 6:46 PM ]

Question! How to convert ZNC 1.4 logs to version 1.6.

Answer!
  Download the attached script bellow (convert-znc-1.4-logs-to-1.6.sh), then run it.

sh convert-znc-1.4-logs-to-1.6.sh

Please read the info in the beginning of the script file by editing it :

nano convert-znc-1.4-logs-to-1.6.sh

Note!
Script taken from https://github.com/ZacharyDuBois/Random-Scripts all credit goes to Zachary DuBois.

Run a JNLP file (Java)

posted May 14, 2016, 5:06 PM by Ali Janah

Question! How to run a jnlp file under terminal.

Answer!
  Open up a console or terminal then type the following command :

sudo apt-get install icedtea-netx

Then type the following command always in the console while in the target file's directory :

javaws filename.jlnp

Note! Replace "filename" by the name of the file you want to run.

What is using a specific port (Network)

posted May 4, 2016, 3:10 PM by Ali Janah

Question! How to show what is using a specific port (Network).

Answer!
  Open up a console or terminal then type the following command :

sudo netstat -tunap|grep 23

Note! Replace "23" by the port you want.

Run a java file

posted Aug 7, 2015, 4:52 PM by Ali Janah

Question! How to run a java file under terminal.

Answer!
  Open up a console or terminal then type the following command :

java -jar filenamehere.jar

Batch Image Resize

posted Feb 28, 2015, 5:02 PM by Ali Janah

Question! How to resize multiple images at once.

Answer!
  You will first need a tool called ImageMagick, so bring up the console and type in the following command to install it :

apt-get install imagemagick

 Then type the following command in the console :

for i in $( ls *.jpg); do convert -resize 50% $i re_$i; done

Note! Replace "jpg" by the extension your images have (it's case sensitive), and "50" by the percentile you want your images to be resized by.

Mounting ISO files

posted Jan 11, 2015, 1:04 PM by Ali Janah

Question! How to mount an ISO image file so that you can read its content.

Answer!
Type the following command in the console :

mount -o loop <ISO file> <target directory>

Note! Replace <ISO file> and <target directory> by the corresponding names.

Verbose Boot (Kubuntu)

posted Jan 11, 2015, 11:02 AM by Ali Janah   [ updated Jan 11, 2015, 11:06 AM ]

Question! How to make your boot verbose under Kubuntu (possibly same procedure for Ubuntu as well).

Answer!
You are going to need to edit the GRUB2 config file to enable verbose mode, so open a console then type the following command :

sudo nano /etc/default/grub


Then find the line that says :

GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"

And remove the quiet and splash parts so that it reads :

GRUB_CMDLINE_LINUX_DEFAULT=""

Then hold down the CTRL key and push the "o" button, this should overwrite the config file, just push ENTER when asked to save file.

Then run the following command in console :

sudo update-grub

This should update GRUB2 to take the changes into account. Happy reboot!

Note! To exit nano (the editor you ran through console to edit the GRUB2 config file), just hold down the CTRL key and push the "x" key, that should quit nano the editor.

Summary of CLI commands (wallpaper)

posted Jan 3, 2015, 3:49 PM by Ali Janah   [ updated Jan 3, 2015, 3:50 PM ]

Below (attached file) you can download a wallpaper with a summary of useful Linux Command-line Interface (CLI) commands.

1-10 of 13