December 07, 2012

Convert ogv to mp4 or flv Ubuntu

This was serially annoying to figure out. However, in the process I found probably the best Ubuntu tutorial ever. I mean, thorough installation instructions are great but they even guide you through uninstalling your first failed attempt AND tell you how to undo the tutorial you just followed!

Compile FFmpeg on Ubuntu

and then it is

$ ffmpeg -i /tmp/input-2.ogv /tmp/output.mp4
$ ffmpeg -i /tmp/input-2.ogv /tmp/output.flv

Note, I also got PiTiVi to convert ogv to flv but ogv to mp4 failed.

I did get one error

dpkg-deb: error: parsing file '/var/tmp/tmp.wbpjpldtdB/package/DEBIAN/control' near line 7 package 'ffmpeg':
error in Version string '5:git-2012-12-07-1f46722-1': version number does not start with digit

dpkg-deb: error: parsing file '/var/tmp/tmp.wbpjpldtdB/package/DEBIAN/control' near line 7 package 'ffmpeg':
error in Version string '5:git-2012-12-07-1f46722-1': version number does not start with digit

and don't know what it means or how to fix it but that doesn't matter because things appear to work.

Posted by kkwaiser at 01:44 PM | Comments (0)

December 06, 2012

Tweaking Ubuntu mic volumes

Somehow my mic settings got messed up and sound very, very quiet with a lot of background static. There are probably better ways to fix this problem but here is a way to improve it, at least.

In my Sound Preferences (System > Preferences > Sound) I am using Hardware:Analog Stereo Duplex and Input: Microphone 2 (Front Mic)

In a terminal:

$ alsamixer

Press F4 to get to the Capture portion of the mixer.

Arrow Left or Right to Front Mic Boost and take to 100
Arrow Left or Right to Capture and set at ~85

Test and repeat

Posted by kkwaiser at 04:26 PM | Comments (0)

September 07, 2012

Query for recent files via command line in Ubuntu

From this thread:

$ sudo find -L /home/data/ -type f -newerct '-10 days'

This search the User's home directory (and subdirectories) for files created (or modified?) within the the last 10 days.

Posted by kkwaiser at 10:44 AM | Comments (0)

March 28, 2012

Install plugins for Gedit

I was a bit frustrated that I even had to go think to do this but now that I know, I should become more efficient in Gedit. As I will probably never move to Vim or Emacs, this is a good thing.

Directions here.

$ cd /usr/lib/gedit-2/plugins/

Download and untar your plugins. Place the files (not the directory) into the above folder.

Gedit Plugin Installer - save seconds while installing new plugins. Ironically, no directions on how to install the installer are given.

A how to that really wasn't that useful to me.

Posted by kkwaiser at 08:42 AM | Comments (0)

Block indents in Gedit

Select the block of text and press Tab or Shift-tab to unindent. See Edit> Preference >Editor to set the tab width.


Posted by kkwaiser at 08:41 AM | Comments (0)

March 23, 2012

Find and delete files by name in Ubuntu

$ sudo find /var/cache/apt -name '*soffice*' -exec rm -rf {} \;

there is also a -type command where -type f will find only files.

Posted by kkwaiser at 09:14 PM | Comments (0)

February 21, 2012

Searching terminal history on Ubuntu

Going from this blog post

$ history | grep [search term]


Ctrl + R -> type in search term -> hit Ctrl+R again to cycle through results -> Enter to apply command

Posted by kkwaiser at 09:29 AM | Comments (0)

January 30, 2012

JPG to PDF on Ubuntu

Got this from a help forum which claims this command doesn't work:

$ convert /tmp/blah.jpg Desktop/blah.pdf

but I tried it anyways (on 10.04 LTS) and it worked wonderfully.

Posted by kkwaiser at 01:27 PM | Comments (0)

December 19, 2011

Copy directories and maintain permissions

After googling it a second time, I usually decide I should just blog it for future reference:

