Showing posts with label linux tutorial. Show all posts
Showing posts with label linux tutorial. Show all posts

Thursday, September 3, 2015

Run jar files in Linux

0 comments

Run jar files in Linux

When people try to run the jar file, they click on it, It opens with an archive manager and showing the files. So how to run it by clicking on it ?
Well, it's easy, first you have to have java installed, whether it's Openjdk or OracleJdk.
Second mark it as executable.

make it executable

Then customize the "Open with" tab like these pictures :

Open with

Openjdk

Choose Openjdk or Oraclejdk, Depending on what you have.

Note : this process executed in Nautilus file manager, However it's almost the same steps for other file managers.

We can do it using Terminal too, first make it executable :

chmod +x test.jar

then run it with this command : 

java -jar test.jar



     
Read more...

Sunday, June 21, 2015

Open and close CD / DVD Drive using this trick

0 comments

Open and close (CD / DVD Drive) using this trick

Linux terminal (or Shell language generally) can do many beautiful things such as tricks, whether in terms of benefit of programming, or in terms of tricks and entertainment, and in this lesson we will learn about small code that executes an infinite loop which make the drive (CD / DVD Drive) closes and opens itself repeatedly, and of course will not stop unless you stop your own script, and you will learn about it.

1. First, Create a new text file under any name you want (for example, I I would call it script), at the end of your file name, add .sh 
now the name will be like this : script.sh

Create Document


Script.sh


2. Now, copy the following codes, and paste then in the text file script.sh :

#! / Bin / sh
while [1 = 1]
do
#eject CDROM
eject
#pull CDROM tray back in
eject -t
done

3. Save the file and close it.

4. Go to the File Properties and Permissions tab, check the option appeared in the picture :

allow executing file as program

5. Now run the file, and if this message appears, press Run in Terminal, and now you will see how the drive will still opens and closes on its own, until you stop it.

run in terminal


How do I stop it ? Simply close the terminal window.

     
Read more...

Saturday, May 16, 2015

How to Check MD5 Hash using Terminal

0 comments

How to Check MD5 Hash using terminal

In this post, we will explain how to check the md5sum value on Linux distributions, using the Terminal.

What is MD5 and why  should be validated ?


When you download the ISO file, for example (whether an operating system or program or any other file) it is advisable to test its health, safety and file security, lest there be damaged or corrupted, in this case it's called MD5 Test or hash value (retail), which is about mathematical equation consists of a set of numbers and letters, and the way to verify the equality of the value of the real hash to the given party publisher with the value of the ISO file that is loaded; the higher the ISO file size the greater the need for a testing process to avoid errors during use.

Test Method


There are some different software in the Linux system to verify the integrity of the file and is known to many, but in here we will test the validity through the Terminal, without the need for programs.

1. Open the terminal Ctrl + Alt + T and paste the following command :

cd Downloads

Downloads must be replaced with the name of the folder in which the file to check is allocated in.

2. paste the following command :

md5sum ubuntu-11.10-dvd-i386.iso

Replace ubuntu-11.10-dvd-i386.iso with the desired file.

3. The following result will appear, note that you have produced a hash value :

8044d756b7f00b695ab8dce07dce43e5 ubuntu-11.10-dvd-i386.iso

4. Now you should check matching the number that publisher gave you, with the number that resulted in the terminal, the correspondence with each other, the safe the file is, but if they have not corresponded you must re-download the file again.

5. That's it.

     
Read more...

Wednesday, February 11, 2015

How to Set Chromium into Private (Incognito) Mode by Default

0 comments

How to Set Chromium into Private (Incognito) Mode by Default


If you like Chromium and keeping your browsing private, use Incognito mode. you can always use that mode by clicking "New incognito window" from the menu as the image bellow shows :

New incognito window

Or by just pressing Ctrl + Shift + N.

However here’s a handy trick for always starting Chromium in incognito mode by default.
First, edit Chromium.desktop which is located here /usr/share/applications/chromium.desktop. I"m using nano here, so the command will be :

sudo nano /usr/share/applications/chromium.desktop 

In this code : Exec=chromium %U add --incognito, so It will be Exec=chromium --incognito %U

Now when you open Chromium, It will open in incognito mode.

     
Read more...

Monday, October 27, 2014

