Archive for the ‘Gnome’ Category

Remove password prompt on GNOME Shutdown / Restart on Debian and Ubuntu Linux

Saturday, June 1st, 2013

It is ultra annoying, that in newest Debian and Ubuntu releases with GNOME 3 Desktop environment on every shutdown or restart you need to type in Super User (root) password, to authorize shutdown / restart.

Generally prompting for root password on GNOME restart is obviously a good think from security point of view, but from usability one – especially on notebooks it is useless annoyance…

So after changing this behavior I came up with this tiny article on how to get rid of GNOME Shutdown / Restart password prompt.

There is a click button (on left of Auth prompt on Shutdown showing URL to XML policy rule from where this behavior is controlled. A really good hint to where to look for to change those annoying behavior…

 Here is how to change this new annoying behavior to old GNOME 2 default restart with no root password prompt .
linux:~# gedit /usr/share/polkit-1/actions/org.freedesktop.consolekit.policy
 

Find in XML source sections:
 

Restart the system when multiple users are logged in System policy prevents restarting the system when other users are logged in no auth_admin_keep
Stop the system when multiple users are logged in System policy prevents stopping the system when other users are logged in no auth_admin_keep

To change Restart and Shutdown GUI behavior to not prompt for password, you need to modify in above code:

auth_admin_keep
To:

yes

After changes both sections should look like so:

<action id="org.freedesktop.consolekit.system.restart">
<description>Restart the system</description>
<message>System policy prevents restarting the system</message>
<defaults>
<allow_inactive>no</allow_inactive>
<allow_active>yes</allow_active>
</defaults>
</action>

<action id="org.freedesktop.consolekit.system.restart-multiple-users">
<description>Restart the system when multiple users are logged in</description>
<message>System policy prevents restarting the system when other users are logged in</message>
<defaults>
<allow_inactive>no</allow_inactive>
<allow_active>yes</allow_active>
</defaults>
</action>
 

That's all you finally get rid of the annoying prompt for root password. Enjoy 🙂

Save ( Extract ) only images from PDF files on GNU / Linux in console and in GNOME nautilus

Wednesday, November 14th, 2012

extract only pictures / ( images ) from PDF / PDF save only images

Some time ago, I've blogged how it is possible to dump a PDF individual pages into JPG / PNG etc. pics.

Today interestingly, I've learned it is possible to not only dump single or whole PDF document pages into pictures but also to selectively dump only the pictures contained within  PDF file into JPEGs.

Dumping only PDF (contained) images into external JPEG files is doable on GNU / Linux with pdfimages.

1. Extracting pictures from PDF in text console / terminal

pdfimages is part of poppler-utils deb package, if for some reasons you don't have pdfimages on ur system install poppler-utils with;

apt-get install --yes poppler-utils

To extract images of a certain PDF from terminal / console command line it is as simple as:

pdfimages -j pdf-file-name.pdf prefix-of-output-file

pdfimages
will extract all pictures, but bear in mind with some PDF versions it might incorrectly dump some text pages thinking it is pictures too. Also with some PDFs which contain scanned very old paper documents (as pictures) trying to force pdfimages to dump it will just provide you with all pages of the PDF in JPGs. Option -j instructs dumping images from PDF in JPEG picture format, whether the second argument will save pictures in files like: prefix-of-output-file-000.jpg, prefix-of-output-file-001.jpg, prefix..-file-002.jpg etc.

2. Adding GNOME nautilus capability to extract images from PDF files

Enabling extracting images in nautilus is possible with one non-default nautilus plugin  nautilus-scripts-manager

nautilis-scripts-manager is very nice, but I'm sure many Linux users did not know it yet. It makes possible to add any custom shell script that does an opeartion to be visible in nautilus via one extra menu Scripts. As not normally needed on most Linux distributions, it is not installed by default so you have to install it:

noah:~# apt-get install --yes nautilus-scripts-manager

Below is a Screenshot from my nautilus Scripts menu (my locale is in Bulgarian), so Scripts word is in Cyrillic "Скриптове" 🙂

nautilus scripts menu screenshot - allowing users to add custom shell scripts to run in GNOME desktop extract pictures from PDF Linux

After nautilus-scripts-manager is installed. To use it in your user home directory you will have to create ~/.gnome/nautilus-scripts, i.e.

$ mkdir ~/.gnome2/nautilus-scripts

Any script placed inside can be then invoked via the newly appeared nautilus "Scripts" menu. Thus to use extract_images_from_pdfs.sh from GUI place it there.

Download the following extract_images_from_pdfs.sh shell script

$ cd ~/.gnome2/nautilus-scripts
$ wget -q https://www.pc-freak.net/files/extract_images_from_pdfs.sh
$ chmod +x extract_images_from_pdfs.sh

If you prefer to copy paste script content:

$ cat ~/.gnome2/nautilus-scripts/extract_images_from_pdf.sh
#!/bin/bash
# Extracts image files from PDF files
# For more information see www.boekhoff.info
## Added check for $1 existence and $1_images dir
existence check by hip0
# https://www.pc-freak.net/blog/
if [ $1 ]; then
if [ ! -d ./$1_images ]; then
mkdir -p ./"$1_images"
fi
pdfimages -j "$1" ./"$1_images"/PDFimage
gdialog --title "Report" --msgbox "Images were successfully extracted!"
exit 0
fi

 

Well that's all. Once you select a PDF and you click with last mouse button on it selecting Scripts -> extract_images_from_pdf.sh a new directory containing the filename prefix of the selected PDF with _images will appear. For exmpl. if pictures are extracted from PDF named filename.PDF in same directory where the file is present you will get new filename_images folder with all pictures dumped from the PDF.

I've learned about pdfimages existence from Sven Boekhoff's blog which btw has plenty of interesting other stuff

 

Well that's it hope this helps, someone. Comments are welcome 🙂

How to install GNOME server on Ubuntu 10.04.2 LTS Lucid

Wednesday, April 20th, 2011

After some upgrades of Ubuntu from 9.10 to Ubuntu 10.04.2, I faced problems during apt-get upgrade && apt-get dist-upgrade

I had to fix it up with apt-get upgrade -f , however the “fix” which was targetting a fix up to the apt-get dist-upgrade removed about 260 packages, among which were the grub boot loader , xorg-server and even gnome

As in order to fix the package mishap the apt-get update -f was my only possible solution I went by and confirmed that I would like to wipe out all the packages.

Logically afterwards it was required that I install my missing xorg-server and gnome in order to make the Ubuntu desktop work again.

Here is how:

ubuntu:~# apt-get update && apt-get xorg-server ubuntu-desktop

The ubuntu-desktop is a meta package which installs the GNOME environment.

End of Management Games / Lectures

Wednesday, April 16th, 2008

Today was the last day of the lectures with Joop Vinke. Here is how my day passed. I woke up at 9:00, washed my teeth dressed combed my hair and went to the police station to look for our quarter police officer. I need to renew my personal ID card because it has been expired already for 4 years already. Thanks God everything went smoothly in the police station. After that I went to school we had lectures with Joop Vinke. After the school I went home and played around with my FreeBSD system. I succesfully upgraded gnome 2.20 to 2.22.

Using the binary packages from

http://www.marcuscom.com/tb/packages/7-STABLE-FreeBSD/gnome/. I’m trying to upgrade gnome from source for already almost 3 weeks with portmanager. After all of the required ports rebuilded still gnome wasn’t functioning, so in order to make it working I downloaded packages from http://www.marcuscom.com/tb/packages/7-STABLE-FreeBSD/gnome/ and ran a little loop with

for i in *; do pkg_add -vf $i; done

 

to make all the .tbz files install I did that yesterday night today at the afternoon everything was installed and gnome ran just fine I only had to link few libraries because they were searched on a different places. All works just fine now I only have to rebuild few of my games because they’re now linked to an old libraries. In the evening we went out with Javor for a coffee. As very often we went to the fountain we had a nice talk and then we went to his apartment to watch a film. He recommended a film called 1984 and we watched that. My impression is that this film is totally psychodelic and freaky, but still interesting to see. After I went home I went to see my grandma and now I’m home tired on a few steps of my bed 🙂 I should also mention that today I upgraded clamav on 3 of the servers I maintain. It seems there are few configuration options which changed in the new clamav release (0.93). It was an easy day as a whole if we don’t count my physical infirmity.

END—–

How to mount ISO image files in Graphical Environment (GUI) on Ubuntu and Debian GNU/Linux

Saturday, January 14th, 2012

Mounting ISO files in Linux is easy with mount cmd, however remembering the exact command one has to issue is a hard task because mounting ISO files is not a common task.

Mounting ISO files directly by clicking on the ISO file is very nice, especially for lazy people uninitiated with the command line 😉

Besides that I'm sure many Windows users are curious if there is an equivallent program to DaemonTools for Linux / BSD*?

The answer to this question is YES!
There are two major programs which can be used as a DaemonTools substitute on Linux:

These are FuriousISOMount and AcetoneISO
AcetoneISO is more known and I've used it some long time ago and if I'm correct it used to be one of the first ISO Mount GUI programs for Linux. There is a project called GMount-ISO / (GMountISO) which of the time of writting this article seems to be dead (at least I couldn't find the source code).

Luckily FuriousISOMount and AcetoneISO are pretty easy to install and either one of the two is nowdays existing in most Linux distributions.
Probably the programs can also be easily run on BSD platform also quite easily using bsd linux emulation.
If someone has tried something to mount GUIs in Free/Net/OpenBSD, I'll be interesting to hear how?

1. Mount ISO files GUI in GNOME with Furius ISO Mount

FuriousISOMount is a simple Gtk+ interface to mount -t iso9660 -o loop command.

To start using the program on Debian / Ubuntu install with apt;

debian:~# apt-get install furiusisomount
The following extra packages will be installed:
fuseiso fuseiso9660 libumlib0
The following NEW packages will be installed:
furiusisomount fuseiso fuseiso9660 libumlib0

To access the program in GNOME after install use;

Applications -> Accessories -> Furious ISO Mount

Screenshot ISO Mount Tool Debian GNU/Linux Screenshot
 

When mounting it is important to choose Loop option to mount the iso instead of Fuse

After the program is installed to associate the (.iso) ISO files, to permanently be opened with furiusisomount roll over the .iso file and choose Open With -> Other Application -> (Use a custom command) -> furiusisomount

GNOME Open with menu Debian GNU / Linux

2. Mount ISO Files in KDE Graphical Environment with AcetoneISO

AcetoneISO is build on top of KDE's QT library and isway more feature rich than furiousisomount.
Installing AcetoneISO Ubuntu and Debian is done with:

debian:~# apt-get install acetoneiso
The following NEW packages will be installed:
acetoneiso gnupg-agent gnupg2 libksba8 pinentry-gtk2 pinentry-qt4
0 upgraded, 6 newly installed, 0 to remove and 35 not upgraded.
Need to get 3,963 kB of archives.
After this operation, 8,974 kB of additional disk space will be used.
...

Screenshot Furius ISO Mount Tool Debian GNU/Linux ScreenShot

AcetoneISO supports:
 

  • conversion between different ISO formats
  • burn images to disc
  • split ISO image volumes
  • encrypt images
  • extract password protected files

Complete list of the rich functionality AcetoneISO offers is to be found on http://www.acetoneteam.org/viewpage.php?page_id=6
To start the program via the GNOME menus use;

Applications -> Accessories -> Sound & Video -> AcetoneISO

I personally don't like AcetoneISO as I'm not a KDE user and I see the functionality this program offers as to rich and mostly unnecessery for the simple purpose of mounting an ISO.

3. Mount ISO image files using the mount command

If you're a console guy and still prefer mounting ISO with the mount command instead of using fancy gui stuff use:

# mount -t iso9660 -o loop /home/binary/someiso.iso /home/username/Iso_Directory_Name