1. Install poppler-utils
2. To extract original embedded images:
$ pdfimages -j <file.pdf> <to_dir>
3. To extract text:
$ pdftotext -j <file.pdf>
1. Install poppler-utils
2. To extract original embedded images:
$ pdfimages -j <file.pdf> <to_dir>
3. To extract text:
$ pdftotext -j <file.pdf>
Many companies try very hard to avoid using open source solutions in Singapore because the general impression is that support is poor.
A quick googling suggests that these vendors do provide professional support in Singapore:
Do you know of other vendors in this business? Let me know so that I can grow this list. When it’s substantial, maybe more Singapore companies will be willing to try open source solutions. 🙂
‘crontab -e’ kept telling me ‘crontab: no changes made to crontab’ even though I’ve made changes. When I run ‘crontab -l’ to check, my changes were not saved.
Turned out it’s due to my environment variable:
export EDITOR=/usr/bin/gvim
Changing it to vim solves the problem:
export EDITOR=/usr/bin/vim
I had a dual-booting laptop with Linux Mint and Windows XP on it. After deleting the Linux Mint partitions, it failed to boot into XP because grub can no longer find the MBR. This was the error message:
error: no such partition grub rescue>
Solution:
Boot into SystemRescueCD and run this command to create a new MBR:
lilo -M /dev/sda mbr
Note: My XP resides in /dev/sda.
I thought this command should show me which repo the package ‘htop’ belongs to, but I was wrong:
[root@server ~]# yum info htop
Loaded plugins: rhnplugin, security
Installed Packages
Name : htop
Arch : x86_64
Version : 0.8.3
Release : 1.el5
Size : 136 k
Repo : installed
Summary : Interactive process viewer
URL : http://htop.sourceforge.net/
License : GPL+
Description: htop is an interactive text-mode process viewer for...
Notice that it merely indicates ‘installed’ for the ‘Repo’ field? Not very helpful here. I wonder why yum works this way.
To find out which repo ‘htop’ comes from, use this command instead:
[root@server ~]# yum provides `which htop` Loaded plugins: rhnplugin, security htop-0.8.3-1.el5.x86_64 : Interactive process viewer Repo : epel Matched from: Filename : /usr/bin/htop htop-0.8.3-1.el5.x86_64 : Interactive process viewer Repo : installed Matched from: Other : Provides-match: /usr/bin/htop
See ‘epel’ there? Bingo!
By default, TAB runs the ‘complete’ function whereas ‘\C-n’ runs ‘menu-complete’ and ‘\C-p’ runs ‘menu-complete-backward’.
So, let’s say you have .bash_history, .bash_logout and .bashrc in your current directory. When you type “ls .bash<TAB>“, this will be shown:
$ ls .bash<TAB>
.bash_history .bash_logout .bashrc
When you hit CTRL+N (next) now, the auto completion will replace ‘.bash’ with the first match from the list of possible completions, i.e. ‘.bash_history’. Repeated CTRL+N steps through the list of possible completions, inserting each match in turn.
CTRL+P (previous) moves backward through the list and matches in reverse sequence.
Environment: VirtualBox v4.1.8
<vm>.vdi hard disk file from the old machine’s "$HOME/.VirtualBox/VDI" to the new machine.<vm> directory from the old machine’s "$HOME/VirtualBox VMs" to the new machine."$HOME/VirtualBox VMs/<vm>/<vm>.vbox" file to change the old <HardDisk> location to that of the new machine.vbox file to load it into VirtualBox.(1) Join the 2 separate PDFs into 1 file (e.g. joined.pdf) using tools such as pdfunite, pdfsam or pdfshuffler.
(2) Install pdfjam.
(Note: If you’re using Arch Linux, pdfjam is included in the texlive-bin package)
(3) Use the pdfnup tool from the pdfjam package to merge page 1 and page 2 of joined.pdf into a new pdf file consisting of only a single page, with page 1 stacked on top of page 2:
$ pdfnup joined.pdf --nup 1x2
$ netstat -i
Look under the last column “Flg” for value “P”. If it’s there, it means promiscuous mode is enabled for that network interface. Is the flag really P and not M? Here’s a quick test. Check existing active flags:
[root@localhost ~]# netstat -i Kernel Interface table
Iface MTU Met RX-OK RX-ERR RX-DRP RX-OVR TX-OK TX-ERR TX-DRP TX-OVR Flg
eth0 1500 0 2075 0 0 0 1366 0 0 0 BMRU
lo 16436 0 1985 0 0 0 1985 0 0 0 LRU
Turn multicast off on eth0:
[root@localhost ~]# ip link set eth0 multicast off
Notice that the ‘M’ flag is gone? So, M is for multicast:
[root@localhost ~]# netstat -i Kernel Interface table
Iface MTU Met RX-OK RX-ERR RX-DRP RX-OVR TX-OK TX-ERR TX-DRP TX-OVR Flg
eth0 1500 0 2075 0 0 0 1369 0 0 0 BRU
lo 16436 0 1985 0 0 0 1985 0 0 0 LRU
Turn promiscuous mode on:
[root@localhost ~]# ip link set eth0 promisc on
Notice that the ‘P’ flag is now shown:
[root@localhost ~]# netstat -i Kernel Interface table
Iface MTU Met RX-OK RX-ERR RX-DRP RX-OVR TX-OK TX-ERR TX-DRP TX-OVR Flg
eth0 1500 0 2075 0 0 0 1370 0 0 0 BPRU
lo 16436 0 1985 0 0 0 1985 0 0 0 LRU
UPDATE 20130531: This post wrongly indicated that the “M” flag indicates promiscuous mode. Sorry for the confusion. I got that from other incorrect sources as well. It seems quite many online sources got that wrong. Thanks to the helpful commenters for correcting this mistake.
After upgrading Ubuntu 11.04 (Natty Narwhal) to 11.10 (Oneiric Ocelot), GVim starts to behave weirdly.
6 May 2012 UPDATE: Issue persists even after upgrading to 12.04 (Precise Pangolin)! 🙁
Symptoms:
** (gvim:5933): IBUS-WARNING **: Create input context failed: Timeout was reached.** (gvim:5760): WARNING **: Unable to register window with path '/com/canonical/menu/5C00024': Timeout was reachedWorkaround:
Run gvim -f instead of just gvim.
Put this in your .bashrc if you don’t want to add -f all the time, or if you already have other aliases using gvim and you don’t want to change all of them:
gvim(){ setsid /usr/bin/gvim -f "$@"; }