How to use HP Printer connected with USB on Fedora Linux 19. Install these packages and it may ask you to download and install other plugins. Without these packages, my printer does work. # yum install hplip hplip-gui hpijs May also need to run: # hp-plugin to install plugins for the HP printer. This plays
Read more
Tag: Linux
PDF annotation tools on Linux
Posted onWhat are good PDF annotation tools on Linux? Preferring saving the annotation in the PDF instead of separate files or images. I find the best solution may be wine + Foxit Reader. Foxit Reader can annotate PDF files and save them. It works very well on wine. Steps to install them: Install wine # yum
Read more
How to install WordPress on Fedora 19
Posted onHow to install the latest WordPress on a newly installed Fedora 19? Thanks! First, install the LAMP (you already have ‘L’) stack: # yum install httpd php php-mysql mysql-server php-gd and start these services: # systemctl start mysqld.service httpd.service Then, install WordPress on the LAMP stack following the tutorials on the Web. Two good ones
Read more
How to spawn a background process in a bash script
Posted onFor example, I want to spawn many ssh background processes in one bash script: for i in `cat ./all-hosts` do ssh $i “ifconfig | grep Link” done Simply adding a & to the ssh commands does not work. Here is the script that works: for i in `cat ./all-hosts` do ssh $i “ifconfig | grep
Read more
Force Linux to reboot
Posted onHow to force Linux to reboot when the reboot command does not work. Enable the use of the magic SysRq option: # echo 1 > /proc/sys/kernel/sysrq Reboot the machine: # echo b > /proc/sysrq-trigger Even if you could not log on the system but sshd is working, you can force the Linux to reboot by:
Read more
How to install Scala on Fedora Linux
Posted onThis tutorial introduces how to install Scala 2.9.2 on 64-bit Fedora Linux 17. There are some changes needed to make scala work on Fedora Linux 17. Please check it out in the answer. Install Java Scala depends on Java, so please install Java first. In this tutorial, we installed JDK to: /usr/java/jdk1.6.0_24/lib/. Install Scala from
Read more
How to exclude certain repositories in yum?
Posted onThis tutorial introduces how to exclude certain repositories in yum. Excluding certain repositories is needed usually. One example may be when you have several repositories that have the same package and you only want the one from a certain repository. For my situation, I choose to exclude the google-chrome and other repositories from Google when
Read more
How to install Scala from the official Scala distribution
Posted onHow to install Scala from the official Scala distribution? This is needed on a Linux release with older version of Scala in the repository, e.g. Fedora 12. Use the install-scala.sh script: # wget https://raw2.github.com/zma/usefulscripts/master/script/install-scala.sh # sh ./install-scala.sh VER where VER is the scala version that you want to install. First step, install and configure the
Read more
Plain text file pipelined to Linux mailx turns to “Content-Type: application/octet-stream” (an attachment)
Posted onPlain text file pipelined to Linux mailx turns to “Content-Type: application/octet-stream” which is recognized as an attachment by some email client. The command is like this: $ cat log.txt | mail -s “Updated log file” -r “from@example.com” “to@example.com” I expect it to be: Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit But it turns out to be: Content-Type:
Read more
Where are the Linux routing table entries stored on disk?
Posted onI know the routing tables on Linux is in memory after being set. However, where are the routing table entries stored on disk? I mean where are the routing table is persistently stored so that the routing table can be reloaded like the iptables (under /etc/sysconfig/iptables on Fedora/RHEL/CentOS Linuxes). If the system uses the /etc/rc.d/init.d/network
Read more
How to print the text in a web page?
Posted onHow to efficiently print a webpage? E.g. I want to only print the text for some pages but with figures for some other pages. I tried to copy the webpage to a document, but the format turns to be just terrible. One good tool that I use is PrinterFriendly which can convert a webpage to
Read more
Grub2: How to boot Fedora to an old kernel?
Posted onGrub2: How to boot Fedora to an old kernel? The old kernel is a submenu under “Advanced options for Fedora”. It is not shown if I follow the instruction that # grep menuentry /boot/grub2/grub.cfg | cut -d “‘” -f2. The old kernel in grub2 is in a submenu entry in a menu. The key is
Read more
Good tools to manage OCaml packages
Posted onWhich tools to mange OCaml packages in my system (Linux)? I use OPAM to manage OCaml packages: http://opam.ocamlpro.com/index.html To install it: $ wget https://raw.githubusercontent.com/ocaml/opam/master/shell/opam_installer.sh $ sh ./opam_installer.sh /usr/local/bin More options are available here. To make opam settings take effect, append this to ~/.bashrc: eval `opam config env` Some frequent usages: opam list # List all
Read more
Length of int in OCaml?
Posted onWhat is the length of int in OCaml? It is said that int in OCaml is 31. But I get this: # (1 lsl 33);; – : int = 8589934592 8589934592 is larger than 2^31. On my laptop (64-bit Fedora Linux), the int in OCaml is 63 bits. The code (count1s counts the number of
Read more
How to call C functions from OCaml code
Posted onI am writing a OCaml program but want to call some C functions provided in some source code or library. How to achieve this? Is there any good tutorials on this? A very good tutorial that is easy to follow and understand: How to wrap C functions to OCaml. A comprehensive reference manual: Chapter 19
Read more
How to set Google Chrome’s proxy settings in command line on Linux?
Posted onHow to set Google Chrome’s proxy settings in command line on Linux? I am using Google Chrome on Linux and start it by google-chrome. How can I set the proxy using the command line? It tell me that my desktop is not supported but I can set the proxy in command line. Use the –proxy-server
Read more
Add readline features in OCaml toplevel
Posted onIt is painful for a Linux user to use the OCaml toplevel without the readline features. Is there a method to enable/add these kinds of features in readline to the OCaml toplevel? I find 2 options that work very well for me: utop provides a beautiful interface and supports completion, colors, parenthesis matching, etc. It
Read more
How to install .deb packages on Fedora?
Posted onI come across some closed source software that only provides .deb packages. Fedora manages packages with rpm/yum. How to install the .deb packages on Fedora? Alien is a tool to convert .deb package to .rpm package: http://joeyh.name/code/alien/ In latest Fedora, the tool alien is in Fedora’s repository. You can use dnf to install the package.
Read more
How to turn my iPhone to a mouse?
Posted oniPhone has the touch screen. Is is possible to turn my iPhone to a wireless mouse on Linux? Use the WiFi Mouse app/server: http://wifimouse.necta.us/ First, install the WiFi Mouse app on you iPhone: https://itunes.apple.com/app/id591076411?mt=8 Second, install the WiFi Mouse server downloaded from http://wifimouse.necta.us/ If you are using Fedora Linux, you need to convert the .deb
Read more
Chrome’s KDE proxy integration broken on KDE / Fedora
Posted onChrome reads the proxy settings from Gnome correctly. However, when I run Chrome under KDE, the proxy integration is broken: In the settings of Chrome, clicking the “Change proxy settings” opens the KDE proxy setting dialog correctly (the command kcmshell4 proxy actually is executed). However, after the proxy settings are made, Chrome does not read
Read more