Labels

Showing posts with label LINUX. Show all posts
Showing posts with label LINUX. Show all posts

Saturday, 3 January 2015

[Fedora] Watch video and listen to music in fedora 21

Please note that most of this software is potentially patent encumbered and therefore will not be included in the default official Fedora repositories. Please read this wiki page for more information: https://fedoraproject.org/wiki/Forbidden_items

Step 1:

Install RPM Fusion (Free & Non-Free) repositories:

su

dnf install http://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm

 


Step 2:
Install the multimedia codecs:


If you are using GNOME:

su -c 'yum install gstreamer{1,}-{ffmpeg,libav,plugins-{good,ugly,bad{,-free,-nonfree}}} ffmpeg'


If you are using KDE, you might prefer xine instead of Gstreamer:

su -c 'yum install xine-lib* k3b-extras-freeworld'


Step 3:
If you also plan to listen to internet radio streams via rhythmbox for example, you need a few more packages:

su -c 'yum install gstreamer{1,}-{plugin-crystalhd,ffmpeg,plugins-{good,ugly,bad{,-free,-nonfree,-freeworld,-extras}{-extras}}} ffmpeg libmpg123 lame-libs'


Step 4:
Install VLC media player:

su -c 'yum install vlc'

Good luck :)

 

Source: https://ask.fedoraproject.org/en/question/9111/sticky-what-plugins-do-i-need-to-install-to-watch-movies-and-listen-to-music/

 

Thursday, 1 January 2015

[Fedora,Ubuntu,Opensuse...] Install Adobe Flash player on all Linux system

Prepare:

 Information: Base on your linux system, mozilla plugin directory will place in one of the below:

if your linux architecture is x64:
$HOME/.mozilla/plugins
program_directory/plugins
/usr/lib64/mozilla/plugins
/usr/lib64/xulrunner/plugins


if your linux architecture is x86:
$HOME/.mozilla/plugins
program_directory/plugins
/usr/lib/mozilla/plugins
/usr/lib/xulrunner/plugins


In my fedora system x64 architecture it is:
/usr/lib64/mozilla/plugins



Do it:

Step 1: Go to Adobe Flash player download page http://get.adobe.com/flashplayer/
Step 2: Select .tar.gz for linux in "Your system" selection.
Step 3: Click "Download now" and save this file (example : Downloads folder) in Downloads directory
Step 4: Open terminal, navigation to downloaded file and extract it.

mkdir adobeflash
tar -xzvf flashPlayer.tar.gz -C adobeflash
 

Step 5: Login with root user (su root, enter and type password for root user) and move to adobeflash directory
Step 6: cp -r usr/   /usr

Step 7: cp libflashplayer.so  /usr/lib64/mozilla/plugins

Step 8: Restart firefox and enjoy :)

Note: If it still not effect, it is because your selinux is turn on, you can turn it off by open terminal -> login with root -> execute command setenforce 0 -> restart firefox

Thursday, 11 December 2014

[LINUX] Format USB Drive in the Terminal


1. Insert your USB drive into your system.

2. Open the terminal. (CTRL + ALT + T)

3. Look for the USB drive you want to format, by running:

df

The command above will display the directory path of your various drives. Take note of the drive you wish to format.


In this tutorial, the name of the drive am going to format is Seth and its path under the filesystem is /dev/sdc1.
NOTE: if df can not  list your usb drive you can use the following command: 
dmesk | tail

3. Unmount drive using the syntax below:
with root administrator:

umount /dev/sdc1



4. Now run this command to format drive to fat32:

mkfs.vfat -n 'Ubuntu' -I /dev/sdc1



Understanding the above command

mkfs
mkfs is used to build a Linux filesystem on a device, usually a hard disk partition. The device argument is either the device name (e.g. /dev/hda1, /dev/sdb2), or a regular file that shall contain the filesystem. The size argument is the number of blocks to be used for the filesystem.

vfat
Formats the drive to FAT32, other formats available are mkfs.bfs, mkfs.ext2, mkfs.ext3, mkfs.ext4, mkfs.minix, mkfs.msdos, mkfs.vfat, mkfs.xfs, mkfs.xiafs etc.

-n
Volume-name sets the volume name (label) of the file system. The volume name can be up to 11 characters long. The default is no label. In this tutorial my volume-name is Ubuntu.

-I
It is typical for fixed disk devices to be partitioned so by default, you are not permitted to create a filesystem across the entire device.

Running df after formatting displays this.



You are done and your pen drive has successfully been formatted.


Source: http://www.unixmen.com/how-to-format-usb-drive-in-the-terminal/

Sunday, 30 November 2014

[UBUNTU, CENTOS, SUSE, FEDORA ...] Automount HDD NTFS type in linux system

Note :

If your system can mount your hdd driver (not automount)  skip this step and go to Main Action

