Showing posts with label Linux. Show all posts
Showing posts with label Linux. Show all posts

Thursday, August 7, 2014

Get Rid of Stupid Disappearing Scrollbars in Ubuntu 12.04+

I have no idea how anyone thought disappearing scrollbars were a good idea, but I don't. Here's how to make the disappearing scrollbars disappear. In the terminal, type:

gsettings set com.canonical.desktop.interface scrollbar-mode normal

Saturday, August 11, 2012

Extract Image From Video Using FFMPEG

ffmpeg -i video.flv -an -s 320×240 -ss 00:00:02 -r 1 -y %d.jpg

-s 320×240 specifies the frame size of the output (Default is the size of the original video.)

-ss 00:00:02 Seek to given time position in seconds.

Thursday, February 2, 2012

Change FourCC setting in Linux Using Mencoder

Sometimes an AVI video file will not play on my PS3, resulting in a "data type not supported" error message. I finally figured out the problem this time. It wasn't audio codec, and it wasn't the weird fps it had; It was a FourCC setting that was incompatible. I tried using cfourcc to do this, but it did not result in playable AVI files. So, I tried mencoder and it worked fine, all without remuxing.

mencoder <input-file> -oac copy -ovc copy -ffourcc XVID -o <output-file>

-oac stands for "output audio codec"
-ovc stands for "output video codec"
-ffourcc is for forcing the changing of the fourcc setting. The non-playable files had a FourCC setting of FMP4. I changed it to XVID, which made them playable.
-o is for output file

Example:

mencoder The.Big.Show.S01E03.avi -oac copy -ovc copy -ffourcc XVID -o The.Big.Show.S01E03-XVID.avi

Friday, December 2, 2011

Edit PDF Meta Data

Edit Existing PDF Meta Data:

pdftk book.pdf dump_data output report.txt

Now edit "report.txt" and save the changes.

Update the PDF with this new info:

pdftk book.pdf update_info report.txt output bookcopy.pdf

Friday, November 18, 2011

Convert MKV (h264, AC3) to MP4 (h264, AAC)

From juliensimon.blogspot.com:

We have already inspected the file, so let's extract the streams:

mkvextract tracks video.mkv 1:video.h264 2:audio.ac3

Then, we need to transcode the audio stream to AAC (let's use high-quality VBR):

ffmpeg -i audio.ac3 -acodec libfaac -aq 255 -ar 44100 -ac 2 -async 1 -vsync 1 audio.aac

Now, we'll use MP4Box to remux the initial video stream and the new audio stream into an MP4 container:

MP4Box -new -add audio.aac -add video.h264 -fps 23.976 video.mp4
AAC import - sample rate 44100 - MPEG-4 audio - 2 channels
AVC-H264 import - frame size 1280 x 720 at 23.976 FPS
Import results: 60146 samples - Slices: 1027 I 36894 P 22225 B - 1 SEI - 968 IDR
Stream uses B-slice references - max frame delay 2
Saving video-ps3.mp4: 0.500 secs Interleaving

That's it :)

Fix FFMpeg to Convert Audio

When trying to use FFMPEG to convert AC3 audio in a video file to AAC, I kept receiving the error message "Unknown encoder 'libfaac'." Finally I found the solution to this on Ubuntuforums.org. FFMPEG that comes with Ubuntu has no proprietary non-free codecs included. Instead of recompiling FFMPEG, simply install Medibuntu repositories, the install additional codec libraries. From the Medibuntu site:

The following bash command adds Medibuntu's repository to Ubuntu. It also adds Medibuntu's GPG key to your keyring, which is needed to authenticate the Medibuntu packages.

This command should be run in the Terminal (Applications → Accessories → Terminal):

sudo -E wget --output-document=/etc/apt/sources.list.d/medibuntu.list http://www.medibuntu.org/sources.list.d/$(lsb_release -cs).list && sudo apt-get --quiet update && sudo apt-get --yes --quiet --allow-unauthenticated install medibuntu-keyring && sudo apt-get --quiet update

Medibuntu's repository is deactivated by upgrading to a newer Ubuntu release, so you should run this command again after the release upgrade.

You may also wish to add the following packages. The first will cause many apps from the Medibuntu repository to appear in Ubuntu Software Center (Ubuntu 9.10+) or Add/Remove Applications (versions prior to 9.10). The second will allow users to generate crash reports against Medibuntu packages and submit them to the Medibuntu bugtracker.

sudo apt-get install app-install-data-medibuntu apport-hooks-medibuntu 

Thursday, January 27, 2011

How To Mount ISO Image

Sometimes you want to use an ISO image (of a CD or DVD) without having to burn it to a disc first. Here's how:

1) You need to make the directory to put the ISO into using the following command (you can name the directory whatever you prefer):