What is MAC Address ? And how to change it on Linux ?

0 comments

What is MAC Address ? And how to change it on Linux ?

Mac is a physic Address of media connected to the Internet or a local network, such as a network card, modem, network switches and hubs, Bluetooth, Ethernet, and wifi, and other ...

The mac address is in this format :

- MM:MM:MM:SS:SS:SS 

There are many ways to find out your mac address of your devices either by going to network-manager(very easy).

network-manager mac address linux

but I will show you how, using macchanger (install it first).

type this command :

macchanger wgp0s96f0u1 --show

The red one is name of your interface. replace that red one with yours.

To change the mac address :

sudo macchanger wgp0s96f0u1 --mac=00:53:17:b5:ad:cc 

Don't forget to change the red ones, change that mac address to the one you like. 


     
Read more...

Monday, October 6, 2014

Netflix on Linux

0 comments

Netflix on Linux

Netflix now works on Linux with no Wine tricks required. All it takes to start watching Netflix on Linux right now is Google Chrome and a quick user agent tweak, and soon won’t be necessary.

But for now we have to do some tweaks to make it works.

What we need to play Netflix on Linux

- Having the last Google chrome

- NSS 3.16.2 or greater

- Hacking The user Agent by installing and using this extension : "User-Agent Switcher" and pasting these text lines as you see in the image bellow :