$ sudo cp -rfp ~/Desktop/blah/* /var/blah

the -p is the key

from $ man cp

-p same as --preserve=mode,ownership,timestamps

preserve the specified attributes (default: mode,ownership,timestamps),
if possible additional attributes: context, links, xattr, all


Posted by kkwaiser at 10:19 AM | Comments (0) | TrackBack

November 08, 2011

LAMP Installation notes

$ sudo apt-get install apache2

$ sudo ufw enable
$ sudo chown root:root /
$ sudo chmod 755 /

Installed PHP 5.2 following the instructions on approach 3

$ sudo apt-get install php5

Add following to (pinched from comments on link above):

$ sudo gedit /etc/apt/preferences.d/php

Package: php5-imap
Pin: version 5.2.6*
Pin-Priority: 991

Package: php5-mcrypt
Pin: version 5.2.6*
Pin-Priority: 991

Posted by kkwaiser at 09:56 AM | Comments (0) | TrackBack

October 27, 2011

Remove (slice) pages from a pdf in Ubuntu

Taken from a XMas post elsewhere on the internet:

$ pdftk [input.pdf] cat [pg-pg] [pg-pg] output [output.pdf]

$ pdftk FluxLetter_Vol4.pdf cat 4-7 output FluxLetter_Vol4_slice.pdf

Posted by kkwaiser at 08:51 AM | Comments (0) | TrackBack

October 26, 2011

Crop PDFs in Ubuntu

Another helpful snippet from the interwebs:


$ pdfcrop [input.pdf] [output.pdf]

I don't remember exactly how I installed pdfcrop but this command is in my terminal history:

$ sudo apt-get install texlive-extra-utils

Posted by kkwaiser at 11:20 AM | Comments (0) | TrackBack

August 31, 2011

Upgrading Apache on Ubuntu 10.04

Ubuntu 10.04 (Lucid) runs Apache v2.2.14 which appears to be 0.0.6 versions behind the most secure version of Apache. The update manager does not look at higher versions of Apache so the questions become 1) is my system not secure if I'm running Lucid's Apache 2.2.14? 2) if so, how to force an upgrade. It is worth noting this is for my development machine only and it is port 80 is firewalled 99% of the time.

Forced upgrade can lead to complications, Ubuntu should back-port security patches(?) - SOURCE

The security port changelog does not show any recent security patches for Apache. - SOURCE

Other bits

Apache Version number:
$ /usr/sbin/apache2 -v

On forcing an upgrade:

Modifying sources.list didn't work as advertised.

Ubuntu Forums on how to force upgrade Apache for 10.04

Different forum, same crap.

Posted by kkwaiser at 02:02 PM | Comments (0) | TrackBack

July 11, 2011

World is writable!!!!

We have successfully set up Ubuntu dev machines on USB sticks but there are a few tweaks.

1) Enabling the UFW yields a warning:

ubuntu@ubuntu:~$ sudo ufw enable
WARN: / is world writable!
WARN: / is group writable!

- Solution from this forum.

ubuntu@ubuntu:~$ sudo chown root:root /
ubuntu@ubuntu:~$ sudo chmod 755 /
ubuntu@ubuntu:~$ sudo ufw status
Status: active

Posted by kkwaiser at 01:34 PM | Comments (0) | TrackBack

July 01, 2011

Ubuntu on a stick

Installation Notes:

SanDisk Cruzer 8GB USB 2.0 - FAT32 default formatting

1) to download 10.04 LTS; 32bit
- get drirection to create a USB Drive (we used the Windows option)
- "Show me how" -> Download Universal USB Installer

2) Open USB Installer
- Ubuntu 10.04.x
- Point .iso file
- Allow to format to FAT32
- Persistent Data - 4GB (saves 4GB for OS)

Posted by kkwaiser at 08:57 AM | Comments (0) | TrackBack

June 17, 2011

Find files by extension in Linux/Ubuntu

Just taking note of a command I used today to locate a files of a particular type within a directory and child directories. For a better explanation, see the original source.

This command returns all hits which include .zip as part of the name and which are of type file:

% find . -type f -name "*.zip"

Posted by kkwaiser at 03:36 PM | Comments (0) | TrackBack

April 27, 2011

Ubuntu and Webalizer

This is why I continue to add to this blog (my work journal.) A month or more ago I installed Webalizer on my development machine because random IP addresses from Romania, France, Poland, Russia, China and every country in between were hitting my machine. I went through the normal process (i.e., google, google, google) and, in no time, I had installed software that analyzes the server logs - Webalizer. I went back to my development machine today and decided to rerun a few of the reports and forget how. In fact, for a time I even forget which program I installed. Was it Webalizer or LogWatch?

It was Webalizer. And here are the commands I need to remember:

The most basic report:
$ sudo webalizer -o stats /var/log/apache2/access.log

This breaks:
$ sudo webalizer -o stats /var/log/apache2/error.log

$ sudo webalizer -F CLF -o stats /var/log/apache2/error.log

$ sudo webalizer -F IIS -o stats /var/log/apache2/error.log





Comparing the March to April reports, I have gone from 16 to 5 IPs hitting my dev site. Of the five, I know 3 of the IPs. I'm blocking the other two via the firewall:

$ sudo ufw deny from [ip-address]

This may be an amateurish way of securing a server but it seems to work as anomalies in my log files have dropped considerably. Bam.

Posted by kkwaiser at 08:45 AM | Comments (0) | TrackBack

April 04, 2011

Combining pdfs with on Ubuntu

O'Reilly nails this one:

To combine pages into one document, invoke pdftk like so:

pdftk < input PDF files> cat [< input PDF pages>] output < output PDF filename>

A couple of quick examples give you the flavor of it. Here is an example of combining the first page of in2.pdf, the even pages in in1.pdf, and then the odd pages of in1.pdf to create a new PDF named out.pdf:

pdftk A=in1.pdf B=in2.pdf cat B1 A1-endeven A1-endodd output out.pdf

My usage:

$ pdftk A=Desktop/ebb-flow-march-2011-receipt.pdf B=payhub-claim-2010_page3.pdf cat A1 B1 output Desktop/darling_rocks.pdf

Posted by kkwaiser at 12:28 PM | Comments (0) | TrackBack

March 23, 2011

Ubuntu's Computer Janitor

Note to self: Ubuntu's Computer Janitor will remove programs you rely on. It just swept aside my entire OpenOffice install. Not a big deal, but I'm not sure why those files even showed up. Interesting to note that after reinstalling OpenOffice the new install does not show up on the Janitor list.

Posted by kkwaiser at 01:35 PM | Comments (0) | TrackBack

March 21, 2011

IE emulator on Ubuntu

This is not a How To post. Think of it as a How I Tried and Failed post.

1> Installed Wine and IE 7 -> then learned Wine is not an emulator
2> Tried IE4Linux -> then learned it is not really maintained and is not compatible with Ubuntu 10.04 and/or I'm not smart enough to configure it.
3> UM Virtual Sites -> Haven't tried but assuming I will only see IE8 if I can get it to work from my machine.
4> User Agent Switcher -> Firefox Addon mentioned in some forum. Shot in the dark, no dice.
5> Find old XP laptop and place next to workstation -> this is what I've resorted to and where I wish I would have started.

Pinged a listserve I'm on for help and came away with this in terms of potential solutions:

1) Setup a virtual Windows OS using, VirtualBox, Parallels or VMWare.
- Probably the best, long-term solution but too involved considering my immediate need is simple and I already run a dual-boot

2) Firefox Addon: IE NetRender
- appears to work except it produces a static image of the specified page where my problem (or, more accurately, IE's problem) is with drop-down menus which don't render.

3) Use IE8's developer tools to render as an IE7 browser.
- This works well enough in combination with my old laptop "solution"

Posted by kkwaiser at 12:50 PM | Comments (0)

VirtualBox on Ubuntu 10.04

Ignore this, I don't have an XP bootdisk in front of me so am not going to bother.

I need a Window OS emulator; here are some notes.

Synaptic and select VirtualBox

Type: Dynamically expanding storage
Location: /root/.VirtualBox/HardDisks/iesux.vdi
Size: 8.00 GB (8589934592 Bytes)

Posted by kkwaiser at 11:33 AM | Comments (0)

March 04, 2011

Tiff to PDF in Ubuntu

This page tipped me off.

I've already installed PDFTK so I just needed to install the tiff tool. I used synaptic for this:

$ sudo synaptic

And installed this library: libtiff-tools

I then ran this command:

$ tiff2pdf -o ~/Desktop/pdf_output.pdf ~/Desktop/tif_input.tif

Posted by kkwaiser at 03:40 PM | Comments (0)

March 03, 2011

How to compress pdfs in Ubuntu

Option 1:

Install pdftk
$ sudo apt-get install pdftk

Compression command.
$ pdftk output.pdf output final.pdf compress

- Noticed no difference if file size.

Option 2:

Take the file to .ps and back to .pdf:

$ pdf2ps input.pdf
$ ps2pdf output.pdf

- This approach threw an error because my input.pdf was malformed.

Option 3:

Reprint the pdf with Okular

$ okular input.pdf

Print > Print to File (pdf)
Options > PDF Options > Force rasterization

This reduced the file form 18 mb to 6.1 mb where the previous options failed. I retried Option 1 and 2 after this step and no change in size was observed.

Option 4:

I also had success with opening the following, which is the GUI version of Option 2:

Open large_input.pdf in Okular (or Evince) > Print as

Open in Okular (or Evince) > Print as small_output.pdf

Posted by kkwaiser at 02:31 PM | Comments (0)

December 20, 2010

Update, upgrade and reboot via command line for Ubuntu

Some notes for how to keep a system up to date when you only have SSH (command line) access:

From an Ubuntu forum:

$ sudo apt-get update
$ sudo apt-get upgrade

What is the difference between these commands?

Put another way, update does not make any changes to the set of installed packages, it merely checks to see what's new. Whereas upgrade does.

To reboot from SSH (command line) use this command or see some other options:

$ sudo reboot
which is equivalent to
$ sudo init 6

One thing I am not sure of is what happens if you shut down via SSH. Can you boot a computer via SSH? Probably, but I haven't figured it out yet.

Posted by kkwaiser at 10:38 AM | Comments (0)

December 17, 2010

Using Skype with a Microsoft LifeCam 6000 on Ubuntu

I've probably tried sillier things than trying to get Microsoft hardware to play well with Linux (like when I was 8 and stacked a step-stool on top of a step-stool on top of a high-chair...that didn't end well at all) but this command seems to make it all work:

$ LD_PRELOAD=/usr/lib/libv4l/ skype

Posted by kkwaiser at 02:34 PM | Comments (0)

November 01, 2010

Assess disk space usage in Ubuntu

The dual-boot install I am working out of is the first one I'd set up and the partition is quite small (30 gb). Last week, I finally filled it up (took over a year) and here is what I learned from the process.

To check your disk space usage from command line:
$ sudo df -h

The following command will show disk usage per directory (from this forum):
$ sudo du -sh /*
$ sudo du -sh /home/[user]/*

Cleaning up installer files may also help:
$ sudo aptitude clean

Sort by size:
$ sudo du -s /var/* |sort -n -r

Show hidden directories (see above link):
$ du -s */ .[^.]*/ | sort -nr