Prepare Action

While older ntfs drivers were prone to eat your data in r/w-mode, ntfs-3g seems to be r/w safe. See the ntfs-3g page for more information.
 

<!> As of CentOS 5.4 (kernel 2.6.18-164 or newer), the fuse kernel module is included in the kernel itself. Therefore, dkms and dkms-fuse are no longer required. If you have previously installed dkms-fuse, please uninstall it by a yum remove dkms-fuse command. Please note that CentOS-4 users need those 2 packages.
Make sure you have the rpmforge repo installed. If not, refer to Repositories.
Install the following packages.

yum install fuse fuse-ntfs-3g  (*)


If the rpmforge repo is disabled by default,

yum --enablerepo=rpmforge install fuse fuse-ntfs-3g (option)


<!> Note for CentOS-5 users: If you are still running CentOS 5.3 or older, then you would need to install kmod-fuse from ELRepo.
For CentOS-7 and CentOS-6 the EPEL repository is carrying later NTFS packages. EPEL is also usable for CentOS-5. To install, after enabling the repo per the Repositories page:

yum install ntfs-3g  (*)


or if you prefer to leave EPEL disabled by default

yum --enablerepo epel install ntfs-3g (option)


You may also want to

yum install ntfsprogs ntfsprogs-gnomevfs  (*)


for additional functionality. (Take, for example, ntfsclone to copy ntfs-partitions with or without empty space.)

 

Main Action 

Mounting an NTFS filesystem

Suppose your ntfs filesystem is /dev/sda1 and you are going to mount it on /mymnt/win, do the following.

First, create a mount point.

mkdir /mymnt/win


Next, edit /etc/fstab as follows. To mount read-only:

/dev/sda1 /mymnt/win ntfs-3g ro,umask=0222,defaults 0 0


Or to mount read-write:

/dev/sda1 /mymnt/win ntfs-3g rw,umask=0000,defaults 0 0


You can now mount it by running:

mount /mymnt/win

Monday, 14 April 2014

[TOMCAT] Unable to set localhost

# sudo vim /etc/hosts 
 If /etc/hosts doesn't containt the definition of the hostname it fails. Just add your hostname to /etc/host for example if your hostname is work add or modified the following line:

127.0.0.1   work        localhost
 
source: http://stackoverflow.com/questions/4969156/error-java-net-unknownhostexception 

[ALL SYSTEM] Setup JAVA_HOME

Login as root user

vim /etc/profile

Set JAVA_HOME as follows using syntax export JAVA_HOME=<path-to-jdk>

If your jdk path is set to /usr/java/jdk1.5.0_07, add this command to file:

export JAVA_HOME=/usr/java/jdk1.5.0_07

Set PATH as follows:

export PATH=$PATH:$JAVA_HOME/bin

 then save file as following step:

step 1: press esc key on keyboard

step 2: press : key  on keyboard

step 3: type command w

step 4: press enter key on keyboard

After saving successfully run following command to force the system load that file profile again.

. /etc/profile  

 

  Run command java -version to check if successful

[SUSE] start apache2, mysql


APACHE2:
linux-8wi2:~ # /etc/init.d/apache2 start
redirecting to systemctl start apache2.service
linux-8wi2:~ # 


MYSQL:
linux-8wi2:~ # /etc/init.d/mysql start
redirecting to systemctl start mysql.service
linux-8wi2:~ #

source:http://www.cyberciti.biz/faq/linux-start-apache/

Wednesday, 26 March 2014

[UBUNTU] Install LAMP

Install tasksel in ubuntu
In terminal:
sudo apt-get install tasksel

sudo tasksel



choose LAMP (use spacebar keyboard to choose)
and press Tab to choose OK and press Enter

During the installation you will be asked to insert the mysql root password
ok

Saturday, 8 March 2014

[UBUNTU] Setup JAVA_HOME

System-wide environment variables

