Miscellaneous Questions and Answers

Lepidium sativum - Cress growing in a keyboard. - Author wetwebworkIn this article several issues related to Linux and applications will be discussed. The format will be in a question and answer based manner.

Linux

Linux is a Unix-like and POSIX-compliant computer operating system assembled under the model of free and open source software development and distribution.

General Linux related questions

Wine

Wine is a free implementation of Windows on Unix.

Question ‘special permissions’: While running a particular application using Wine, I see the error “err:winediag:IcmpCreateFile Failed to use ICMP (network ping), this requires special permissions.” How can I grant these permissions?
Answer: You have to set the capabilities for the process running under Wine. Run this command on the wine-preloader-binary:

sudo setcap cap_net_raw+epi /usr/local/bin/wine-preloader

Adapt the path to your installation of the wine-preloader.
Source: http://forum.winehq.org/viewtopic.php?t=8270


HTTP proxy

Question: How to set up an HTTP proxy when I only have SSH access to the host at which I would like to run the proxy server?
Answer: Use the built-in proxy server capabilities of SSH.
Conditions/Tested with:

  • The remote host must run an SSH-server and there must be an Internet connection available.
  • SSH Version: OpenSSH_5.9p1 Debian-5ubuntu1.1, OpenSSL 1.0.1 14 Mar 2012
  • Firefox Version 24.0
  1. Login to the remote machine using the command:
    ssh -D 12345 user@host
  2. Let Firefox use this proxy connection:
    1. In Firefox select the menu: Edit->Preferences
    2. Select the tab: Advanced->Network
    3. Connection: Press ‘Settings…‘-button
    4. Select: Manual proxy configuration
      Don’t touch anything (Hosts empty, Port: 0) except for:
      SOCKS Host: 127.0.0.1 Port: 12345
    5. Radio button selection: SOCKS v5
  3. Check your IP via the browser: http://whatismyipaddress.com/ or http://www.whatismyip.com/. This website must return the IP-address of your remote host.

Remote synchronize

Question: How can I synchronize my files via a secure (SSH) connection?
Answer: Run this command:

rsync -avz -e ssh /local user@remote:/somedir/

Create screencast

Question: How can I make a screencast of my app(lication) so that I can submit it to YouTube as usage example. A screencast is a digital recording of computer screen output, also known as a video screen capture.
Answer: Install and use the application ‘gtk-recordmydesktop‘ which is the Graphical frontend for the recordMyDesktop screencast tool.

sudo apt-get install gtk-recordmydesktop

Write disk image to USB-stick

Question: How can I write a disk image to a USB-stick?
Answer: Perform these steps:

  1. Put USB stick in computer
  2. Determine drive ID of USB-stick: ‘dmesg‘.  Find in output something like:
    sd 7:0:0:0: [sdc] 7831552 512-byte logical blocks: (4.00 GB/3.73 GiB)

    Here ‘sdc' is the drive ID.

  3. Make sure USB-stick is not mounted: ‘df‘.  When you see an entry containing the drive ID (i.e. /dev/sdc1) you have to unmount it.
  4. Write image:
    sudo dd if=diskimage.img of=/dev/sdc bs=64k

    and wait for prompt. Replace diskimage.img with your image-file and /dev/sdc with the USB-stick-device.


Debian / Ubuntu

Some Debian / Ubuntu specific issues.

Purge removed packages

Question: How can I purge removed packages? I used the command ‘apt-get remove‘ but not everything is deleted from my system. The configuration files are still present. Answer: To purge all packages which still have the status ‘RC’ (removed/configuration). You can use this command:

dpkg -l |awk '/^rc/ {print $2}' | xargs sudo dpkg --purge

Sources:


Applications

Firefox

Mozilla Firefox is a free web browser.

Question ‘Blocked loading mixed active content’: Since version 23 of Firefox a website which is served partially over HTTPS is not displayed correctly. I see the error: ‘Blocked loading mixed active content‘.
Answer: Firefox 23+ is blocking mixed content. Mixed content is content (i.e. javascript) which is partially delivered via HTTP and partially secure via HTTPS. Please upgrade the website so it is only using HTTPS to deliver the content to the browser.
Source: https://blog.mozilla.org/tanvi/2013/04/10/mixed-content-blocking-enabled-in-firefox-23/


GIT

Git is a distributed revision control and source code management (SCM) system.

Question ‘Remove remote branch’: How can I remove a remote branch? When I perform the command:

git branch -a

I see as result: ‘remotes/origin/whatever‘, how can I remove this branch?
Answer: You have to execute the command:

git branch -rd origin/whatever