Posted by kkwaiser at 04:31 PM | Comments (0)

May 07, 2010

OpenSSH server on Ubuntu and access via Mac

Started at this link.

Then loaded openSSH following this link. Although I used a different port and used ufw to configure the firewall:

1) Netstat will print network connections (make sure SSH not already installed?):
$ sudo netstat -tulpn

2) Install openSSH:
$ sudo apt-get install openssh-server

3) Check to see if SSH is running (program=sshd)
$ sudo netstat -tulpn
$ sudo ufw allow [port]

4) Tighten security a tiny bit:

a) Edit config file
$ sudo nano /etc/ssh/sshd_config
b) Change port number
c) Control users who can login: AllowUsers [user1] [user2]
d) restart ssh server
$ sudo /etc/init.d/ssh restart

5) Open port:
$ sudo ufw allow [port]

6) Install LogWatch to monitor activity on the Ubuntu Box. Note, this seems to install PostFix (email server) if not already present.

$ sudo apt-get update

$ sudo apt-get install logwatch

This command will print out a report:
$ logwatch

Logs kept here:
$ cd /var/log

7) Set system emails to forward to your email account:

$ sudo nano /etc/aliases
Add this line:

Other notes:

Then, to ssh in (from Mac):

Applications > Utilities > Terminal