Mozilla/5.0 (Windows NT 6.3; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/38.0.2114.2 Safari/537.36

netflix on linux - user agent

Soon It will not require any tweaking and we will get rid of this extension, so we can watch Netflix without any complications.


netflix on linux



     
Read more...

Thursday, August 28, 2014

Simply Change the Home page in Firefox

0 comments

Simply Change the Home page in Firefox

Without Going to Preferences then General and then change the Home page.

In this step, all you need is to go to the website you want to make it the Home page and grab the Tab to the Home icon like the images show :

firefox home page

and this message will appear, click yes

firefox home page


     
Read more...

Saturday, August 16, 2014

Tip : make VLC running automatically full screen

0 comments

Tip : make VLC running automatically full screen

VLC media player is strong and supports a lot of video formats, and in this quick tip we will explain how you can make VLC automatically and directly run video in Full Screen mode .

Open the program, click on the Tools list in the top bar of the program, and then click on Preferences, open the Settings window, click on the Video tab and then place the tick on the option fullscreen as the following image shows :

vlc preferences


     
Read more...

Saturday, August 9, 2014

You can not change the cursor themes in Ubuntu

0 comments

You can not change the cursor themes in Ubuntu

In this tutorial, we give the solution to the problem of not being able to change the mouse theme in Ubuntu, and the cause of this problem because Ubuntu distribution uses Compiz.

You may notice that when your choose a mouse theme different theme from the default one which is DMZ-White,  through you used tweak-tool or other tools, it will not change, except in a few applications, such as Firefox, and others ... As in the other parts of the system, it will remains on the default theme.

To solve this problem, follow these instructions :

1 Open the terminal Ctrl + Alt + T and paste the following command :

sudo gedit /usr/share/icons/default/index.theme 

2. will open a window containing the text of the following codes, or similar :

[Icon Theme] 
Inherits=DMZ-White 

3, note, the red color, which must be changed to the name of the desired Theme mouse :

Suppose we want black mouse Theme, you must first open tweak-tool application in order to know the name of the theme that we want a DMZ-Black, then we write in the text file as it is written entirely in the tweak-tool, taking into account the large and small letters.

Thus, for the rest of themes, for example, I want the red mouse, looking for its name in the tweak-tool and then type it in the script editor.

  4. log out of the system, which is an important step to activate the new mouse theme.

5. Enjoy it.

     
Read more...

Wednesday, August 6, 2014

Guide to install Java on Ubuntu

0 comments

Guide to install Java on Ubuntu

Installing Java is one of the few things that people do after installing Ubuntu, and in this post we will guide you to install Java on Ubuntu 14.04 with clarifying the differences between the various copies Java.

OpenJDK against JRE against Oracle JDK 

Before proceeding to install Java, we must be aware of the differences between these copies of Java, let's take a quick look for these versions:

JRE: It is an abbreviation for (Java Runtime Environment), which is the application you need to pan ordinary users to run applications written in Java, this is all you need if you are not a programmer.

JDK: It is based on the Java Development Kit, and this is what you need to do some development processes and programming related to Java.

OpenJDK: It is the application of open-source Java Development Kit, and this version is also suitable for the needs of most casual users, but the advantage back to the JRE in this context.

Oracle JDK: it is the official version of Oracle's Java Development Kit, and the examples that you use, the editor compile Android Studio.

Java installation on Ubuntu 14.04 


# Before starting the installation, you should check whether the Java software installed you actually have to verify the existence of Java in the system, open the terminal Ctrl + Alt + T and paste the following command :

java-version 

- If you see the following output or similar :

The program 'java' can be found in the following packages: 
* Default-jre 
* Gcj-4.6-jre-headless 
* Openjdk-6-jre-headless 
* Gcj-4.5-jre-headless 
* Openjdk-7-jre-headless 
Try: sudo apt-get install 

It means that Java is not installed on the computer, and you'll need to install it, so we will proceed to the installation process now.

Installing the JRE 

Open a terminal Ctrl + Alt + T and paste the following command :

sudo apt-get install default-jre 

Installing OpenJDK 

Open a terminal Ctrl + Alt + T and paste the following command :

sudo apt-get install default-jdk 

Installing Oracle JDK 

Open a terminal Ctrl + Alt + T and paste the following commands (* Make sure to have high-speed Internet, it will download a lot of files in the case of Oracle JDK).

sudo add-apt-repository ppa: webupd8team/java 
sudo apt-get update 
sudo apt-get install oracle-java8-installer 
sudo apt-get install oracle-java8-set-default 

(* If you want to install the seventh version of the oracle jdk, replace java8 b java7 in the above commands).

     
Read more...

Saturday, July 26, 2014

How to activate the BackSpace button in Firefox on Ubuntu

0 comments

How do you activate the BackSpace button in Firefox on Ubuntu ?

If you were Windows user before, you might have noticed that when you press the Backspace button in Firefox, the browser goes back back to the previous page.

In case you want to activate this button, follow these steps :

1. Type in the search bar this phrase about:config

about:config


2. Warning message will appear, accept it.

about:config warning


3. Type in the box provided word Backspace

Backspace


4. Double click on the phrase that appeared in front of you browser.backspace_action and then change the value to zero (0)

browser.backspace_action


     
Read more...

Tuesday, July 22, 2014

Essential Management of packages over APT-GET

0 comments

Essential Management of packages over APT-GET
Apt-get package manager is the default in Ubuntu distro and other distos which are based on it like Linux Mint and others, apt-get is known by its ability to manage packages and repositories system quickly and easily, we will explain in this post simple basics of package management system via apt-get.

In Linux, specifically Ubuntu, there are so-called repositories, which are a place where you can find all versions of packages and applications so that the users can later install easily by adding a link of a repository to their system and use apt-get to install software they want, creating a repository is not for new users it is an advanced stage, now you will learn a few basic commands for apt-get.

To install the package :

sudo apt-get install package 

Do not forget to replace package to the name of package you want to install.

To remove a package :

sudo apt-get remove package 

To remove the pack and all the settings :

sudo apt-get purge package 

To check for updates :

sudo apt-get update 

To upgrade a specific package :

sudo apt-get upgrade pacakge 

To upgrade all packages :

sudo apt-get upgrade 

To search for the package :

sudo apt-cache search package 

To add a repository from Launchpad :

sudo add-apt-repository ppa: something/someone 

Do not forget to replace the text in red colour to the repository, which you find in Launchpad.

To remove the repository from Launchpad :

sudo add-apt-repository - remove ppa: something / someone 

To clean up the packages from /var/cache/apt/archives/ :

sudo apt-get clean 

To remove the non-required packages :

sudo apt-get autoremove 

You can explore more options for apt-get commands in some online guides.

     
Read more...

A quick glance at the shell script

0 comments

A quick glance at the shell script

Linux system consists of several components, the most important of these components is the Linux kernel which is the heart of the system, the so-called Shell that takes Linux kernel as casing.

Bash is in all Linux distributions almost, it is responsible for the implementation of the terminals commands as an example, and it is responsible for taking commands and passed them to the kernel and deal with them, which is very useful and depend on them most of the Linux applications.

When you execute ls command, for example, which lists all the files and folders in the current path in the terminal, the Bash automatically execute the program in /bin/ls, then the program is executed and the components are listed the current path.

Shell script is a set of serial commands that are written for a particular job, you can perform anything and modify anything you want the system via the shell script, the Bash reads the commands and instructions from a shell script and it is implemented to perform the task that it was designed for.

Shell script does not require simple commands such as ls and pwd, it can contain conditional sentences  like if and functions and variables and things very complicated, it differs from the use of these things, each according to the goal of shell scripts.


This is an example of a very simple shell script file which will ask for your name and your age, then print them in the screen, take these commands and save them in a file in a folder, for example test.sh  in the home directory :

#! / bin / bash 
echo "Enter your name:"; read name 
echo "Enter your age:"; read age 
echo "Hello $ name, you are $ age years old!" 

Then run the following command to make it executable :

chmod +x test.sh 

Now to execute shell scripts, do as this :

. / test.sh 

Enter your name, and enter your age, and will print the sentence .. Of course this is a very simple example to give you an idea about it, writing useful shell scripts needs a higher level than that, you can learn shell scripts from some online Guides.

     
Read more...

Monday, July 21, 2014

The solution to the problem of intermittent letters on Flash under Linux

0 comments

The solution to the problem of intermittent letters on Flash under Linux

You all know that the problem of intermittent letters on Flash player under Linux is one of the most troubling problems for users, especially for those who deal frequently with the websites where the flash is used, today we will explain to you how to solve this problem on the Linux environment and the Firefox browser.

What do now is to install a special version of Flash of Windows on Ubuntu and the latest version via the package provided by the site Webupd8 to this matter, on Ubuntu and derivatives of Ubuntu by these commands :

sudo add-apt-repository ppa: nilarimogard/webupd8 
sudo apt-get update 
sudo apt-get install freshplayerplugin 

For other distributions, download this file libfreshwrapper.so from this link for 32-bit distributions, and here's for 64-bit, and put it in the folder /usr/lib/mozilla/plugins/ .

Now if we opened Firefox and went to any website that uses flash, the following problem will appear to us :

Failled to load

We need to an extension named Pepper Flash to complete the solution, we can get it by simply downloading the Google Chrome browser from this link and installing it, then re-open any website that has Flash from Firefox browser, and Enjoy :)

     
Read more...