sudo mkdir /media/isoimage

2) You may need to add the loop module to your kernel. It was already loaded on my system, but if you need to do this, type the following command:

sudo modprobe loop

What is the kernel loop module and what does it do? I don't know. You'll have to ask someone else for that.

3) Mount the ISO image:

sudo mount mydisc.iso /media/isoimage/ -t iso9660 -o loop

Now your ISO should be mounted and accessible in the directory you specified.

To unmount:

sudo umount /media/isoimage/

Friday, December 31, 2010

PS3 Media Server on 64-bit Linux

I was having the darnedest time getting MKV files to play from PS3 Media Server from fresh Ubuntu 10.04 Lucid Lynx. They worked fine from Windows and from an old 32-bit 9.04 Jaunty Jackalope system. Turns out Warriorcookie found the problem. 64-bit Linux systems need to install 32-bit libraries (ia32-libs for Ubuntu) for some packages, including Tsmuxer, apparently. So I simply:

sudo aptitude install ia32-libs

Then I rebooted and all was well. WOOHOO!!

Thursday, August 12, 2010

Cleanup Filenames With Detox

An easy way to cleanup filenames is a handy little utility called detox. It's so easy to use. After installation, from a command line, simply type:

detox /path/to/files/*.mp3

to cleanup filenames of all MP3 files in the given directory, for example. It removes spaces and replaces special characters with plain ones (i.e. replaces u with accent with plain "u"). It has options, but if you just want the basics all you have to do is something like the above.

Monday, August 9, 2010

Fixing GPG Errors That Show Up After Aptitude Update

When you get GPG errors after doing a sudo aptitude update here is the fix:

W: GPG error: http://archive.canonical.com jaunty Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 40976EAF437D05B5
W: GPG error: http://download.virtualbox.org jaunty Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY DCF9F87B6DFBCBAE
W: Failed to fetch http://ppa.launchpad.net/chromium-da...jaunty/Release

W: Some index files failed to download, they have been ignored, or old ones used instead.

The fix for this is to re-download the keys using the hexidecimal numbers given in the error (I bolded them above).

NOTE: Your hexadecimal numbers may be different then mine, so make sure to use the hexadecimals numbers in your error, not mine.

Type this command into the terminal (Applications > Accessories > Terminal)

sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys #don't actually run this line yet

And then add the hexadecimal numbers to the command (again, these are my keys from my error. Make sure to use your own):

sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 40976EAF437D05B5 DCF9F87B6DFBCBAE 2EBC26B60C5A2783 A8A515F046D7E7CF 6E871C4A881574DE 28A8205077558DD0 D739676F7613768D 8C851674F96FD737 C0B56813051D8B58 4874D3686E80C6B7 60D11217247D1CFF 5A9A06AEF9CB8DB0 6D975C4791E7EE5E 5A9BF3BB4E5E17B5 7FB8BEE0A1F196A8

Wednesday, August 4, 2010

Network Security Software

Nmap (Network Mapper) is a helpful ip scanner and network security utility. It uses raw IP packets in novel ways to determine what hosts are available on the network, what services (application name and version) those hosts are offering, what operating systems (and OS versions) they are running, what type of packet filters/firewalls are in use, and dozens of other characteristics. Once installed, simply use:

sudo nmap 192.168.1.*

for example to release its hounds to search out interesting IPs on that subnet. There are many other ways to use it, but this is a basic start. For full documentation type man nmap or search for nmap documentation on the web.

Sunday, July 25, 2010

Manually Configure Network

Just a reminder of how to manually configure a network in Linux. Let's say you have a desktop that will never leave the house or the confines of your home, wired network, so you don't want to fool with network manager. Your /etc/network/interfaces file should look something like:

auto lo
iface lo inet loopback
address 127.0.0.1
netmask 255.255.255.0

auto eth0
iface eth0 inet dhcp

If you're using dhcp, this should do it. Then you can disable network-manager applet on startup or remove it altogether (sudo aptitude remove network-manager).

Of course this isn't an exhaustive guide and doesn't cover many situations, but this particular situation is one I found myself in and I believe fairly common.

Friday, February 12, 2010

Boot with Bluetooth Turned Off - GNU/Linux

To boot with bluetooth turned off in GNU/Linux (specifically Ubuntu 9.10 Karmic Koala) add the following to /etc/rc.local :

rfkill block bluetooth