$ ssh [username]@[] -p [port]

I toyed with this link but decided not to go there. Don't fix it if it is not broken.

Posted by kkwaiser at 12:05 PM | Comments (0)

January 20, 2010

Reveal Hidden characters in Ubuntu

Kind of an interesting aside here. I was trying to import a test bibliography into Drupal's biblio module and it was not registering the publication type of the first entry. The problem, it turns out, was a hidden character at the very front of the input file.

Here's a snippet of the entry:

%0 Journal Article

%A Barnese, L. E.

%A Lowe, R. L.

%A Hunter, R. D.

%D 1990

%T Comparative grazing efficiency of pulmonate and prosobranch snails

%J Journal of the North American Benthological Society

%V 9

%N 1

%P 35-44

It turns out Windows programs, such as Endnote, which I used to create the original input file, are known to introduce hidden characters which are known as an UTF-8 BOM. Who knew?

The string of characters I was seeing was:

I used the following command to reveal the hidden characters:

$ od -c /home/data/Documents/Bibliography/umbs_format_test_1-20-10.txt

Here are the first two lines:

0000000 357 273 277   %   0       J   o   u   r   n   a   l       A   r
0000020   t   i   c   l   e  \r  \n   %   A       B   a   r   n   e   s

Posted by kkwaiser at 01:57 PM | Comments (0)