/etc/profile.d/*.sh

Files with the .sh extension in the /etc/profile.d directory get executed whenever a bash login shell is entered (e.g. when logging in from the console or over ssh), as well as by the DisplayManager when the desktop session loads.
You can for instance create the file /etc/profile.d/myenvvars.sh and set variables like this:  
Suppose my jdk1.7.0 in folder /home/approved/Downloads

sudo -i
(type password)
cat >/etc/profile.d/myenvvars.sh
(and press)
export JAVA_HOME=/home/approved/Downloads/jdk1.7.0 
export PATH=$PATH:$JAVA_HOME/bin
(and press)
Ctrl+D

logout 
in terminal: 
java -version 

Friday, 27 September 2013

[UBUNTU] Howto: Backup and restore your Ubuntu system!

Howto: Backup and restore your system!

More recent up to date information this tutorial deals with can be found on the Ubuntu Wiki

https://help.ubuntu.com/community/BackupYourSystem
https://help.ubuntu.com/community/BackupYourSystem/TAR
https://help.ubuntu.com/community/Ca...BackupRecovery


Thread closed.


Hi, and welcome to the Heliode guide to successful backing-up and restoring of a Linux system!

Most of you have probably used Windows before you started using Ubuntu. During that time you might have needed to backup and restore your system. For Windows you would need proprietary software for which you would have to reboot your machine and boot into a special environment in which you could perform the backing-up/restoring (programs like Norton Ghost).
During that time you might have wondered why it wasn't possible to just add the whole c:\ to a big zip-file. This is impossible because in Windows, there are lots of files you can't copy or overwrite while they are being used, and therefore you needed specialized software to handle this.

Well, I'm here to tell you that those things, just like rebooting, are Windows CrazyThings (tm). There's no need to use programs like Ghost to create backups of your Ubuntu system (or any Linux system, for that matter). In fact; using Ghost might be a very bad idea if you are using anything but ext2. Ext3, the default Ubuntu partition, is seen by Ghost as a damaged ext2 partition and does a very good job at screwing up your data.

1: Backing-up

"What should I use to backup my system then?" might you ask. Easy; the same thing you use to backup/compress everything else; TAR. Unlike Windows, Linux doesn't restrict root access to anything, so you can just throw every single file on a partition in a TAR file!

To do this, become root with

sudo su
and go to the root of your filesystem (we use this in our example, but you can go anywhere you want your backup to end up, including remote or removable drives.)

cd /
Now, below is the full command I would use to make a backup of my system:

Run command below in one line:
tar cvpzf backup.tgz --exclude=/proc --exclude=/lost+found  
--exclude=/backup.tgz --exclude=/mnt --exclude=/sys 
--exclude=/media /
 --exclude=/example/path - The options following this model instruct tar what directories NOT to backup. We don't want to backup everything since some directories aren't very useful to include. The first exclusion rule directs tar not to back itself up, this is important to avoid errors during the operation.
        --exclude= arguments to avoid filesystems you do not want. These would  be /proc, /sys, /mnt, /media, /run and /dev directories in root. /proc and /sys are virtual filesystems that provide windows into variables of the running kernel, so you do not want to try and backup or restore them. /dev is a tmpfs whose contents are created and deleted dynamically by udev, so you also do not want to backup or restore it. Likewise, /run is a tmpfs that holds variables about the running system that do not need backed up. 

Now, lets explain this a little bit.
The 'tar' part is, obviously, the program we're going to use.

'cvpfz' are the options we give to tar, like 'create archive' (obviously),
'preserve permissions'(to keep the same permissions on everything the same), and 'gzip' to keep the size down.

Next, the name the archive is going to get. backup.tgz in our example.

Next comes the root of the directory we want to backup. Since we want to backup everything; /

Now come the directories we want to exclude. We don't want to backup everything since some dirs aren't very useful to include. Also make sure you don't include the file itself, or else you'll get weird results.
You might also not want to include the /mnt folder if you have other partitions mounted there or you'll end up backing those up too. Also make sure you don't have anything mounted in /media (i.e. don't have any cd's or removable media mounted). Either that or exclude /media.

EDIT : kvidell suggests below we also exclude the /dev directory. I have other evidence that says it is very unwise to do so though.

Well, if the command agrees with you, hit enter (or return, whatever) and sit back&relax. This might take a while.

Afterwards you'll have a file called backup.tgz in the root of your filessytem, which is probably pretty large. Now you can burn it to DVD or move it to another machine, whatever you like!

EDIT2:
At the end of the process you might get a message along the lines of 'tar: Error exit delayed from previous errors' or something, but in most cases you can just ignore that.

Alternatively, you can use Bzip2 to compress your backup. This means higher compression but lower speed. If compression is important to you, just substitute
the 'z' in the command with 'j', and give the backup the right extension.
That would make the command look like this:

Run command below in one line:
tar cvpjf backup.tar.bz2 --exclude=/proc  
--exclude=/lost+found --exclude=/backup.tar.bz2  
--exclude=/mnt --exclude=/sys /
2: Restoring

Warning: Please, for goodness sake, be careful here. If you don't understand what you are doing here you might end up overwriting stuff that is important to you, so please take care!

Well, we'll just continue with our example from the previous chapter; the file backup.tgz in the root of the partition.

Once again, make sure you are root and that you and the backup file are in the root of the filesystem.

One of the beautiful things of Linux is that This'll work even on a running system; no need to screw around with boot-cd's or anything. Of course, if you've rendered your system unbootable you might have no choice but to use a live-cd, but the results are the same. You can even remove every single file of a Linux system while it is running with one command. I'm not giving you that command though!

Well, back on-topic.
This is the command that I would use:


 tar xvpfz backup.tgz -C /
Or if you used bz2;


 tar xvpfj backup.tar.bz2 -C /
WARNING: this will overwrite every single file on your partition with the one in the archive!

Just hit enter/return/your brother/whatever and watch the fireworks. Again, this might take a while. When it is done, you have a fully restored Ubuntu system! Just make sure that, before you do anything else, you re-create the directories you excluded:

mkdir proc
mkdir lost+found
mkdir mnt
mkdir sys
etc...
And when you reboot, everything should be the way it was when you made the backup!

2.1: GRUB restore
Now, if you want to move your system to a new harddisk or if you did something nasty to your GRUB (like, say, install Windows), You'll also need to reinstall GRUB.
There are several very good howto's on how to do that here on this forum, so i'm not going to reinvent the wheel. Instead, take a look here:

http://www.ubuntuforums.org/showthre...t=grub+restore

There are a couple of methods proposed. I personally recommend the second one, posted by remmelt, since that has always worked for me.


Well that's it! I hope it was helpful!
As always, any feedback is appreciated!
Last edited by nothingspecial; August 30th, 2012 at 11:03 PM. Reason: Moved slash to end of command by popular vote
"Windows is something to overcome"

Howto's by me:
Tweak firefox! (URL now works..)
Backup/Restore your system!
Avoid having to reboot


Compentux.org
, the Linux Tip & Howto gathering initiative!

source:  http://ubuntuforums.org/showthread.php?t=35087

[UBUNTU] How to install a .deb file via the command line?


Is it possible to install a .deb file using command line, can someone tell me how?

3 Answers



Packages are manually installed via the dpkg command (Debian Package Management System). dpkg is the backend to commands like apt-get and aptitude, which in turn are the backend for GUI install apps like the Software Center and Synaptic.
Something along the lines of:
dpkg --> apt-get, aptitude --> Synaptic, Software Center
But of course the easiest ways to install a package would be, first, the GUI apps (Synaptic, Software Center, etc..), followed by the terminal commands apt-get and aptitude that add a very nice user friendly approach to the backend dpkg, including but not limited to packaged dependencies, control over what is installed, needs update, not installed, broken packages, etc.. Lastly the dpkg command which is the base for all of them.
Since dpkg is the base, you can use it to install packaged directly from the command line.


INSTALL A PACKAGE
sudo dpkg -i DEB_PACKAGE
For example if the package file is called askubuntu_2.0.deb then you should do sudo dpkg -i askubuntu_2.0.deb. If dpkg reports an error due to dependency problems, you can run sudo apt-get install -f to download the missing dependencies and configure everything. If that reports an error, you'll have to sort out the dependencies yourself.


REMOVE A PACKAGE
sudo dpkg -r PACKAGE_NAME
For example if the package is called askubuntu then you should do sudo dpkg -r askubuntu.





Answer 1


Debian (.deb) packages are the packages that are used in Ubuntu. You can install any .deb package in your system. .deb files can generally be installed from your file manager (Nautilus) merely by clicking on them, since file associations with the default installer is already set in Ubuntu. These instructions are for those who wish to install packages from the command-line terminal (Terminal).
To install a downloaded Debian (Ubuntu) package (.deb): Open Terminal and type
sudo dpkg -i packagename.deb
To remove a Debian (Ubuntu) package (.deb):
sudo dpkg -r packagename
To Reconfigure/Repair an installed Debian (Ubuntu) package (.deb):
sudo dpkg-reconfigure packagename



Answer 2 


My favourite is GDebi, available from both terminal/shell or graphical desktop.
I usually associate .deb files with GDebi as it is fast and efficient - especially compared to Ubuntu Software Center. One of the main feature of GDebi is it resolves dependencies and installs them.

[UBUNTU] Install RPM Packages on Ubuntu/Linux Mint

Install RPM Packages on Ubuntu 12.04/11.10/any Ubuntu version/Linux Mint

Ubuntu/Mint Support only deb package installation, If you have some software in rpm package you can install it in Ubuntu/Linux Mint easily. Fedora/Redhat and Mandriva support RPM packages.
In Ubuntu/Linux Mint you can easily install softwares from Software Centers or via PPA. If any software is not available in deb/software center/ppa and it's only available in rpm, than you can easily convert that rpm file to deb package with one command using terminal.
rpm package
This RPM to DEB Conversion Utility called Alien, Which converts packages from one to the other format. It doesn't mean that convert rpm package will always work on your system. Cause there can be problem of Dependencies or libraries.




To install open Terminal (Press Ctrl+Alt+T) and copy the following command in the Terminal:





Now convert package from RPM format to Deb format, use the following command. Change your packagename in command:







option: -c: --scrips; -k: keep name of version
To install the deb package enter following command:






That's it

source: http://www.noobslab.com/2012/02/install-rpm-packages-on-ubuntulinux.html