Labels

Sunday, 11 June 2017

[Fedora] Install 7zip on fedora

Open terminal, type command

su
[password of root]
yum install p7zip p7zip-plugins 

There are some useful commands with 7zip:

7z a <archive-filename> <list-of-files>  

7z e <archive-filename> 

7z x <archive-filename> 

7z l <archive-filename> 

7z u <archive-filename> <list-of-files-to-update>

7z d <archive-filename> <list-of-files-to-delete> 

7z t <archive-filename> 

Create archive file:  a

Extract archive file in current directory: e or x

List all files in archive file: l

Update file in archive file: u

Delete file in archive file: d

Test the integrity: t 

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

Wednesday, 31 December 2014

[Windows 7 Install] Unable to copy files using windows 7 usb/dvd download tool

Sometimes if your USB stick has something in its MBR you might get the error
Windows 7 USB/DVD Download Tool error: We were unable to copy your files. Please check your USB device and the selected ISO file and try again.
You have to start command prompt as an Administrator (On Windows 7 that means right clicking the cmd and selecting Run as Administrator) and use the diskpart utility.


WARNING: Be careful to select the right drive or else your day won’t have a happy end because if you select the wrong drive you will lose all your data on this drive!


Instead of formatting the partition with FAT32, you can also use NTFS (like WUDT does), but then you need an extra step to make the drive bootable:
Bootsect.exe /nt60 X:
“X:” is the drive letter of your USB stick. Bootsect.exe can be found on the Windows 7 DVD in the boot folder. However, I can’t really recommend using NTFS. Some USB stick, at least, appeared to be slower with NTFS.
  1. Start command prompt as Administrator and type  diskpart 
  2. type  list disk
  3. type select disk  and number of your USB disk (Base on USB capacity like select disk 1 )
  4. type  clean
  5. type  create partition primary
  6. type  select partition 1
  7. type  active
  8. type  format quick fs=fat32
  9. type  assign
  10. type exit  to exit the diskpart utility
  11. type exit  to close command prompt





diskpart

Source: http://answers.microsoft.com/en-us/windows/forum/windows_7-windows_install/unable-to-copy-files-using-windows-7-usbdvd/bd21e76d-5174-4f76-8db5-36df105a12c5

Saturday, 13 December 2014

[ANDROID] The styles.xml file is not generated in my android project

ERROR: The styles.xml file is not generated in my android project.

SOLUTION:
I fixed mine by downgrading as seen at this other SO discussion using the version 23.0.5 (I'd post direct links, but I don't have enough points here to post more than two).
Again, I have no idea WHY this is happening, only that it prevents me from creating new projects with the latest SDK.

ACTION:
Anyway, for those who want to downgrade Android SDK Tools to a previous version, it can be possible following these steps:
  1. Find your Android SDK folder
  2. Locate the "tools" subfolder and rename it to "tools1" (just to keep a backup copy of the original tools folder)
  3. Download from google repository the SDK Tool version you want to downgrade to (for instance: http://dl-ssl.google.com/android/repository/tools_r22.6.2-macosx.zip) and unpack it.
  4. The ZIP file you downloaded contains a tools folder that has to be moved to your Android SDK folder.
NOTE: 
Now download the tools by using the following pattern:
http://dl-ssl.google.com/android/repository/tools_rXXX windows.zip 
http://dl-ssl.google.com/android/repository/tools_rXXX-linux.zip http://dl-ssl.google.com/android/repository/tools_rXXX-macosx.zip 

Where you must replace XXX with the exact revision number noted above. For example, to download revision 23.0.5 for Windows , download the file:
http://dl-ssl.google.com/android/repository/tools_r23.0.5-windows.zip

Source: http://stackoverflow.com/questions/9555337/how-to-downgrade-my-sdk-version


 

 

Friday, 12 December 2014

[SOLVED] Android Studio install problem, fails saying components not installed

ERROR:
The following SDK components were not installed: extra-android-m2repository, tools, addon-google_apis-google-21, android-21, sys-img-x86-addon-google_apis-google-21, source-21, extra-google-m2repository "

SOLUTION:

It seems there is a problem with the default installer of Android Studio 1.0.0, the one that contain both the IDE and di SDK Tools: the default installation path for the android sdk tools ends with myInstallPath../sdk/android-sdk but the first run setting for the Android Studio points at myInstallPath../sdk. So here is what i did.

  • Step 1:
  • Cut & Paste the content of the android-sdk folder outside the  sdk folder, so the files are under:
  •  myInstallPath../android-sdk
  •  myInstallPath../sdk/
  • Step 2:
  • Use SDK Manager from the new location to update everything (Use this instead of the automatic wizard, you can select which package you want or need and you get also the speed and estimate time for the download)
  • Step 3:
  • Run Android Studio (it should load and check that the SDK is up to date and start the creation of an AVD, after that the IDE will load completely)
UPDATE - Workaround for the "download interrupted: read timed out" problem
The firewall and the proxy prevented my SDK Manager to download some updates, so i've recovered the .xml url for these updates, searched for the .zip files i needed and directly downloaded them with the help of a download manager, then i've manually installed them in their relative folder under the sdk folder ..a bit tricky but worked for me. For example in the Addon_xml_file i've searched for the m2repository, found the entry and downloaded the archive with the link m2repository_r14_zip_file. You always find the files you need in the same base as the .xml file (take a look at the url i've posted for the example).