Friday, May 30, 2014

Hint: How to install Registry files on Wine ?

0 comments

Hint: How to install Registry files on Wine ?

Sometimes when you try to install a game or program on Wine you will be surprised that it does not work, an error message appears on the wording of "the game is not properly installed" or something like that , and in this case it means that there is a Registry file missing must be installed to operate the game \ program.

1 . , First and foremost, look for the error message in Google and download the appropriate Registry file that solves the problem.

2 . Open Terminal by pressing Ctrl + Alt + T.

3 . , Type the following command , followed by the path and Registry file name ( or drag and drop the Registry file to Terminal after typing the command ) :

wine regedit path to file

* As you can see above, the Red command is for installation Registry files, while the blue one is the path and file name that you can drag and drop to a terminal window, and then press Enter.

4 . The Registry file is installed.

     
Read more...

Sunday, March 23, 2014

Things you didn't know about VLC

0 comments

1 - Take a Snapshot :


While watching a video, in some cases, you'll want take some pictures from it , you can do it using the application inside the VLC called "Snapshot", just click on the "Video" menu located top and you will see the option "Take Snapshot"

But, I think the easiest way to do it, is by pressing Shift + S


vlc take snapshots


By default the captured image will be saved in a folder called "vlc-snapshots", to change the path, you need to go to this location "Tools > Preferences < videos" as the pictures shows.

change vlc-snapshots

2 - Opening the video from the time you want to start from :


You can do it from opening "Media> Open (advanced)" and it will appear a window , in that window make sure that the option "show more options" is activated and then you will see the option "start time".

start time vlc


3 - convert media files :


To begin converting between formats, you need to go to this location "Media> Convert" and of course you need to put the file path and path after the conversion and also the format that you want to convert them to.

vlc convert medias


4 - Play video files in ASCII mode :


You can do that by going to "Tools> Preferences" , or by clicking (ctrl + p) then choose ascii from the list

