How to play the flash (.swf) files downloaded from the Web on Linux? The best solution that I find to play .swf files on Linux is run Adobe Flash Player Projector (download from here, a single .EXE file) and run it under wine.
Tag: Linux
Replacing tabs with spaces in Emacs
Posted onHow to replace tabs with spaces in Emacs? You can first select the regions of text for converting/replacing, then run M-x untabify to replace all tabs with appropriate number of spaces. There is also a M-x tabify for replacing sequences of spaces to tabs. There are also commands to convert tabs to spaces or vice
Read more
How to print the name of the current file being edited in Emacs?
Posted onIn Emacs, how to print the name of the current file that I am editing? The built-in function buffer-file-name gives the full path of your file. To get the file name: M-: buffer-file-name
How to sort a file by hexadecimal numbers on Linux using sort command?
Posted onThe sort command has a -n option to sort a file by numbers. However, it does not work with hexadecimal numbers. For example, this file: 400000000 __crt0 400000039 __newr0 400001B14 get_my_task_id 400001C14 get_new_task_id 400001582 input_char 40000166E input_q 400001A5D input_q_exit 400002002 main 4000000DB output_char 400001134 output_char_str 40000100C output_id 40000018F output_q 400000614 output_q_digits 400000B7E output_q_hex 400000D3E output_q_hex_j1
Read more
How to exclude users from GDM login screen?
Posted onHow to exclude users from appearing in the GDM login screen of Gnome 3? There is a long-time bug related to this ( https://bugzilla.redhat.com/show_bug.cgi?id=723708 ) which causes that the /etc/gdm/custom.conf has no effect. The closes workaround I find working on Fedora 20 is to totally disable listing of users (run as root): cat > /etc/dconf/db/gdm.d/01-mysettings
Read more
How to get the git commit tree?
Posted onHow to get a tree-like view of the git commit history? My favorite command line: git log –graph –oneline It will prints a text based graph like (with colors): * b5dc8b9 Merge branch ‘master’ of https://github.com/layerzero/libi0 | | * 7514ef1 revised the README.md a little bit | * 6692428 align size to page for both
Read more
How to fetch a webpage as a mobile browser with curl on Linux?
Posted onOn Linux, how to download a webpage as a mobile browser? You can change the agent of curl to be a mobile browser’s and the remote webserver may be consider the request from a mobile browser: curl -A “Mozilla/5.0 (iPhone; CPU iPhone OS 6_1_3 like Mac OS X) AppleWebKit/536.26 (KHTML, like Gecko) CriOS/28.0.1500.12 Mobile/10B329 Safari/8536.25”
Read more
Generating TAGS file for Emacs recursively?
Posted onHow to generating TAGS file for Emacs recursively? etags seems not support recursively generating TAGS file. I use ctags instead. It can also generate TAGS file for Emacs with the -e option: ctags -e -R . You can also use etags with find: find ./ -print | xargs etags But I prefer the ctags way.
Bash comparison operators
Posted onWhat are all the bash supported comparison operators? The man 1 test contains all the operators supported in bash. An omitted EXPRESSION defaults to false. Otherwise, EXPRESSION is true or false and sets exit status. It is one of: ( EXPRESSION ) EXPRESSION is true ! EXPRESSION EXPRESSION is false EXPRESSION1 -a EXPRESSION2 both EXPRESSION1
Read more
How to find which files are opened by a Linux program?
Posted onHow to find which files are opened by a Linux program? For example, when I run cat ~/.bashrc, how to find out which files are opened by cat? You can achieve this by using strace if the program “open” files using system calls. For example, I run as this: strace -o /tmp/st cat ./.bashrc grep
Read more
How to view DVI files on Linux?
Posted onHow to view the DVI files generated by latex on Linux? It seems evinece can not open it. After install the evince-dvi package, evince should be able to view dvi files: # yum install evince-dvi
How to set up the Java environment in Linux?
Posted onI am using Fedora 20. I installed the rpm from Oracle for the Oracle JDK. How to set up the environment so that the Java environment is Oracle JDK instead of the OpenJDK? The Oracle JDK is install to /usr/java/ directory. On my Fedora 20, it looks like this: $ ls /usr/java -l total 4
Read more
How to force MPlayer to start a video at the center of the screen?
Posted onHow to force MPlayer to start a video at the center of the screen? I assume you are using Linux. Put this line into your ~/.mplayer/config: geometry=50%:50% Check more options in MPlayer manual.
How to improve MPlayer video quality?
Posted onHow to improve MPlayer video quality by selecting a “better” video rendering/filter? You can choose a different video filter. I use hqdn3d which gives me the best quality. Be careful on machines with low CPUs. To use hqdn3d, put this line into your ~/.mplayer/config: vf=hqdn3d Check more options of video filters in MPlayer manual.
How to balance the two columns of text on the last page of a Latex doc?
Posted onHow to balance the two columns of text on the last page of a Latex doc? 2 good Latex packages are good at balancing the two columns of text on the last page of a Latex doc (choose either one that are good for you). balance Usage: At the beginning of the doc: usepackage{balance} At
Read more
How to change the mode for simplified Chinese or Traditional Chinese mode in ibus-libpinyin?
Posted onHow to change the mode for simplified Chinese or Traditional Chinese mode in ibus-libpinyin? What is the shortcut like “Ctrl+.” for switching full width or half width punctuation. Use shortcut “Ctrl + Shift + F”. In ibus-pinyin version 1.3.7, this shortcut is added: 2010-05-28 ibus-pinyin 1.3.7 stable release Add Ctrl + Shift + F to
Read more
How to improve ssh/scp performance on Linux?
Posted onssh/scp are convenient and handy tools on Linux. Is is possible to further improve its speed/performance? Please check this post for how to improve ssh/scp performance: https://www.systutorials.com/5450/improving-sshscp-performance-by-choosing-ciphers/
Direct multi-hop ssh connection
Posted onHow to use multi-hop ssh connection without needs to ssh multiple times? As a example, you are connecting to server.example.com through proxy.example.com from laptop.example.com as follows: laptop —-> proxy —-> server 2 possible methods: Method 1: Use the similar method as in Directly SSH to hosts using internal IPs through the gateway. Add this to
Read more
Hadoop 2 (YARN) default configuration values
Posted onWhere to check the default Hadoop 2 (YARN) configuration values for: HDFS: hdfs-site.xml YARN: yarn-site.xml MapReduce: mapred-site.xml Default Hadoop 2 (YARN) configuration values for Hadoop 2.2.0 from Apache Hadoop website: HDFS: http://hadoop.apache.org/docs/r2.2.0/hadoop-project-dist/hadoop-hdfs/hdfs-default.xml YARN: https://hadoop.apache.org/docs/r2.2.0/hadoop-yarn/hadoop-yarn-common/yarn-default.xml MapReduce: https://hadoop.apache.org/docs/r2.2.0/hadoop-mapreduce-client/hadoop-mapreduce-client-core/mapred-default.xml
How to map Win key to Ctrl on Linux?
Posted onHow to map the Win key to another Ctrl on Linux? You can set it in gnome-tweak-tool in Gnome 3 by setting the “Alt/Win key behavior”: