Compressing PDFs in Bash

I have scripts for hplip to scan PDF’s to folders using the ADF. These PDFs are very large. To convert these to smaller file-sizes for emailing, I added the following functions to .bashrc. mediumpdf() { read -p “Enter input PDF filename: ” name \ && gs -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 \ -dPDFSETTINGS=/printer -sOutputFile=medium-quality-$name $name; } smallpdf() { read -p “Enter input PDF filename: ” name \ && gs -dNOPAUSE…
Read more

Taskfreak v.7.2

Taskfreak was a great web application developed years ago.  The main website doesn’t have updated versions and the software doesn’t work on many newer configurations.  To remedy this, I have created a v.7.2 fork at Github.  The fork has the SQL syntax corrected, and will contain some updates time goes by.

Office 2007 and Wine with dual prefix

When configuring Wine in the form in the previous article, the first prefix created may be 64-bit.  In this situation, e-sword installed correctly.  An issue presented itself when attempting to run Microsoft Office 2007 related to MSXML5 installation.  This issue prevents adding custom buttons to the quick access bar, adding the data analysis add-ons to Excel, and it even prevents saving files in Word or other documents.  The solution…
Read more

Pycharm 2017.3 launcher icon

Pycharm 2017.3 doesn’t create a launcher icon like 2017.2.  This must be created manually.  Here is a functional one. [Desktop Entry] Version=1.0 Name=Pycharm 2017.3.3 Comment=Software Development GenericName=Pycharm Exec=sh /opt/pycharm-community-2017.3.3/bin/ Terminal=false X-MultipleArgs=false Type=Application Icon=/opt/pycharm-community-2017.3.3/bin/pycharm.png Categories=Development; MimeType=text/html;text/xml;application/xhtml+xml Keywords=programming;python;ide; Name[en_US]=Pycharm The list of available categories so that it appears correctly in application menus is over at the page for the Gnome Desktop Menu Specification.  Development is used to make it appear in…
Read more

32 Bit Wine on CentOS 7

This process is confirmed with Wine 2.0 and CentOS 7 (updated through December 31, 2017). As root: yum install samba-winbind-clients yum groupinstall ‘Development Tools’ yum install libjpeg-turbo-devel libtiff-devel freetype-devel yum install glibc-devel.{i686,x86_64} libgcc.{i686,x86_64} libX11-devel.{i686,x86_64} freetype-devel.{i686,x86_64} gnutls-devel.{i686,x86_64} libxml2-devel.{i686,x86_64} libjpeg-turbo-devel.{i686,x86_64} libpng-devel.{i686,x86_64} libXrender-devel.{i686,x86_64} alsa-lib-devel.{i686,x86_64} glib2-devel.{i686,x86_64} libSM-devel.{i686,x86_64} yum install glibc-devel libstdc++-devel icoutils openal-soft-devel prelink gstreamer-plugins-base-devel gstreamer-devel ImageMagick-devel fontpackages-devel libv4l-devel gsm-devel giflib-devel libXxf86dga-devel mesa-libOSMesa-devel isdn4k-utils-devel libgphoto2-devel fontforge libusb-devel lcms2-devel audiofile-devel yum install openldap-devel libxslt-devel…
Read more

Zip files and UUID from Bash

Two quick items for .bashrc.  The archive command takes a folder name and zips its contents.  The UUID produces a unique number easily. archive() { read -p “Enter folder name: ” name && zip -rv9 $name-$(\ date +”%Y-%m-%d-%H%M%p”).zip $name; } uuid() { UUID=$(cat /proc/sys/kernel/random/uuid) && echo $UUID; }

Grub2 change with latest CentOS update

The previous article regarding configuring Grub 2 for Windows 10 no longer works with the latest CentOS updates.  Here is the newer one. File to edit: /etc/grub.d/40_custom Content to add: menuentry “Windows 10 (system) (on /dev/sda1)” –class windows –class os { insmod part_msdos insmod ntfs insmod ntldr set root='(hd0,msdos1)’ ntldr ($root)/bootmgr } Command to rebuild menu: grub2-mkconfig -o /boot/grub2/grub.cfg

SHA1 Hash in Right Click Menu

Minecraft’s file has a field for sha1 hash for resource packs. This places a SHA-1 hash on the Nautilus’ right click menu in Gnome.

Linux tips and Microsoft DevOps

Best Practices for the Linux and Application Admins – Great article with mistakes and the lessons learned, Running a program as root on startup [creating a service for use with systemd] – excellent discussion on creating services.  Keeping SSH access secure – Basic analysis on dealing with SSH worms that try many username and password combinations. This page on Microsoft’s DevOps for bots has a lot of useful resources…
Read more