Source: http://stackoverflow.com/questions/27376465/android-studio-doesnt-start-fails-saying-components-not-installed

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

Thursday, 17 July 2014

Shoud we use EJB in our project

To me this thread shows exactly what is wrong with our profession. Too many people read the marketing literature and take it as gospel.

You use EJB when and only when you need the container services. That is, transaction, persistence and security. Now if you follow the advice of most and don't use Entity beans that leaves you with security and transaction. Very few people use the security features on EJB so that leaves you with transactions. There are many other often easier ways to deal with transactions though so it is still questionable if you ever need EJB.

Let us examine some of the comments made so far.

1. Scalability - Why is it more scalable? If you are using Stateless session beans you are scalable because you are stateless. But if you are stateless it is just as easy to use POJOs (Plain old Java Objects) . Stateless design leads to better scalability but EJBs are not necessary to make your application stateless. Again the only advantage is the container services provides - otherwise it is just code folks - and your code will work just fine.

While we are at it lets address another common misconception. Lifecycle management. It is often claimed that EJB gives you some necessary lifecycle management and object pooling. It also is supposed to help you in a multi threaded environment. The trouble with this claim is that if you are stateless there are no threading issues and you only need one instance to handle all of your clients on a server. Servlets and stateless Session beans are essentially equivalent ( keep in mind that HTTPServlets are only one type of Servlet). In the world of Servlets the spec allowed you to either create a new Servlet for every client or to use one and make it thread safe. Every servlet container does it the second way and yet EJB only allows containers to do it the first way.

2. Performance - ??? What are they doing to improve performance. I can either call an object directly or go through layers of infrastructure - which do you think would be faster. Again only if we need the infrastructure is it an advantage (and NONE of the EJB infrastructure is to help with performance).

3. Maintainability - If I use OO programming methodology instead of the procedural based EJB I will be better off not worse off here. Why do people think that only EJB will get you modularity? Also testability is more difficult with EJB then POJOs and by decreasing testability I decress maintainability.

4. Different clients - Granted you need a server to handle the different clients but you don't need EJB for them to all call the same code. You just need the same object to call. Objects themselves don't care about who your client is. If I have some object Foo with method bar and that method is such that I can have copies of it in different app servers that are all the same ( a requirement for clustering) then all I have to do is have each client create a Foo and call foo.bar(). Why is it better to do the JNDI lookup to find the Foo (when they are all the same) and then use an RMI layer to call the bar. Even if we are calling the database here it is the conection pooling and the database that gives you your advantages - and there were connection pools long before there were app servers and you can use them in an AppServer even if you are a POJO.

5. Database access - One poster said if you use your JSP/Servlets to access the database all the time it will be slower because you don't get help from the container. This is a false dichotomy. I can still have an object layer and a data access layer and never have my JSP/Servlets directly make SQL calls. I don't need EJB for that and unless you are using Entity beans which means you have an extremely simple domain model, the container is doing nothing for you here.

History is important here. EJB arose out of a desire to make CORBA easier to deal with. The reason you would use CORBA is as an integration technology. You had a system (maybe an old batch system) that you wanted to access from an OO or other program. With a CORBA interface you could make it more object like to the client. When doing this properly there were some cross cutting concerns that crop up like Transaction management, Security etc that people designed frameworks to get around. EJB was supposed to help here. The problem is that the context - a wrapper for older technology or across system boundaries was lost and now people advocate using EJB when it is all one system, you don't distribute, and it is a brand new app. But why? I love JMS for integration but I don't think you should endlessly send messages to yourself within an application.

Most projects should have at most one or two EJBs but I see people create systems with hundreds of them. This is stupid and wasteful. You have made your build times longer, your deployments more complex, and your code harder to test. What would be better for our industry is for people to actually learn about OO Design and stop with trying to shove procedural technology in the way and calling that progress.

source: http://www.theserverside.com/discussions/thread.tss?thread_id=30165