ELPA manages packages for Emacs nicely. But, how to upgrade packages installed by ELPA in Emacs? Within Emacs, list all packages by M-x list-packages and it will automatically refresh the archive contents. Then, press U to mark all upgradable packages to be upgraded. Last, press x to perform the new updates. Emacs will then download
Read more
Category: QA
Questions and answers.
How to use iptables to limit rates new SSH incoming connections from each IP on Linux?
Posted onHow to use iptables to limit rates new SSH incoming connections from each IP on Linux? For example, at most 6 SSH connection attempts every 60 seconds. You may use these rules (skip the first one, if you have set the basic rules): for tables in iptables ip6tables ; do # Allow established inbound connections
Read more
How to configure iptables on Linux Mint 17.1?
Posted onHow to configure iptables and make the configuration persistent across system restarting on Linux Mint 17.1? You can use the ‘iptables-persistent’ tool. To install iptables-persistency pachage: sudo aptitude install iptables-persistent The you can manipulate the iptables by the ‘iptables’ command. To save the current iptables rules: sudo /etc/init.d/iptables-persistent store It will store the rules for
Read more
Find Available Packages Versions using aptitude in Ubuntu
Posted onHow to find the available packages’ versions with aptitude on Linux? With aptitude, you can use this command to show the available versions of a package: aptitude versions <package name> In the console GUI, aptitude also show the versions. You may also simulate installation of a package and see which version will be installed: aptitude
Read more
How to make Alt key work in xterm?
Posted onAlt key seems not work in xterm. Alt is important for Emacs. How to make Alt key work in xterm? Put this in your ~/.Xresources file: XTerm*eightBitInput: false XTerm*eightBitOutput: true Remember to make it take effect after you change the ~/.Xresource without restarting the X server by xrdb -merge ~/.Xresources
How to install musl libc on Linux Mint 17?
Posted onHow to install musl libc on Linux Mint 17/Ubuntu 14.04? You can install musl libc on Linux Mint 17 by sudo aptitude install musl musl-dev musl-tools One note: If you want to install a newer version of musl libc than the one from Ubuntu repo, you can use this ppa: https://launchpad.net/~bortis/ archive/ubuntu/musl by sudo add-apt-repository
Read more
How to exclude directories with certain names from rsync on Linux?
Posted onHow to exclude directories with certain names like “cache” from rsync on Linux during backup? The “cache” directory may in many different paths, such as file1/cache/ or file2/cache/, and adding all “cache” directories to rsync command is not a doable way. You can use rsync with –exclude=cache/ like rsync -avxP –exclude=cache/ /path/to/src/directory/ /path/to/dst/dir/
How to pull your git tree after creating it on remote server
Posted onCurrently, I have created my branch dev-harry but I cannot pull it successfully as follows. harryxiyou@common_vm ~/forest/kvplus/kvplus $ git branch * dev-harry master rc harryxiyou@common_vm ~/forest/kvplus/kvplus $ git pull You asked me to pull without telling me which branch you want to merge with, and ‘branch.dev-harry.merge’ in your configuration file does not tell me, either.
Read more
How to find the number of files in each directories on Linux?
Posted onHow to find the number of files in each sub-directories of a directory on Linux? For example, . ├── a19 ├── a8 ├── d2 ├── ecfddd └── t1 The number of sub-directories can be quite large. How to find the number of files in each sub-directories here? You can use this piece of script to
Read more
How to check the DNS I am using on Linux?
Posted onMy Linux distro is Linux Mint 17 (Ubuntu 14.04.1 LTS (Trusty Tahr)). I am using NetworkManager. The old trick does not work: $ cat /etc/resolv.conf # Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8) # DO NOT EDIT THIS FILE BY HAND — YOUR CHANGES WILL BE OVERWRITTEN nameserver 127.0.1.1 If you are using
Read more
Get error message on usb2 stick – READ ONLY FILE SYSTEM. What should i do?
Posted onCant read or write to files on usb stick or move or copy them. Could you provide the dmesg output? It will help to understand your question. If it is formated on Windows, you may need to install the ntfs-3g package to write to the usb disk.
How to play 3D movies in MPlayer?
Posted onHow to play 3D movies in MPlayer on normal screen (2D)? You can play 3D movies on 2D screen by mplayer -vo gl_stereo=3 your.movie.file For the gl:stereo=3 option, check MPlayer man page: stereo=value Select a method for stereo display. You may have to use -aspect to fix the aspect value. Add 32 to swap left
Read more
What are the differences between database DDL and DML
Posted onDifferences beween DDL (Data Definition Language) and DML (Data Manipulation Language) Data Definition Language (DDL) statements are used to define the database structure or schema. Data Manipulation Language (DML) statements are used for managing data within schema objects. References:http://www.orafaq.com/faq/what_are_the_difference_between_ddl_dml_and_dcl_commands
Making `fdisk -l` display partition sizes by GB/MB
Posted onHow to make fdisk -l display partition sizes by bytes instead of sectors? fdisk does not have such options as far as I know. However, good news is that you can use parted: # parted -l It will print partition info like # parted -l Model: Linux device-mapper (linear) (dm) Disk /dev/mapper/fedora_vm235-swap: 2164MB Sector size
Read more
What are the DDL and DML of Shark (Spark SQL)?
Posted onCurrently, I wanna take Shark’s (Spark SQL) DDL and DML as an reference to design/implement SQLE’s DDL and DML. However, I cannot find its DDL and DML. I can only find several SQLs in Shark paper[1]. [1] shark paper – http://tab.d-thinker.org/showthread.php?tid=2585 Shark’s language is Hive QL. HQL’s DDL and DML can be found at Hive
Read more
How to change the commit message of a commit in the history (not HEAD)?
Posted onA commit is not the HEAD now. and git commit –amend will not work for it. How to change its commit message? You can use git rebase together with git commit –amend as follows. Assume your commit to be edited is 2b8ed. $ git rebase -i 2b8ed^ Change the pick to edit in the line
Read more
How to disable auto mounting on Linux Mint Cinnamon?
Posted onI prefer Linux Mint (I am using Cinnamon) not automatically mounting a portable storage such as USB disk or iPhone for me and I would like do the mounting manually if I need it. The default behavior of Linux Mint is to automatically mount the disks. How to disable this? The auto mounting on Linux
Read more
Which are sequence points in C?
Posted onWhat are sequence points in C? The comp.lang.c FAQ explains this quite well. A sequence point is a point in time at which the dust has settled and all side effects which have been seen so far are guaranteed to be complete. The sequence points listed in the C standard are: at the end of
Read more
How to remove AdSense ads for mobile devices while keep them for desktops?
Posted onI want to add adsense ads to be shown to visitors on desktop only. How to remove AdSense ads for mobile devices? You can achieve this through using “Responsive ad unit” of AdSense. The support article Create a responsive ad unit from AdSense discusses this and gives an example. Check the “Hiding an ad unit”
Read more
What is database schema?
Posted onAs is known, database schema is a collection of database rules like data type and data relationship. However, this is still a little abstract. So what is database schema in one sentence everyone could understand it clearly. The wikipedia page on Database schema is quite good for understanding the concept. A database schema of a
Read more