vlc ascii mode


5 - Recording the Desktop :


I have a feeling that the majority don't know that VLC can record the desktop.
To record your desktop using VLC, you need to go to this path "Media > streaming > capture device".

Now change "capture mode" to "Desktop" and click "stream" to begin recording.

Do as you do when you play a media file, such as pausing, stopping ...

vlc records the desktop


     
Read more...

16 Useful VLC keyboard shortcuts

0 comments

16 Useful VLC keyboard shortcuts

If you're like me , you prefer to do things quickly. Using keyboard shortcuts to help shorten the time instead of looking for things such as buttons and lists ,  more time to enjoy the music and videos . So you need to check this list of 16 Useful VLC keyboard shortcuts. It makes life easier I think.

SPACE                        :     Pause or Play again.
F                                  :      Full screen or back to normal size.
Ctrl + Up / Down        :      Control the volume of sound.
M                                :      Mute the sound.
T                                 :      Show the remaining time.
+/-                               :      Speed or slow the media.
S                                 :      Stop the media.
Ctrl+H                        :      Hide the buttons and the interface in general.
E                                 :     Watch video clips frame by frame.
V                                :      Enable translation or disable it.
P                                 :      Play previous media in the playlist.
N                                :      Play next media in the playlist.
Ctrl + T                      :     Go exactly to time you specify.
Ctrl + P                      :     Go to VLC preferences.
Ctrl + L                      :     Show the playlist or hide it.
L                                :     Loop the media or the playlist or disable looping.

     
Read more...

Friday, March 21, 2014

The easiest way to auto clean up your trash

0 comments

The easiest way to auto clean up your trash

I noticed when I remove files either torrent files, or photos, videos ..., they just go to the Trash
and I go to Trash to remove them for the last time.

What I want to show here, is a way to let you do an auto clean for your Trash, without your Intervention.

To make that happens, just follow the instructions :

rm -r ~/.local/share/Trash/files/*

This command just cleans the Trash.

But we want to auto clean it, so we install this application first : crontab trick

and run the following command :

@daily rm -r ~/.local/share/Trash/files/*

Now you have an automatic daily cleaning for your Trash.

To do it without a need of any additional application, you simply go to Startup Application Preferences.

And add the previous command which is :

rm -r ~/.local/share/Trash/files/*

auto clean trash

Enjoy !

     
Read more...

Thursday, March 20, 2014

How to change keyboard layouts in Openbox, Icewm, Razor-qt ...

0 comments

How to change keyboard layouts in Openbox, Icewm, Razor-qt ...

Many people suffer from a problem with switching between keyboard layouts in lightweight desktop environments or lightweight window managers like ***box family, Icewm, E17 etc...

The problem does not seem to be that hard if you looked wisely, with this simple command, you can solve that problem so easily :

setxkbmap -option grp:switch,grp:alt_shift_toggle,grp_led:­scroll us,fr

You see, I chosen French and English American to switch from, you can choose you own.

And the keys we hint to change the keyboard layout are : ALT+SHIFT, of course you chose what you like.

Changes are temporary, we need to perform this command in every session , so it will be painful.
To make changes permanent, we have to put the command in .bashrc which is located in the Home directory.

nano .bashrc

Now, paste the command in that file, and press  CTRL+O to save, then  CTRL+X to exit.

Enjoy !

     
Read more...

Wednesday, March 19, 2014

Listening to music via terminal

0 comments

Listening to music via terminal
We can listen to music in Terminal using Mplayer. For whom don't know what Mplayer is, it is an open source software for multimedia which can play a wide variety of media formats, it is multi-platform which means, this application works in Linux, and other Unix-like systems, Microsoft Windows and Mac OS X...

To listen to music in Terminal, you must have Mplayer installed on your machine. or install it by the following command.

For Ubuntu / Mint users :

sudo apt-get install mplayer

For Arch Linux users :

sudo pacman -S mplayer

Go to directory, you want to play music from, for me, it is "Music" :

cd Music

Then play, music you want :

mplayer loveme.mp3

If you to play all mp3 files on that directory :

mplayer *.mp3

If you want to play them all :

mplayer *

You can also play two pieces of music or more, depending on you :

mplayer loveme.mp3 && mplayer hateme.mp3



mplayer in terminal

     
Read more...