Showing posts with label linux. Show all posts
Showing posts with label linux. Show all posts
I have downloaded movie in a .mkv file format, and when I try to play it on my Ubuntu, I just can heard the sound but the movie didn't played. After a couple of minutes google it, I found a way to make it clear.
First, add this repo,

sudo apt-add-repository ppa:strukturag/libde265
sudo apt-get update 

Install the corresponding GStreamer plugin directly,
sudo apt-get install gstreamer0.10-libde265 
For GStreamer 1.0 applications,
sudo apt-get install gstreamer1.0-libde265 
There is also a VLC plugin available,
sudo apt-get install vlc-plugin-libde265 
Try it and enjoy your .mkv file. If you have any problem don't hestitate to let me know and help you.
Read More
Hi guys, at this time I will share how to integrate Android SDK and Eclipse IDE in Ubuntu.
First thing first, you must have Oracle Java JDK or OpenJDK (free and open source :D) installed on your system before installing Android SDK. Don't forget to connect your PC or Notebook to Internet to download and install what we need, prepare your coffee and let's start :D
1. Prepare your Development Environment
  • If you don't have installed OpenJDK and JRE on your system yet, you must install it first, you can download the binary from here or you can install it using apt like this:
 sudo apt-get install openjdk-7-jdk && openjdk-7-jre
  • If you are running a 64-bit distribution of Android SDK on your development machine, you need to install the ia32-libs
sudo apt-get install ia32-libs
  • Open terminal and type
javac -version (check java compiler version)
java -version  (check java version)

2. Download and Configure Eclipse Integrated Development Environment (IDE)

  • You can install it using apt-get or you can download it from here. If you are using apt-get, just type into terminal
sudo apt-get install eclipse (this will download and install eclipse)
  • If you have downloaded it from Eclipse site you must select the correct bit version for your corresponding system architecture, if you are on 32-bit Ubuntu then select 32-bit Eclipse IDE and if you are on 64-bit Ubuntu then select 64-bit Eclipse IDE but I won't explain how to use and configure 64-bit Eclipse IDE because I am on 32-bit Ubuntu :). Install it from Ubuntu repository is recommended.
  • I assume you have download and installed it, then we will go to the next step

3. Download, Install and Configure the Android SDK


  • Download Android SDK, select the Linux tarball (android-sdk_r22-linux.tgz) and save it anywhere you want, assume we have it on /home/user/Downloads directory, open up terminal and type:
cd /home/user/Downloads (this will change into Downloads directory)
sudo cp -r android-sdk_r22.tgz /opt (this will copy downloaded android-sdk to /opt directory)
cd /opt (this will change you into the Android working directory)
sudo tar xvzf android-sdk_r22-linux.tgz (this will extract android-sdk_r22-linux.tgz)
sudo -s chmod -R 755 /opt/android-sdk-linux (this will make Android working directory writeable and executable for all users on the systems)

  • Now you have Android SDK located at /opt/android-sdk-linux on your Ubuntu, our next step to add Android SDK to the system wide PATH on Ubuntu, type in terminal
sudo nano /etc/profile or sudo gedit /etc/profile
add the following lines below to the end of the system PATH file
export PATH = ${PATH}:/opt/android-sdk-linux/tools
export PATH = ${PATH}:/opt/android-sdk-linux/platform-tools
save it (if using nano ctrl + o then ctrl + x to close it)
  • Reload your system PATH /etc/profile by type in terminal:
. /etc/profile
4. Install the Android Development Tool (ADT) Plugin for Eclipse IDE
  • Start Eclipse, then select Help => Install New Software. Click Add in the top-right corner. In the Add Repository dialog, enter "ADT Plugin" this just title and you can change it whatever name you want, and URL with the following URL location
https://dl-ssl.google.com/android/eclipse/
  • Then click OK
  • In the Available Software dialog, select Developer Tools and click Next. In the next window you will see a list of the tools to be downloaded then click Next. Accept all license agreements, then click Finish. (If you get a security warning saying that the authenticity or validity of the software can't be established, ignore this and click OK
  • When the installation complete, restart Eclipse. After you've successfully download the ADT, the next step is to modify your ADT preferences in Eclipse to point to the Android SDK directory which we described it before. 
  • Select Window => Preferences... to open the Preferences Panel.
  • Select Android from the left panel. You may see a dialog asking whether you want to send usage statistics to Google. If so, make your choice and click Proceed.
  • Click Browse in the main panel and locate your Android SDK directory which should be /opt/android-sdk-linux.
  • Click Apply, then OK.
5. Add Android platforms and other components to your SDK

  • To create Android Project you must have at least one Android platform and the associated platform tools, you can choose whatever you want from Android SDK Manager. 
  • To launch Android SDK Manager type in terminal:
/opt/android-sdk-linux/tools/android

  • This will open graphical user interface of Android SDK Manager then you can choose Android 2.3.3 and Android 4.2 to be downloaded.
6. Create your Android Virtual Device (AVD)
  • Open terminal and type:
/opt/android-sdk-linux/tools/android avd
  • This will open AVD Manager then create your Android Virtual Device


Congratulations, you should now have the Android SDK setup to work with Eclipse IDE and you can begin developing Android Applications.

Happy Coding :)
Read More
If you are newbie in Linux, you will confuse when you want to install Linux application and it's format file is .tar.gz or .tar.bz2 (tarball). But now you don't need to worry because this post will give you the answer :).

Standard format to extract this tarball file is:

tar xvf filename.tar


If the tarball has also been gzipped (compressed), you can use the following command:

tar xvfz filename.tar.gz

If you only want certain directories from the tarball, do this:

tar xvzf filename.tar.gz */dir.you.want/*

If you have a .tar.bz2 file, then you need bzip2 installed (/usr/ports/archivers/bzip2), and you issue this command:

tar yxf filename.tar.bz2
Read More
Bash scripting is one of the easiest types of scripting to learn. It run under Linux and its very usefull. Bash is the language that you will learn to love as much of everyday Ubuntu life is done/can be done using terminal. You can make your own custom bash script through both GUI (Graphical User Interface) and CLI (Command Line Interface), but I prefer using CLI than GUI because using CLI you can changing file permissions of a folder and all its sub folders is more easily.

To make your own custom bash script, define where you wanna put the custom bash script directory (I use /home/user/bash_custom).
Then run terminal by type ctrl + T and type, 
sudo nano /etc/profile
Add path of the custom bash script at the end of line, in order to execute the script from everywhere at the console,
export PATH=${PATH}:/home/user/bash_custom
Reload your system PATH in /etc/profile by type in terminal,
. /etc/profile
Create .sh file in bash_custom directory,
nano /home/user/bash_custom/youdl.sh
This script used to download youtube video with custom parameter and now integrate with axel downloader, of course I will share the script to you (make sure that you have youtube-dl installed before), copy and paste the following code to .sh file that have been created,

#!/bin/sh
CONNECTIONS=4 # Specify how many connections axel should use
# Get URL and Title of video using youtube-dl
url=`youtube-dl --get-url --max-quality avi  $1`
echo "Got URL"
title=`youtube-dl --get-title $1`
echo "Got Title :"$title
# Download using axel
axel --alternate --num-connections=$CONNECTIONS --output="$title.mp4" "$url"
Save it by type ctrl + O then type ctrl + X to exit.
Once finished, you can type in terminal
youdl.sh youtube_link_video title
Replace youtube_link_video with youtube video you want to download, and replace title with your custom title.

That's how this custom bash script work, just create other custom bash script, and do above steps.
Read More
Previous PostOlder Posts Home