The command to remove a stuck print job in Linux (CUPS): $ lprm =============== To list HP printers visible across the network: $ hp-probe =============== HP_LaserJet_P2055dn Paused – “/usr/lib/cups/backend/hp failed” SOLUTION: Printer state must be set to “Enabled” # sudo system-config-printer
Author: ench0
Make emacs grep/grep-find ignore .svn directories
Emacs grep and grep-find command used to work great for me until I started working with SVN and all those .svn directories started popping up in my emacs grep searches… So how can we make the emacs grep-find command ignore all the .svn directories? Being mostly a “git” guy, and having been recently introduced to […]
How to uninstall the old kernels in Ubuntu (and grub)
How can we remove the unused linux kernels and at the same time have our boot configuration (grub’s entries in the grub cfg menu) updated? First we want to list all the kernel-related packages, like linux-image and linux-headers, linux-generic, etc: $ dpkg -l linux-* On my 10.04 Ubuntu system the above command results in the […]
How-to check my Linux distro (not kernel!) version
To check your Linux distribution version (i.e. release)… —————————- On Ubuntu/Debian: cat /etc/lsb-release or cat /etc/debian_version —————————- On RedHat/Fedora: $ cat /etc/fedora-release —————————- On Slackware: cat /etc/slackware-version —————————-
HowTo: Listing (changed/untracked) files in git
When working with git it may often be convenient to get a (pure) list of files to give to some other command (e.g. astyle). This may be implemented as a trigger on the server but that has its pros and cons. Listing the modified files and processing them locally is the safest way as this […]
How do I add a new RPM/yum repo in Fedora
To enable a new RPM (yum) repository add a new .repo file for it under /etc/yum.repos.d. For example, to add a repository to install google’s Chrome browser add a file (e.g. google.repo) in the /etc/yum.repos.d directory and copy the following into it: [google-chrome] name=google-chrome – 64-bit baseurl=http://dl.google.com/linux/chrome/rpm/stable/x86_64 enabled=1 gpgcheck=1 gpgkey=https://dl-ssl.google.com/linux/linux_signing_key.pub You may also append the […]
How to convert uuid to dev
In most modern Linuxes, if you look in /etc/fstab you will see something like: UUID=27fb9d06-8122-4a53-9930-97bd9fa57221 /usr ext4 defaults 1 1 This is not very helpful if you’re trying to figure out where your /usr directory is mounted… So how can you convert the UUID of a drive partition to the good old familiar /dev device […]
Embedding resources in netbeans (Java JAR files)
Suppose you want to add some images to your JAR Java application. This has several advantages such as security, portability, conveninece for you and your users (don’t need to copy around several files – everything is nicely packaged and embedded into one JAR file). How can we embed the resources into the app (the .jar)? […]
How to disable Linux FC graphical boot (start in text mode)
For those of you wondering how to make Fedora Linux boot into text mode – here’s how to disable the graphics boot/login screen: If you are running an older distribution you need to edit the file /etc/inittab (must be root) and change id:5:initdefault: to id:3:initdefault: If you are running a NEWER distribution can […]
How to change my terminal prompt (PS1)
On newer distributions you can easily change your terminal prompt, (which is controlled by the PS1 environment variable, btw) by adding a file with the prompt format string to the /etc/profile.d directory. You may name the file whatever you like, e.g. set-prompt.sh, but make sure that inside it there is a line that sets PS1 […]