Strace – Notes and how to use it

Got most of this from this video.

What files is a program opening?

strace -etrace=open google-chrome

strace -etrace=open google-chrome

What child processes are spawned?

strace -etrace=execve google-chrome

  • write = what is written to
  • execve = what child processes are opened
  • open = what files are opened up

perf – what does it do?

Linux Desktop Setup

I’ve tried a few flavors of linux, and had issues with each as a desktop.  Recently I got  a new laptop so I decided to try it again.

My favorite distro is Mint, just be cause it doesn’t overload things with a bunch of effects that make it harder to find what you are looking for.  My only issue is, Mint couldn’t see my wifi card.  So.. I used ubuntu, and placed Cinnammon on top.  First, thanks to Marin Todorov, he’s got a great tutorial on how to set this up.  I’m going to put the essence here since I hate it when things disappear from the web.

  1. Install Ubuntu 16.04 LTS
  2. Install Cinnamon (apt install cinnamon)
  3. Install Numix
    1. add-apt-repository ppa:numix/ppa
    2. apt-get update
    3. apt-get install numix-gtk-theme
      
    4. apt-get install numix-icon-theme-circle
  4. Install Conky
    1. apt-add-repository -y ppa:teejee2008/ppa
    2. apt-get update
    3. apt-get install conky-manager
  5. Install Plank
    1. add-apt-repository ppa:ricotz/docky
    2. apt-get update
    3. apt-get install plank
    4. Inside the manager I turned on “Gotham, CPU Panel, Network Panel, and Process Panel”
    5. I’m including here my configs I placed in the .conky directory for my settings.
  6. Install Skype following instructions from here
    1. add-apt-repository "deb http://archive.canonical.com/ $(lsb_release -sc) partner"
      
    2. dpkg --add-architecture i386
    3. apt-get update
    4. apt-get install skype
    5. cp /usr/share/applications/skype.desktop /home/<homedir>/.config/autostart/

Handbrake Compile

Compiling HandBrake on Linux

These instructions are for building the *released* version of HandBrake. If you are building SVN, see the instructions in the source tree doc/BUILD-Linux.

Install Dependencies

What you need depends on your distribution.

The GTK UI introduces some significant extra build requirements. If you intend to disable building the GUI with `configure –disable-gtk’ you will not need many of these packages installed.

For Ubuntu you need:

  • subversion (cli/gui)
  • yasm (cli/gui)
  • build-essential (cli/gui)
  • autoconf (cli/gui)
  • libtool (cli/gui)
  • zlib1g-dev (cli/gui)
  • libbz2-dev (cli/gui)
  • libxml2-dev (cli/gui)
  • libogg-dev (cli/gui)
  • libtheora-dev (cli/gui)
  • libvorbis-dev (cli/gui)
  • libsamplerate-dev (cli/gui)
  • libfribidi-dev (cli/gui)
  • libfreetype6-dev (cli/gui)
  • libfontconfig1-dev (cli/gui)
  • libass-dev (cli/gui)
  • intltool (gui)
  • libglib2.0-dev (gui)
  • libdbus-glib-1-dev (gui)
  • libgtk2.0-dev (gui)
  • libgudev-1.0-dev (gui)
  • libwebkit-dev (gui)
  • libnotify-dev (gui)
  • libgstreamer0.10-dev (gui)
  • libgstreamer-plugins-base0.10-dev (gui)
  • libappindicator-dev (gui)

To install these packages:

sudo apt-get install subversion yasm build-essential autoconf libtool \
zlib1g-dev libbz2-dev libogg-dev libtheora-dev libvorbis-dev \
libsamplerate-dev libxml2-dev libfribidi-dev libfreetype6-dev \
libfontconfig1-dev libass-dev intltool libglib2.0-dev libdbus-glib-1-dev \
libgtk2.0-dev libgudev-1.0-dev libwebkit-dev libnotify-dev \
libgstreamer0.10-dev libgstreamer-plugins-base0.10-dev libappindicator-dev

For Fedora you need the following package groups:

  • Development Tools
  • Development Libraries
  • X Software Development (gui)
  • GNOME Software Development (gui)

To install these package groups:

sudo yum groupinstall "Development Tools" "Development Libraries" \
"X Software Development" "GNOME Software Development"

Also for Fedora you need the following additional packages:

  • yasm (cli/gui)
  • zlib-devel (cli/gui)
  • bzip2-devel (cli/gui)
  • libogg-devel (cli/gui)
  • libtheora-devel (cli/gui)
  • libvorbis-devel (cli/gui)
  • libsamplerate-devel (cli/gui)
  • libxml2-devel (cli/gui)
  • fribidi-devel (cli/gui)
  • freetype-devel (cli/gui)
  • fontconfig-devel (cli/gui)
  • libass-devel (cli/gui)
  • dbus-glib-devel (gui)
  • libgudev1-devel (gui)
  • webkitgtk-devel (gui)
  • libnotify-devel (gui)
  • gstreamer-devel (gui)
  • gstreamer-plugins-base-devel (gui)

To install these packages:

sudo yum install yasm zlib-devel bzip2-devel libogg-devel libtheora-devel \
libvorbis-devel libsamplerate-devel libxml2-devel fribidi-devel \
freetype-devel fontconfig-devel libass-devel dbus-glib-devel \
libgudev1-devel webkitgtk-devel libnotify-devel \
gstreamer-devel gstreamer-plugins-base-devel

QuickStart Build Instructions

  • apt-get -y install libmp3lame-dev lame libjansson4 libjansson-dev x264 libx264-142 libx264-dev libgtk-3-dev
svn checkout svn://svn.handbrake.fr/HandBrake/trunk hb-trunk
cd hb-trunk
./configure --launch

Or if you want HandBrakeCLI only:

svn checkout svn://svn.handbrake.fr/HandBrake/trunk hb-trunk
cd hb-trunk
./configure --launch --disable-gtk

If there are errors at this stage, you’re missing some prerequisite.

Assuming that all goes well, you should now have a HandBrakeCLI binary in the build directory and a ghb binary in the build/gtk/src directory. You can execute it in place or copy it wherever you like.

You may also want to install, run:

cd build
sudo make install

This will install the binary and add a HandBrake option to your “Applications->Sound & Video” menu.

Full Compiling Guide

This is just a simple quick-start guide. For the real meat and potatoes, see the latest Linux build documentation. Topics covered there include:

  • Running configuration and build commands on subsequent compiles (hint, do it from the build/ directory, not the trunk)
  • Configuring options like 64-bit builds and cross-compilation
  • Cleaning build files
  • Tweaking contrib libraries

Backing Linux up to Blu-Ray

Reference link (link)

  • truncate –size=25GB /big/disk/mybr.udf
  • mkudffs /bigdisk/mybr.udf
  • mkudffs /bigdisk/mybr.udf
  • mount -oloop,rw /bigdisk/mybr.udf /mnt/test
  • growisofs -speed=1 -Z /dev/dvd=/bigdisk/mybr.udf (grow the iso to 25gb)
  • Install deps:  yum -y install cdw udftools

Some links to help learn how to do this:

  • http://allgood38.io/burn-bluray-data-disks-on-linux-minimize-coasters.html
  • http://www.troubleshooters.com/linux/blu-ray-backup.htm
  • http://linuxhacksandfixes.blogspot.com/2013/02/recording-data-blu-ray-from-command-line.html
  • block added