First good encryption is hard, and not something for us mere mortals to roll our selves. Linux Unifed Key Setup aka LUKS started as a way to standardize encryption key setup.

In on-disk-format.pdf states "The LUKS design can be used with any cipher or cipher mode." So as needs have changed ciphers can be changed.

Use Something Stronger?

from cryptsetup wiki FrequentlyAskedQuestions - Security Aspects.

Passphrase entropy  Cost to break
50 bit              EUR/USD   600k
55 bit              EUR/USD    20M
60 bit              EUR/USD   600M
65 bit              EUR/USD    20B
70 bit              EUR/USD   600B
75 bit              EUR/USD    20T

Why not use LUKS2?

LUKS2 does not yet have a fixed API. See release notes for Cryptsetup 2.0.0 RC0.

From the release notse:

  Release candidate with experimental features.

  This version introduces a new on-disk LUKS2 format.

  The legacy LUKS (referenced as LUKS1) will be fully supported
  forever as well as a traditional and fully backward compatible format.

  NOTE: This version changes soname of libcryptsetup library and increases major version for all public symbols.
  Most of the old functions are fully backward compatible, so onlyrecompilation of programs should be needed.

  Please note that authenticated disk encryption, noncryptographicdata integrity protection (dm-integrity), use of Argon2 >Password-Based Key Derivation Function and the LUKS2 on-disk format >itself are new features and can contain some bugs. Please do not use it without properly configured backup or in production systems.

  Until final 2.0 version is released, the new API calls or LUKS2 format could still change if a major problem is found.


Can't get anything from software center (12.04)

Ubuntu 12.04 does not have all repositories enabled by default. You can open Software Sources or Synaptic, and go to Settings - Repositories - Other Software. Enable/check 'Canonical Partners' and the 'Independent' repos and reload your Software Sources list. You can try using Software Center after that.

Speaking of Software Center, I never use it, I prefer to use Synaptic and the terminal window. This way I know for sure if the software I install will work or not on my system. I do use the search field in Software Center sometimes to learn more about new software but I usually install the software via Synaptic.


First install kde-plasma-desktop. Note: This is a heavy package
sudo apt-get install kde-plasma-desktop

(Optional) Run
sudo apt-get update

Run
sudo apt-get install kde-runtime


When running the Ubuntu 16.04 Live option, you will be user unprivileged "ubuntu" by default. Besides that, /var/www/ on a server is typically user/group owned by the root (admin) user, which prevents writing to /var/www/ as unprivileged user, so you would use "sudo" to overcome this.
You can e.g. do this in the Live Session :

sudo cp -av /media/ubuntu/backup-usb-disk/var/www/* /var-www-mountpoint/

Where /media/ubuntu/backup-usb-disk/var/www/ is your backup,
and /var-www-mountpoint/ is the /var/www/ folder on your fresh server install.


12.04 on VirtualBox -No internet access on Guest OS

For Internet access you can change network option to this :

I had this problem and solve with this option.


How can I extract user data from a file with awk and create a new user based on it?

awk -F: '{print $1}' users.txt will give you access to the username field
awk -F: '{print $2}' users.txt --> password field
awk -F: '{print $3}' users.txt --> home directory field

you could do something like:

user=`awk -F: '{print $1}' users.txt`;
path=`awk -F: '{print $3}' users.txt`;
useradd -d $path -m $user;


How can I make the network manager automatically connect to a new network?

I think you can open your network manger, then open your normally chosen network connection. You then can put a click in the connect automatically, it's at the top.


Uninstallation of VMware Workstation Player from Ubuntu 16.04

Open a terminal (one way could be Ctrl+Alt+T)

Put the command:

sudo vmware-installer -u vmware-player

After some time a window will open and ask you to keep or not to keep the configuration files. Just select 'No' and then 'Next'
Your VMWare Player will finally get uninstalled.


I've had this problem before and it can be caused by a countless number of things (for me it was a script that ran on login that was crashing). So I cant help with a fix but I can point you to the possible problem.

First take a look at your logs to see what error is causing your account to be logged out straight away.

they should be located in

var/log/

or

/var/log/syslog

you might be able to access these via your guest account (depending on how you set it up).

you also should be able to read you logs via webmin under

system > system logs

http://doxfer.webmin.com/Webmin/SystemLogs

but it can vary depending on how you setup webmin.


How can I use Windows after installing Ubuntu in Windows?

You are, in effect, asking about a few different possibilities, already covered by some existing questions:

Yes, you can dual boot Ubuntu and Windows. This should already be working for you though, as a Wubi system (like yours) is dual-boot. This means that when you turn your computer on, you should be presented with a menu of two choices: Ubuntu and Windows. Simply select the operating system you want to boot that operating system.
Alternatively you can run Windows in a virtual machine and connect your iPhone 5 via USB to the virtual machine.
You might interested in this question: Is it possible yet to synchronise music to an iPhone running iOS 5/6? for information on the possibility of syncing your iPhone in Ubuntu.

You cannot seamlessly switch between your Ubuntu system and your Windows system, without rebooting, except by creating a virtual machine. (And if you do that, it will be a separate virtual system, not the same Windows system as is installed normally. Your Windows partition hosts the disk image containing your Wubi installation of Ubuntu, making virtualizing the installed system itself even more difficult and risky than it ordinarily would.)

If you need more details or need help getting any of these to work, you can edit your question to provide more details.


OK so the answer is simple:
When using the host command with the -l option you do not use a host name as the parameter. You use a fully qualified domain name and then it returns all of the hosts. Once I entered the command as follows, everything worked as expected:

host -l mycity.example.com

server1.mycity.example.com
server2.mycity.example.com


Why doesn't Ubuntu work on my 2011 iMac?

I figured it out with Christian's answer here:  https://askubuntu.com/a/941322/144825
Basically, I had to boot off the Live CD and mount the installed Linux.  Then, update the Grub config with nomodeset, etc.


To run scripts you have written yourself you have a couple options.

OPTION 1

You can store them in /usr/bin.

This is personally what I do as I read somewhere a long time ago that /usr/bin was for things exactly like this and I've never really thought of it otherwise

I do however keep a copy of the scripts in a separate folder Documents/SourceCode/ which is where I do all my editing and testing. then I just copy the script over to /usr/bin

OPTION 2

You can just store them all in your testing folder so in my case...

Documents/SourceCode/

and add this to my path variable.

export PATH=$(PATH):/home/user/Documents/SourceCode


If I use rsync --partial-dir=DIR it only move partials to this folder if the process is interrupted.
So I used -T, --temp-dir=DIR in a folder in same drive but outside the folder that is sent to cloud. So there is no way to send a partial file to cloud.


To the original version of the question (although it also applies to the edited one)

You can use textual icons from the font Ubuntu:

How to set up

Open Special Characters, choose the font Ubuntu* and make a choice of appropriate icons.
Copy the global rhythmbox.desktop file to ~/.local/share/applications:

cp /usr/share/applications/rhythmbox.desktop ~/.local/share/applications

Open the local copy with (e.g.) gedit:

gedit ~/.local/share/applications

Now scroll to the shortcut sections, looking like:

[Desktop Action PlayPause]
Name=Play/Pause
Exec=rhythmbox-client --play-pause

Now copy the corresponding character from Sepecial Characters and edit the line Name=Play/Pause into: Name=⇫ Play/Pause. Don't change the other lines..

Edit the other shortcut sections similarly. Now log out and back in, and you're done.

Other xamples from Ubuntu textual icons


Found the solution

VMware Fusion 6 supports OpenGL version upto 2.1. So if even GPU (Graphics Card) support the version 3.x or may be 4.x but VMware Fusion 6 can only provide support upto version 2.1

Update: The latest version 8 of VMware fusion supports OpenGL upto version 3.3


[Printer][Brother HL-L2350DW] Unable to print. Misc error messages

Printer Device URI can be read and edited in Ubuntu 16.04LTS here:

Open the Printers program however you like ("System Settings" > "Printers", for example).
Right-click the printer in question and click "Properties".
In the "Settings" is a "Device URI" text input.

However, instead of following the instructions from Brother in your link, I was able to get my HL-L2350DW running just by running this script from Brother. Complete instructions for unzipping and running the script are available there.


How can I have different startup programs for "Desktop Edition" and "Classic Edition" sessions in 11.04?

User Defined Session for Cairo Dock Ubuntu Classic Desktop
First we need to define a user defined session that can be selected at the login screen. For this purpose we create a custom.desktop file as root in /usr/share/xsessions with the following content:
[Desktop Entry]
Name=Cairo Dock Session
Comment=Custom ~/.xsession script
Exec=/home/username/.xsession
X-Ubuntu-Gettext-Domain=gdm

Replace username by your name of course.
This will run a script in the HOME directory at login where we can put in any appplications we need to run after login.
To run Cairo Dock and GNOME classic desktop we create a file named ~/.xsession with the following content and make it executable:
#! /bin/bash

cairo-dock -o &
gnome-session --session=classic-gnome

Next time we login we will have the choice to run a Cairo Dock Session (option -c for no open GL) with GNOME classic desktop.


Had the same I/O Error, it was caused by an Intel Network Adapter.
Running dmesg | less as suggested by S Imphead in this thread and then searching for 'pm_suspend', I found this:

pci_pm_suspend(): e1000_suspend+0x0/0x20 [e1000e] returns -2
[287908.829615] dpm_run_callback(): pci_pm_suspend+0x0/0x150 returns -2
[287908.829617] PM: Device 0000:00:19.0 failed to suspend async: error -2
[287908.829689] PM: Some devices failed to suspend, or early wake event detected

That lead me to this thread in return.
The fix from there is to unload the kernel module e1000e with sudo rmmod e1000e. The author also wrote a script to catch the error and unload the module automatically, but I have not tried that.

The wired (but good) thing is, that the error is gone even if the module is immediately loaded again after unload. So whenever I encounter the problem I just execute this one-liner

sudo rmmod e1000e; sudo modprobe e1000e; sudo pm-suspend


Terminal doesn't see Windows filesystem until I open in Home Folder GUI

Thats because your windows drives are not mounted automatically during boot.When you click open the drive , Ubuntu mounts it for you automatically and hence you can see it through terminal.

If you want to open the drives in terminal then you will have to mount it manually using the mount command and then browse it through terminal.

Here's a tutorial that show you how http://www.cyberciti.biz/faq/mounting-windows-partition-onto-ubuntu-linux/

To mount the partitions during boot then you should make the required entry to the /etc/fstab file There are also several tutorials available online that gives step by step instruction how to do that

Here's a detailed tutorial from Ubuntu which shows how to automatically mount partitions https://help.ubuntu.com/community/AutomaticallyMountPartitions


How can I get both of my monitors working with Ubuntu?

I recently had something similar happen to me.

To resolve it I selected "NVIDIA accelerated graphics driver (version 173)"

After it downloads and installs the driver, you're supposed to restart your computer. I'm fairly certain you won't receive any indications about this.

After your restart your computer, both monitors should display your desktop without your intervention. Will then be up to you to configure.

Cheers!


From Nginx Wiki:

Open a terminal and enter the commands (remember to replace the values!):

sudo -s
nginx=stable # use nginx=development for latest development version
ubuntu=trusty # Replace this with your ubuntu version!
echo "deb http://ppa.launchpad.net/nginx/$nginx/ubuntu $ubuntu main" > /etc/apt/sources.list.d/nginx-$nginx-$ubuntu.list
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys C300EE8C
apt-get update
apt-get install nginx


Linux, by design, is already extremely secure because of its permissions model and its core design principles. Unlike Windows, Linux was built with security in mind, which made it very hard to actually penetrate.

With this in mind, penetrating any system is not impossible, but there are a few easy steps you can take to prevent most any virus from ever reaching your computer.

Keep your system up to date!
If a security vulnerability is found in any well-maintained package, it will be patched exceedingly quickly. Just run sudo apt update && sudo apt full-upgrade every so often to keep all of your packages up-to-date.
Avoid PPAs like the plague!
PPAs are insanely useful for people, but unless you can be 100% sure that they're run by reputable people and are not compromised, do not add them to your system. Malware through APT isn't really in the realm of average possibility, so you'll be safe.
Use a Firewall!
Remember  I said that occasionally a bug can be found in a program which may be exploited? Install ufw from APT, and then run this command: sudo ufw default deny incoming. This command will block any incoming connections to your computer. If you need to allow some incoming connection, just add another firewall rule.
Scan for Viruses/Rootkits Occasionally!
Just to play on the safe side, you should use clamav and rkhunter occasionally regularly. Once every two weeks will likely be more than enough for 99.9% of people.
Use Common Sense!
The absolute best anti-malware in existence is common sense! Don't visit strange websites, don't download and run unknown files, and the like.
Keep Backups!
In the case of the worst possible incident (something being infected), just wipe your system and restore from a clean backup. If you want to be really safe, you can even make your backups offline (through a live boot) so malware won't have a chance to spread to your drive, except in its raw file form.
Encrypt, Baby, Encrypt!
If you have sensitive data on your drive, it's often a good idea to encrypt it. Decrypt the data when you need to work on it, and re-encrypt it the second you're done. You can even store the encrypted data on a separate drive. This ensures that if malware does somehow get on your machine, its window of opportunity is very small.

Keeping these simple tricks in mind, you should be safe from 99.999% of all malware on Linux. You're already on a secure OS, and I assume you haven't made drastic changes to permissions. You'll be just fine!


Help with updating grub and fstab when moving root to another partition on dual boot

At first a warning, this are the first line of grub.conf-file:

#
# DO NOT EDIT THIS FILE
#
# It is automatically generated by grub-mkconfig using templates
# from /etc/grub.d and settings from /etc/default/grub
#

So please don't mess this up, you would make your Ubuntu unbootable.

In your config-file you will see many places with this string:

'hd0,msdos1'

In your case you have to replace that with

'hd0,msdos4',

Use the replace-option in the edit-menu of your texteditor, this will make sure that the string is replaced everywhere in the config-file

in the file /etc/fstab you have to change the UUID of the /-partition
Example:

# / was on /dev/sda1 during installation
UUID=71d24e33-33cc-4815-83cd-92ce3c141be2   /   ....

Find out the UUID of sda4 with

sudo blkid

look for sda4, copy the UUID and paste it over the old UUID.
That's it...

"mount the partition via gnome -> Places option" means to open the places-menu in unity-panel, all volumes are listed there and your volume would be automounted with a single mouseclick (would be mounted to /media/. But that's not important anymore, you have the volume successfully mounted already.

Now you can follow the instructions in step 6 of the community help wiki, i am sure you are able to do...
One  hint for step 6: [instance] is i386-pc in your case...

Good luck...


How to Install Shotwell with Face Detection in Bionic Beaver 18.04 LTS

Here's what you could do:

# Downloads will be our workspace
cd ~/Downloads

# prepare the terrain by removing unwanted divs
sudo apt remove shotwell gir1.2-gexiv2-0.11 -y
# install dependencies (takes about 30 mins to complete)
sudo apt install unzip meson valac libgphoto2-dev libgudev-1.0-dev \
libgee-0.8 libgtk-3-dev gir1.2-gexiv2-0.10 libgexiv2-2 libwebkit2gtk-4.0 \
libgstreamer1.0-0 libgstreamer-plugins-base1.0-dev libgstreamer1.0-dev \
gstreamer1.0-plugins-base gstreamer1.0-plugins-good gstreamer1.0-plugins-bad \
gstreamer1.0-plugins-ugly gstreamer1.0-libav gstreamer1.0-doc \
gstreamer1.0-x gstreamer1.0-alsa gstreamer1.0-gl gstreamer1.0-gtk3 \
gstreamer1.0-qt5 gstreamer1.0-pulseaudio libraw-dev build-essential \
build-essential checkinstall cmake pkg-config yasm gfortran gstreamer1.0-tools \
libjpeg8-dev libpng-dev software-properties-common libjasper1 libtiff-dev \
libavcodec-dev libavformat-dev libswscale-dev libdc1394-22-dev libxine2-dev \
libv4l-dev libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev libgtk2.0-dev \
libtbb-dev qt5-default libatlas-base-dev libfaac-dev libmp3lame-dev libtheora-dev \
libvorbis-dev libxvidcore-dev libopencore-amrnb-dev libopencore-amrwb-dev \
libavresample-dev x264 v4l-utils libprotobuf-dev protobuf-compiler \
libgoogle-glog-dev libgflags-dev libgphoto2-dev libeigen3-dev libhdf5-dev \
doxygen python3-dev python3-pip \
-y
# install one package via pip
sudo -H pip3 install -U pip numpy
# continue install now that pip deps are met
sudo apt -y install python3-testresources

# python virtualenv creation
cd
python3 -m venv opencv-4.1.0-py3
source ~/opencv-4.1.0-py3/bin/activate
# now install python libraries within this virtual environment
pip install wheel numpy scipy matplotlib scikit-image scikit-learn ipython dlib
# quit virtual environment
deactivate

# some post install
cd /usr/include/linux
sudo ln -s -f ../libv4l1-videodev.h videodev.h
cd ~/Downloads

# fulfill opencv 4.1 dependency by building from source
# this won't work yet, working off of :
# https://www.learnopencv.com/install-opencv-4-on-ubuntu-18-04/
sudo apt build-dep opencv
cd ~/Downloads
wget -O opencv-4.1.0.zip https://github.com/opencv/opencv/archive/4.1.0.zip
unzip -q opencv-4.1.0.zip
cd opencv-4.1.0/build
cmake -D CMAKE_BUILD_TYPE=RELEASE \
-D CMAKE_INSTALL_PREFIX=/usr/local \
-D INSTALL_C_EXAMPLES=ON \
-D INSTALL_PYTHON_EXAMPLES=ON \
-D WITH_TBB=ON \
-D WITH_V4L=ON \
-D OPENCV_PYTHON3_INSTALL_PATH=~/opencv-4.1.0-py3/lib/python3.5/site-packages \
-D WITH_QT=ON \
-D WITH_OPENGL=ON \
-D OPENCV_EXTRA_MODULES_PATH=../../opencv_contrib/modules \
-D BUILD_EXAMPLES=ON ..
make -j4
make install
cd build
cmake ..
cmake --build . --config Release
# still need to move built binary to usable space and declare it system-wide

# No idea how to do DNN models
# !!!

# fulfill exiv2 0.27 dependency by building from source
sudo apt build-dep exiv2
cd ~/Downloads
wget https://www.exiv2.org/builds/exiv2-0.27.1-Source.tar.gz
tar xf exiv2-0.27.1-Source.tar.gz
cd exiv2-0.27.1-Source/
cmake .
make
sudo make install

# fulfill libgexiv2-dev 0.12 dependency by building from source
sudo apt build-dep libgexiv2-dev
cd ~/Downloads
wget http://ftp.gnome.org/pub/GNOME/sources/gexiv2/0.12/gexiv2-0.12.0.tar.xz
tar xf gexiv2-0.12.0.tar.xz
cd gexiv2-0.12.0/
meson build
cd build
sudo meson install

# final build of shotwell with face detection
sudo apt build-dep shotwell
cd ~/Downloads
wget https://gitlab.gnome.org/nma83/shotwell/
\-/archive/wip/faces/shotwell-wip-faces.tar.gz
tar xzf shotwell-wip-faces.tar.gz
cd shotwell-wip-faces
meson configure -Dface-detection=true
meson build
cd build
sudo meson install

Note: my post is WIP and edits will be accepted.

Update: I'm losing hope, I can't figure out how to get an install of opencv and how to get the mentioned DNN models from OpenFace.


gdb-qemu : can't put break point on kernel function ( kernel 4.10.0-35)

Make sure you have disabled KASLR (Kernel address space layout randomization) or use add-symbol-file to add kernel symbol file instead of file, so that you can manually specify .text .data and .bss.

  KASLR make exploits harder by placing various objects at random, rather than fixed, addresses.

To disable KASLR, append "nokaslr" parameter to GRUB_CMDLINE_LINUX_DEFAULT in /etc/default/grub file and do update-grub.
e.g.

$ grep "GRUB_CMDLINE_LINUX_DEFAULT" /etc/default/grub
GRUB_CMDLINE_LINUX_DEFAULT="nokaslr"
$ update-grub && reboot


you can use this software usbip and this is how to setup the software and use it on both the server and client side

Notes:

In this tutorial use the server server1.example.com with IP
192.168.0.100 and client client1.example.com with IP 192.168.0.101, both running Ubuntu These settings might differ for you, so you have to replace them where appropriate.
Also The account used in this tutorial is the root so if a command is not working either use the root or use sudo before the command

Installing And Using USB/IP On The Server

We can install usbip as follows:

apt-get install usbip

Afterwards we load the usbip kernel modules:

modprobe usbip

modprobe usbip_common_mod

To check if they really got loaded, run:

lsmod | grep usbip

The output should be similar to this one:

root@server1:~# lsmod | grep usbip
usbip                  15124  0
usbip_common_mod       13605  1 usbip
root@server1:~#

To make sure that both modules get loaded automatically whenever you boot the system, you can add them to /etc/modules:

vi /etc/modules

[...]
usbip
usbip_common_mod

Now we can start the usbip daemon:

root@server1:~# usbipd -D
Bind usbip.ko to a usb device to be exportable!

Now attach a USB device that you want to export to the server - I'm using a SanDisk USB flash drive here.

Execute the command lsusb

to find the corresponding Vendor/Device ID which is in the form of:

Bus XXX Device YYY: ID VendorID:DeviceID

The output on my server is as follows:

root@server1:~# lsusb
Bus 001 Device 002: ID 0781:5151 SanDisk Corp. Cruzer Micro Flash Drive
Bus 001 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub

The Vendor/Device ID of my SanDisk USB flash drive is 0781:5151.

Now run

usbip_bind_driver --list
root@server1:~# usbip_bind_driver --list
List USB devices
 - busid 1-1 (0781:5151)
     1-1:1.0 -> usb-storage

As you see, the Vendor/Device ID of my SanDisk USB flash drive (0781:5151) corresponds to the BUSID 1-1. We need this BUSID to attach the USB device to the server:

root@server1:~# usbip_bind_driver --usbip 1-1
** (process:765): DEBUG:  1-1:1.0       -> usb-storage
** (process:765): DEBUG: unbinding interface
** (process:765): DEBUG: write "add 1-1" to /sys/bus/usb/drivers/usbip/match_busid
** Message: bind 1-1 to usbip, complete!

That's it, we can now use the SanDisk USB flash drive on a remote usbip client.

BTW, if you run...

netstat -tap

... you should see that the usbip daemon is listening on port 3240

so please make sure that this port isn't blocked by your firewall:

root@server1:~# netstat -tap
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name
tcp        0      0 *:ssh                   *:*                     LISTEN      537/sshd
tcp        0      0 *:3240                  *:*                     LISTEN      762/usbipd
tcp        0     52 server1.example.com:ssh 192.168.0.199:4024      ESTABLISHED 667/0
tcp6       0      0 [::]:ssh                [::]:*                  LISTEN      537/sshd

Installing And Using USB/IP On The Client

We need to install usbip on the client as well:

sudo apt-get install usbip

Afterwards we load the vhci-hcd kernel module:

modprobe vhci-hcd

To check if it really got loaded, run:

root@client1:~# lsmod | grep vhci_hcd
vhci_hcd               19800  0
usbip_common_mod       13605  1 vhci_hcd

To make sure that the module gets loaded automatically whenever you boot the system, you can add it to /etc/modules:

vi /etc/modules

[...]
vhci-hcd

Now connect to the usbip server and get a list of available USB devices:

    usbip -l 192.168.0.100
(192.168.0.100 is the IP address of the usbip server.)

You should find the SanDisk USB flash drive in the output (BUSID 1-1):

root@client1:~# usbip -l 192.168.0.100
- 192.168.0.100
     1-1: SanDisk Corp. : Cruzer Micro Flash Drive (0781:5151)
        : /sys/devices/pci0000:00/0000:00:07.2/usb1/1-1
        : (Defined at Interface level) (00/00/00)
        :  0 - Mass Storage / SCSI / Bulk (Zip) (08/06/50)

To attach that device to the client, run:

root@client1:~# usbip -a 192.168.0.100 1-1
8 ports available
port 0 attached

Now run lsusb and you should find the remote USB device in the output on the client:

root@client1:~# lsusb
Bus 001 Device 002: ID 0781:5151 SanDisk Corp. Cruzer Micro 256/512MB Flash Drive
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

You can now use the remote USB device as if it was a local USB device (e.g. mount it, format it, write to it, read form it, etc.).

Detaching A Remote USB Device

A remote USB device can be detached as follows:

client1:

Run...

usbip --port

... to find out the port that the remote USB device uses on the client - in this case it's port 00:

root@client1:~# usbip --port
8 ports available

Port 00: <Port in Use> at High Speed(480Mbps)
       SanDisk Corp. : Cruzer Micro 256/512MB Flash Drive (0781:5151)
       1-1 -> usbip://192.168.0.100:3240/1-1  (remote devid 00010002 (bus/dev 001/002))
       1-1:1.0 used by usb-storage
           /sys/class/bsg/1:0:0:0/device
           /sys/class/scsi_device/1:0:0:0/device
           /sys/class/scsi_disk/1:0:0:0/device
           /sys/class/scsi_host/host1/device
           /sys/class/usb_endpoint/usbdev1.4_ep02/device
           /sys/class/usb_endpoint/usbdev1.4_ep81/device
           /sys/block/sdb/device
Port 01: <Port Available>
Port 02: <Port Available>
Port 03: <Port Available>
Port 04: <Port Available>
Port 05: <Port Available>
Port 06: <Port Available>
Port 07: <Port Available>

We need the port number to detach the device:

usbip -d 00

root@client1:~# usbip -d 00
8 ports available

port 0 detached

On the server, we use the BUSID (1-1) to bind the USB device to the local system (the --other switch binds the device to the local system so that it is not available over the network anymore):

server1:

usbip_bind_driver --other 1-1

root@server1:~# usbip_bind_driver --other 1-1
** (process:7333): DEBUG: write "del 1-1" to /sys/bus/usb/drivers/usbip/match_busid
** Message: bind 1-1 to other drivers than usbip, complete!

Now go back to the client and check if the remote USB device is still available:

client1:

If all goes well, it shouldn't be listed anymore:

root@client1:~# lsusb
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

Links

http://usbip.sourceforge.net

Source of the tutorial (Server Side)

Source of the tutorial (Client Side)


What are the default text editors in different flavours of Ubuntu?

I think Answers by Muzaffar and Terrance serves your need. One thing to note is that you can install any of these text editors in any flavors.

GUI Text Editors

Gedit

Default in:

Ubuntu Unity
Ubuntu Gnome
Ubuntu Kylin
Ubuntu Budgie

Gedit is certainly the most famous text editor in the Ubuntu world. Gedit is also available for Windows and MacOS. To install Gedit on any Ubuntu flavor use the following command:

sudo apt-get install gedit

To open a file with gedit:

gedit /path/to.file.txt

Kate

Default in:

Kubuntu
KDE Neon (not an official Ubuntu flavor)

it is also available for Windows. Like many KDE apps it has a load of features. To install, run:

sudo apt-get install kate

If you want the latest version of Kate, you'll need to add a PPA:

sudo add-apt-repository ppa:kubuntu-ppa/backports
sudo apt-get update
sudo apt-get install kate

To open a file with kate:

kate /path/to.file.txt

Leafpad

Unlike Kate, emphasis of Leafpad is on simplicity and lightness, which is whole agenda of the LXDE project. It comes pre-installed on Lubuntu. To install:

sudo apt-get install leafpad

To open a file with leafpad:

leafpad /path/to.file.txt

Mousepad

Default in:

Xubuntu
Ubuntu Studio

In philosophy, Mousepad is pretty similar to Leafpad. To install:

sudo apt-get install mousepad

To open a file with mousepad:

mousepad /path/to.file.txt

Pluma

Pluma is a fork of Gedit which comes preinstalled in Ubuntu Mate. To install:

sudo apt-get install pluma

To open a file with pluma:

pluma /path/to.file.txt

*Note: if you want to edit files with root privileges, add gksu in front of a command, like this:

gksudo gedit path/to/file.txt

It's best to avoid using it with kate

CLI Text Editors

Nano

sudo apt-get install nano

I don't know if Nano is installed on all the Ubuntu flavors, but it's installed on Ubuntu Unity, Ubuntu Gnome and Kubuntu as per my knowledge.
To open a file with nano use following command:

nano /path/to.file.txt

For more information about Nano, see The Beginner’s Guide to Nano, the Linux Command-Line Text Editor.

Vim

sudo apt-get install vim

To open a file with Vim, type either of these two commands:

vim /path/to.file.txt

or

vi /path/to.file.txt

Vim (or at least vi) is installed by default on all Ubuntu (or any other Linux) flavor. If you start to like Vim and want it to have a user interface try Gvim.  Also note that on some systems, vi is aliased to vim, so both commands do identical things. (which launching vim)

For more knowledge about vim, see A Beginner's Guide to Vim or run vimtutor in the terminal.

Keep in mind that QT apps don't look good on Gtk based desktop and vice versa. but if you want them to feel at home, try this question How to make KDE applications look native in GNOME?

More Linux Text Editors


Avoid duplicate pids while grepping for a pattern

You can use uniq or sort -u:

echo "$line" | grep -i "$pattern" | uniq


can I transfer a software installed in my ubuntu to other ubuntu laptop?

Yes you can download it on your friend's Laptop with apt-get download (NAMEOFPACKAGEHERE) and you will get the deb file used to install the package which can be installed with sudo dpkg -i (NAMEOFPACKAGEHERE).deb on your computer.

As for downloading on Windows computers you can browse the APT repo.

Another option is checking in /var/cache/apt/archives/ for the deb file for the program you want to install.

Also you could use the APT repo in a (MUCH) prettier format


Getting DHCP address in virtual machine with ubuntu 14.04 fails

select machine > settings network > adapter > attached to Bridge Adapter

also check advanced > adapter type to PCnet-FASTIII it has broader compatibility then others

ps: check the name field to be the desired physical adapter


create a video file from series of png images

The "%010d" syntax is only for output files

Instead of

avconv -i 'img_%010d_int.png' -r 20 intensity.mkv

use

avconv -i 'img_*_int.png' -r 20 intensity.mkv


When we search for "rbash sftp doesn't work", we get a large list of messages to various forum boards that rbash and SFTP don't work.  I found a Server Fault page that might help though, so I'll borrow that content from that post over on Server Fault by Server Fault user mr.spuratic.  It might help explain a few things about why standard SFTP fails:

  rbash won't let you run commands with a leading /, if that's being
  attempted then it will simply exit.

  Unless you're using the internal sftp-server, an attempt to exec
  /usr/libexec/sftp-server will fail.

  Using Subsystem       sftp    internal-sftp in the sshd_config
  will fix that.

  However, using rbash won't stop sftp from wandering around your
  filesystem, you probably want to chroot the users
  instead.

So in effect, I believe whatever's happening underneath the hood is trying to get a directory listing of a path beginning with /.  That will fail in rbash.

This said, you need to be aware that as I stated in comments and this answer I borrowed from Server Fault, rbash works best when you also implement chrooted user directories, because SFTP will bypass the restrictions that rbash puts into play and can still technically wander around your filesystem.

You really need to implement, in addition to rbash, chrooted user directories.  This will also protect the SFTP component from drifting around the system.


What is the impact of the nolapic parameter on a multiprocessor laptop?

I don't think there are any limitations under that mode. All It will do Is make one of your processors work, not all of them. Basically, with nolapic it just uses one processor than the number installed.


If its an Asus there is a uefi bios setting that can cause this https://ubuntuforums.org/showthread.php?t=2301908


Keep running a program in terminal over SSH after "Write failed: Broken pipe"

nohup

you can use nohup YOURCOMMAND to prevent the termination of your ssh connection to kill your command. (@byte-commander mentioned it in a comment earlier)


Attempting to re-install ubuntu results in blank gray screen

What GPU you have? The missing driver could possibly cause this... Boot with the mentioned nomodeset from Grub (select kernel, hit e, write at the end of the first line, hit Boot!)

See details here, and feel free to comment, if you need assistance.


Is is possible to have a different sources.list file on the same machine, and each assigned to a different user account?

You can have separated sources lists, but that only means than each repo you add will be defined in a sources.list file which makes more easy to purge a problematic repos. I did that using ubuntu-tweak (there's an option to store each repo in a separated file in the softwar origins tab). But I don't think you can have diferent sources for diferents accounts, since the sources are system-wide and not account specific.

Think about it, that would mean you would have diferent versions of the same program installed in the same system which would be a potential disaster. If an user install libreoffice 3 from the ubuntu repos but another install libreoffice 3.4 from the libreoffice external repos, the 3.4 would "smash" the 3 installation... not to talk about the potential dependency hell you will cause...

The only way I can think for having a diferent account with diferent repos is making a diferent partition in your laptop but that's having two diferents ubuntu installs in the same computer. Then you can use your "normal" ubuntu at home and your "workplace" ubuntu with the office repos. You can make the install so they share the same /home/user so you'll have the same configuration files, the same user, but diferent programs.

Other solution is to install a virtual ubuntu inside your normal ubuntu trough virtualbox, and link that virtual-ubuntu to your office repos. If your laptop is not much old it can handle a virtual os inside the main os without problems for normal office applications like office and such.

Wish it helps, good luck.


Try the alternate installer, and on the partitioning, select the "/" or either "/boot" partition, and put a BOOTABLE flag on it. It will work.


How can I animate my mouse for screencasts?

If you are using compiz (part of Ubuntu's Unity DE) you can install ccsm and there is a mouse option that adds spinning objects around the mouse, you can reduce there spacing to 0 or near it so it will be right on the mouse, if you need to record the keyboard presses/mouse buttons you can use keymon (the debs do not install the program, just dependencies); also i think kazam works better than gtk-record-my-desktop


I was having a similar problem, which started when I upgraded 16.04 to 18.04. I discovered that if I removed the low-latency kernel I had installed a year ago, that the problem went away (so far!).


I've had my share of problems with partitions and dual booting with my machines too. This topic here (http://help.ubuntu.com/community/Grub2/Troubleshooting) was always helpful whenever I bumped into the grub rescue screen of death. You could also try using Ubuntu Live CD and running boot-repair (https://help.ubuntu.com/community/Boot-Repair), but the first solution is almost guaranteed to work.

I would recommend installing Windows first and then installing Ubuntu, but last week I had to do the other way around because Ubuntu was messing with Windows boot files (stupid Sony VAIO and its UEFI/Legacy shenanigans), so I don't think this is always the best way to proceed. If you prefer (or have to, like I did) installing Windows later, you'll have to use Ubuntu Live CD and run boot-repair.


How to install Ubuntu from an external hard drive connected with a SATA to USB adapter cable?

Installing Ubuntu FROM External USB Drive
Ubuntu can be installed from an external USB drive.
There are a few Challenges: Many Live installers such as Etcher, dd, mkusb, Gnome-Disks, Startup Disk Creator, Win32DiskImager, etc, clone the ISO as a ISO9660 partition and overwrite everything on the disk.
Other Live installers such as UNetbootin and YUMI-BIOS/UEFI, (version 0.0.8.1) will install to a partition on the disk, but only to a FAT32 partition They will not overwrite the whole disk like ISO9660 installers will. The maximum size of a FAT32 partition is 32GB on Windows, so most larger drives come as NTFS. A 4GB partition can be created on an external USB drive and Ubuntu Live can be installed to it.
YUMI-BIOS only, (version 2.0.7.9) and Universal USB installer, (version 1.9.9.7), will install to a NTFS partition without overwriting the whole disk or partition. These tools are available free from Pendrivelinux.com.
All of the above installers will overwrite any MBR on the partition being installed to, so we should be careful not to try to install Ubuntu or, any Linux, to a partition with a useful OS on it.


Image won't download in ubuntu one files for android v1.2.3

I'll add a 'Download' as first context menu option in the next update! :)


Apt-get upgraded package from 32bit to unsupported 64bit - why and how to revert?

Obviously the package's name and meta information both tell apt-get that it is a 32bit package, but this was set up falsely by the maintainers.

Until they have fixed this and updated their repository with a real 32bit package, I use the following script to verify the package's true architecture:

#! /bin/bash

dir=$(mktemp -d)
debfile="*_i386.deb"
cd "$dir"

echo "Downloading package..."
wget https://pkg.tox.chat/pool/main/q/qtox/ -r -l 1 -nd -A "$debfile" -q

dpkg -x $debfile "$dir"
printf "\n%s\n\n" $debfile

dpkg --info $debfile | \
    awk '/Architecture/ {printf "defined dpkg architecture is:\t%s\n", $2}'

find "$dir" -type f -exec file -b {} \; | \
        sort -u | \
        awk '/ELF/ {printf "real executable format is: \t\t%s\n", $0}'

rm -rf "$dir"
exit 0

(Parts of the script are taken from A.B.'s answer here.)

I saved it as ~/bin/qtoxtest.sh and made it executable with chmod +x ~/bin/qtoxtest.sh.

The script currently gives the following example output, which tells us that the package is still not correctly declared:

$  qtoxtest.sh
Downloading package...

qtox_1.1~git20150707.cfeeb03-97_i386.deb

defined dpkg architecture is:   i386
real executable format is:      ELF 64-bit LSB executable, x86-64, version 1 (GNU/Linux), statically linked, stripped


Does digiKam supports RAW files of Canon G16?

digikam 3.5 is very old. Current version is 4.12.0 with 4.13.0 due out in the next few days.

You can get the latest, greatest version along with needed updated libraries thanks to Philip Johnsson and his extra ppa: https://launchpad.net/~philip5/+archive/ubuntu/extra


I see how to have Left Alt swapped with Left Win; Can I have Right Alt swapped with Right Win?

I've answered the same question here: How do I swap Left Ctrl with Left Alt on my keyboard?

The short answer is to create a file called ~/.Xmodmap

It needs to contain the following xmodmap expressions to change the key mapping and reset the modifier mapping for both keys. The file needs to contain the following:

clear control
clear mod1
keycode 37 = Alt_L Meta_L
keycode 64 = Control_L
add control = Control_L Control_R
add mod1 = Alt_L Meta_L

Next time you login the new key mappings will be active. To have the changes take effect immediately run the following from terminal:

xmodmap ~/.Xmodmap


Adding my launcher to the Unity Launcher automatically. How?

I actually made a script for that. It places the icon down in the launcher, but with a minor change, you can put it at the top (or any other position) as well.
As it is, it is in python2, but simply change the shebang to #!/usr/bin/env python3 if you'd like to use it as python3. The code is identical.
To use it, the .desktop file needs to be in either /usr/share/applications or in ~/.local/share/applications, but usually that is the case.
How to use

copy the script below, save it as launcher_add.py
make it executable

Run it by the command:
/path/to/launcher_add.py name_of_desktopfile.desktop

you have to use the filename of the .desktop file, without the path.
The script
#!/usr/bin/env python

import subprocess
import sys

desktopfile = sys.argv[1]

def current_launcher():
    get_current = subprocess.check_output(["gsettings", "get", "com.canonical.Unity.Launcher", "favorites"]).decode("utf-8")
    return eval(get_current)

def add_new(desktopfile):
    curr_launcher = current_launcher()
    last = [i for i, x in enumerate(curr_launcher) if x.startswith("application://")][-1]
    new_icon = "application://"+desktopfile
    if not new_icon in curr_launcher:
        curr_launcher.insert(last, new_icon)
        subprocess.Popen(["gsettings", "set", "com.canonical.Unity.Launcher","favorites",str(curr_launcher)])
    else:
        pass

add_new(desktopfile)

The script prevents multiple occasions in the launcher list of the same application, which would cause corruption of he list.


Making specific folder accessible to user for 24 hour only

That would be a bad idea. What you should do instead, is to create a group for those students that should be allowed to access the files in that folder and then add and remove students from that group. This is fairly easy to do. You might have to script the adding and removal from the groups though.


After kernel upgrade initramfs waiting for root device

I am able to mount the rootvg from a rescue CD to booting into a shell just before partitioning starts

mkdir /newroot
Mount the Root volume to /newroot
mount /dev/mapper/rootvg-root /newroot
Mount the boot partition

mount /dev/sda1 /newroot/boot

Mount the var volume

mount /dev/mapper/rootvg-var /newroot/var

Chroot the environment

chroot /newroot

Once chroot you have access to all the tools installed in the system including apt-get, aptitude, zcat etc

Use Zcat to read the initrd.img archive to find if the lvm module got added to sbin/

zcat /boot/initrd.img-3.8.0-44-generic | cpio --extract --verbose --list | fgrep lvm

sbin

sbin/rmmod

sbin/mount.ntfs-3g -> /bin/ntfs-3g

sbin/blkid

sbin/udevd

sbin/mount.fuse

sbin/hwclock

sbin/modprobe

sbin/wait-for-root

sbin/dumpe2fs

sbin/udevadm

sbin/dmsetup

sbin/mount.ntfs -> /bin/ntfs-3g

I cannot find lvm in the image sbin and that's reason for it not able to import the VG and mount the volume.

Correct initrd image should like this

sbin

sbin/rmmod

sbin/mount.ntfs-3g -> /bin/ntfs-3g

sbin/blkid

sbin/udevd

sbin/mount.fuse

sbin/hwclock

sbin/modprobe

sbin/wait-for-root

sbin/dumpe2fs

sbin/udevadm

sbin/lvm

sbin/mount.ntfs -> /bin/ntfs-3g

Update the following file to force load the module

echo "lvm" >>  /etc/initramfs-tools/modules

This will create a new initramfs image

initramfs-update -k -c all

Verify the lvm module got added to the image using

zcat /boot/initrd.img-3.8.0-44-generic | cpio --extract --verbose --list | fgrep lvm

Exit chroot

exit

reboot

Server came back fine.


Lost ability to use rEFInd dual boot after updating to Yosemite OSX 10.10

I fixed this issue by using efibootmgr. If you cannot run Ubuntu, use a live version of it.

First make sure you have efibootmgr installed

sudo apt-get install efibootmgr

Then check the partitions from which EFI can boot

$ sudo efibootmgr
BootCurrent: 0000
Timeout: 5 seconds
BootOrder: 0000,0082
Boot0000* ubuntu
Boot0080* Mac OS X
Boot0081* Mac OS X
Boot0082*
BootFFFF*

In my case it lists 4 partitions. Boot0000 is the Ubuntu partition where GRUB is installed; by default I want to boot this partition.

I found out that Boot0080 is the recovery partition of the old Mavericks installation, while Boot0081 is the Yosemite recovery partition. The partition where Yosemite is actually installed, in my case, is Boot0082.

GRUB is not able to load Mac OS X directly, but I can configure EFI to load the Mac OS X partition when GRUB exits.

So I've run

sudo efibootmgr -o 0000,0082

Which, to recap, means Boot0000, where GRUB is installed, will be run first, then if you exit grub (by pressing c end then typing the command exit) you can boot into Mac OS X.

To make the process of booting Mac OS X more comfortable you can add an entry to the GRUB boot menu which exits and thus starts Mac OS X. Just edit /etc/grub.d/40_custom and append the following

menuentry "Exit to Max OS X" {
  exit
}

And reload the GRUB configuration with

sudo update-grub

All should work.


error: Wrong architecture 'amd64' installing Openstudio

You need to install the 64-bits version of Ubuntu for OpenStudio to work.

If you are sure that your system can handle a 64-bit operating system, download a 64-bit image of Ubuntu, install it, then try again installing OpenStudio.

If your system cannot run a 64-bit operating system, then you won't be able to get OpenStudio to work on Linux.


Can commercial applications use Gsettings?

You don't need to install schema files into /usr/share/glib-2.0/schemas/, they can be installed into any ${XDG_DATA_DIRS}/glib-2.0/schemas/.

So you can install your schema to /opt/<yourapp>/share/glib-2.0/schemas, then have your binary add /opt/<yourapp>/share to the XDG_DATA_DIR environment variable before you try to use GSettings.

This is what we do for Quickly apps being installed into /opt/extra.ubuntu.com/<appname>/


Monitor network usage per process in system monitor

System Monitor is maintained by Gnome.

This idea was reported to Gnome in 2007. They seem to have little interest in pursuing it. See the Gnome wishlist bug on this topic for their reasoning over the years.

Gnome is both open source and welcomes volunteer contributions, so if you are willing to hack at the gnome-system-monitor code, feel free! System Monitor does not have a "plug-in" or "extension" framework; feel free to add that, too.


sudo apt-get update gives me the same list everytime

apt-get update downloads the package lists from the repositories and updates them to get information on the newest versions of packages and their dependencies. It will do this for all repositories and PPAs.

From man apt-get

Used to re-synchronize the package index files from their sources. The indexes of
available packages are fetched from the location(s) specified in /etc/apt
/sources.list(5). An update should always be performed before an upgrade or dist-upgrade.

So basically it shows only the repositories that has been updated

Source


How about

 ps aux | grep $USER | awk '{memory +=$4}; END {print memory }'

ps aux: To see every process on the system using BSD syntax.
$USER is the current user; change it to an actual name if you need someone else.

Now for the magical part:

awk creates a variable called memory and adds column 4 of the output of ps auxU $USER and when it ENDs it prints the calculated amount.

Addition: Graphical method.

  smem memory reporting tool

  smem is a tool that can give numerous reports on memory usage on Linux
  systems. Unlike existing tools, smem can report proportional set size
  (PSS), which is a more meaningful representation of the amount of
  memory used by libraries and applications in a virtual memory system.

  Because large portions of physical memory are typically shared among
  multiple applications, the standard measure of memory usage known as
  resident set size (RSS) will significantly overestimate memory usage.
  PSS instead measures each application's "fair share" of each shared
  area to give a realistic measure.

  smem has many features:

  system overview listing listings by process, mapping, user filtering
  by process, mapping, or user configurable columns from multiple data
  sources configurable output units and percentages configurable headers
  and totals reading live data from /proc reading data snapshots from
  directory mirrors or compressed tarballs lightweight capture tool for
  embedded systems built-in chart generation smem has a few
  requirements:

  a reasonably modern kernel (> 2.6.27 or so)
  a reasonably recent version of Python (2.4 or so)
  the matplotlib library for chart generation (optional, auto-detected)

  Using smem

  show user-oriented view:  smem -u
  (more in the link)'

Installation:


Wubi is still available for newer versions, including 14.04. Go to this page: http://releases.ubuntu.com/   and choose the version you want. In the list of files at the bottom, the very last one will be wubi.exe. Grab that file and run it.


I closed my laptop's screen, opened after 15 minutes and suddenly the display is just very dark

For some reason, going to system settings > brightness & lock (which appeared regularly) and drag the brightness limit to 0 and then to 100, fixed it.

It was on the most right corner and I just dragged it to the most left and then brought it back to the right and the natural brightness came back.

I can't explain this beahvior, maybe it's a bug in the current release, maybe not and I missed something.


Sometimes the Alt+Tab window switcher gets weird and needs two keypresses to switch windows (the first Alt+Tab only highlights the current window)

Workaround: Whenever Ubuntu gets into that weird state, Alt + Shift + Tab seems to get it back into normal behaviour right away.


How can I install grub4dos to my USB stick?

Why not just use grub2?
It works on FAT32, NTFS or Linux formatted partitions.

Examples:
Label partition - if label is grub2 & mount:

sudo grub-install --root-directory=/media/grub2 /dev/sdb

Newer versions automount with $USER name also, this one labeled MC4GB

sudo grub-install --root-directory=/media/fred/MC4GB /dev/sdb

And then you have to manually create your own grub.cfg file with the boot stanza for anything you want to boot. You can copy boot stanzas from your Ubuntu install, but may require some editing.

This will create a grub.cfg or you can just copy your own grub.cfg into /boot/grub. Again label in this example is MC4GB for may flash drive.

sudo grub-mkconfig -o /media/fred/MC4GB/boot/grub/grub.cfg


Ubuntu SDK: How do I implement a "onClick" for an image in QML?

The following code should do what you need by putting the Image into a MouseArea component:

import QtQuick 2.0

MouseArea {
    width: my_background.width
    height: my_background.height
    Image {
        id: my_background
        source: "background.png"
    }
    onClicked: my_background.source = "background.png"
}


Dual booting Windows 10 and Ubuntu 16.04, 4 partitions problem

You don't really have to delete partitions. It is strange that you have it installed in four primary partition. Anyway, that is not a problem: You can create an extend partition for Ubuntu. You are limited to 4 primary partition but you can create many extend partition.

  but what about my 484MB partition?

Do not delete it! it might be to recover the system or the EFI system partition. The only partition you do not need is the :E disk. :C is for the sytem as you know, :E is for storing personal datas.
In your case you could or delete :E to install ubuntu, or resize :C.
To resize :C launch your live media with ubuntu and select "try ubuntu without instaling" Once you've done that launch "gparted" form the dash and resize your :C partition. With 100GB you have more than enough if you do not stock to much personal files in your ubuntu.


You cannot send 13 signals at once but must loop over some list of signals. The following script will do so:

#!/usr/bin/env bash

pid=${1-""}

if [ -z "$pid" ]; then
    echo "a pid must be given";
    exit 1;
fi

siglist=(
    SIGSTOP SIGCONT SIGSTOP SIGCONT SIGSTOP SIGCONT
    SIGSTOP SIGCONT SIGSTOP SIGCONT SIGSTOP SIGCONT
    SIGTERM
)

for sig in "${siglist[@]}"; do
    kill -$sig $pid;
done

exit 0;

Save the script as send-sigs.sh, apply chmod +x send-sigs.sh and then call it like so:

./send-sigs.sh 1234

I used the signals STOP and CONT to alternately freeze and thaw the given pid but you can use different signals to your liking. But be aware that some signals might stop your target process so it won't receive any signals afterwards.


sar - Collect, report, or save system activity information.

Type 'sar -A' to see the report about disk, memory, network for your machine.

To disable the cronjob, comment this lines:

$ grep debian-sa1 /etc/cron.d/sysstat
5-55/10 * * * * root command -v debian-sa1 > /dev/null && debian-sa1 1 1
59 23 * * * root command -v debian-sa1 > /dev/null && debian-sa1 60 2

To disable the service, change this to "false"

$ grep ENABLED /etc/default/sysstat
ENABLED="true"

Finally, stop the service:

$ sudo /etc/init.d/sysstat stop


Install RabbitVCS for Thunar: package thunarx-python missing

Unfortunately, thunarx-python isn't in the PPA for Trusty.  I was successful installing the deb package for Raring from another PPA and setting the following symlink:

$ sudo ln -s "/usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0" "/usr/lib/libpython2.7.so.1.0"

Now I could install the rabbitvcs-thunar package, getting the RabbitVCS menu items in the file menu and the context menu.


I know that this is not the place where to make Android Recommendations but the original question is about an Android APP.

If you wish to SSH your Computer, which is indeed different than "Remote control" which can be achieved by a VNC/Teamviewer Application in a tablet, you may wish to give a chance to JuiceSSH.

JuiceSSH Free Version includes the next features:

  The all in one terminal client for Android including SSH, Local Shell,
  Mosh and Telnet support.

  Features:

  Full colour terminal / ssh client
  Popup keyboard with all those normally hard to find characters
  Use the volume keys to quickly change font size
  External keyboard support
  Official Mosh support (http://mosh.mit.edu)
  Telnet support
  Local Android terminal support
  Click URLs to open in a browser
  Copy & Paste within sessions
  Save / Share SSH transcripts to Dropbox/Evernote/Email & SD card
  UTF-8 character support
  Easily organise your connections by group
  Keep multiple SSH sessions running in the background
  Seamlessly connect 'via' other SSH connections with one click
  Immediate access when you open the app to your frequently used connections
  Password & OpenSSH private key support
  SSH key agent forwarding
  Support for two-factor authentication (eg: Google Authenticator)
  Identities (users/password/keys) are abstracted from connections. Instead of updating every connection when you change your password -
  just update the identity and any connections linked to it will use the
  new password/key.
  Works out of the box with Ubuntu, RedHat, CentOS, Mint, Gentoo and all other flavours of Linux
  zlib compression to improve SSH sessions on high latency connections

I use it for the day-to-day administration of a self hosted server and it is really useful, you feel like being inside of an Ubuntu Terminal.

Some screenshot from my sessions (documented in my blog) are placed here to illustrate some tasks.

JuiceSSH and irssi for connections to IRC servers/channels.

JuiceSSH installing emacs in the server, which can also be used via JuiceSSH

ASCII based representation of an image in the server, really useful in order to see what is the picture.

The usage of JuiceSSH is really simple. You create the profiles which will include the username and password, then create the servers and use both in conjunction in order to make a connection, which means that if you admin more than one server, the same profile may be applied to many of them.

Remember to make the server reachable via LAN/WAN by allowing the Firewall the connections via port 22 in your favorite Firewall application. I use Firestarter in Ubuntu 12.04 and it does an awesome work so far. For external connections remember to forward the port 22 to the proper IP/Device where appropriate.

If you need further support or this answer doesn't fit your needs don't hesitate to drop a comment.

Good luck!

P.S. When SSH'ing a server, Midnight Commander and its included mcEdit text editor will be your best friends. Just a suggestion. :D


Music player that plays Youtube playlists

vlc

The stable VLC in *ubuntu 14.04 is version 2.1. To get the latest stable version:

sudo add-apt-repository ppa:mc3man/trusty-media&&sudo apt-get update&&sudo apt-get install vlc

can do this via a specific addon.

Look up the page for instructions - among others:

Installation:

put the file in the vlc /lua/playlist folder, by default:
Linux (all users): /usr/lib/vlc/lua/playlist/
Linux (current user): ~/.local/share/vlc/lua/playlist/

How to use:

Copy the URL of the youtube video or playlist (must contain "list=PL...")
Start VLC, press Ctrl+N, paste the url then click on "Play" (or Alt+P then Enter), the video /playlist should start

(In 'Media', 'Save Playlist to File' and may open it later in VLC.)

Now I see that this answer was already given here, although with a different link.

Also, I find interesting an application that runs in the terminal, Youtube Viewer (youtube-viewer) and uses mplayer or mpv to play the youtube video.

sudo add-apt-repository ppa:nilarimogard/webupd8
sudo apt-get update
sudo apt-get install youtube-viewer

More here.

By default it uses mplayer. To make it use mpv instead, run youtube-viewer --video-player=mpv. So, a desktop file with this content may be useful:

[Desktop Entry]
Exec=bash -c 'youtube-viewer --video-player=mpv'
Icon=youtube-viewer
Name[en_US]=Youtube Viewer
Name=Youtube Viewer
Terminal=true
Type=Application

When running the program, a terminal window opens, saying:

=>> Search for YouTube videos (:h for help)
> ^J>

Running :h for help, you get a lot of options, amongst which

[playlist-url]    : display videos from a playlistURL
:playlist=ID      : display videos from a playlistID

This means that just pasting a playlist's URL will show the playlist in the terminal as a list. (Alternatively, instead of the whole URL, :playlist=ID, where ID is the last part of the URL (after list=). Then, to play it in the video player, type the numbers of the playlist items: for a whole playlist of 10 items, 1-10, etc.

If you really don't care about the video and want mainly the audio, you can take a look at this question on how to play only audio of youtube videos.

The idea is to use mps-youtube, similar to Youtube Viewer, but audio only. To see a playlist there, just type pl <url or id>. Then similarly, something like 1-10, and the sound will be played.

Youtube Viewer can be also used with audio only by adding a corresponding argument for mpv player: youtube-viewer --video-player=mplayer -novideo.

To use VLC without video, the arguments are:

cvlc --vout none <URL>
cvlc --no-video <URL>

NOTE that for some reason not all youtube playlists can be accessed in this way.


Can't boot from Live CD and can't find /boot/grub - next option?

Booting from the Live CD will give you many more options to restore or recreate your GRUB configuration files.  I believe this will include the grub-* programs or update-grub2.

  I've tried booting from my Live CD, and tried burning a new one just in case it was corrupted but I still arrive back at the grub rescue> prompt.

The fact that your Live CD boot does not work implies your BIOS settings are set to check your HDD before your CD/DVD drive.  I would enter your BIOS and check the "Boot Priority", typically found on the Boot Tab.

Also, many BIOSes I have seen, especially in the past few years, have a "Boot Override" selection in the Save & Exit Tab.  You could try to force the BIOS to boot from the Live CD using this method.


Kubuntu Screensaver create multiple process and after close , all of theme doesn't close

A bug has been filed in this regard:

https://bugs.kde.org/show_bug.cgi?id=314859

I've got the same behaviour with multiple keuphoria.kss windows after login (varying from 1 to 7+ windows).


Why isn't the wallpapers changed when I upgrade to a beta release?

This is because the branding is the last thing Ubuntu does to the system installations. If you want your system completely rebranded, you should wait until the final release.


Is there a ubuntu meta-package for the mono command line tools and ASP.NET tools?

Probably the best package available for your request is mono-complete which has the

  complete Mono runtime, development tools and all libraries

according to the Ubuntu package listings. This is for Precise, so if you are running an earlier version I should check out the equivalent at Ubuntu packages.

Running the command

sudo apt-get install mono-complete

will install what you do not have already.

However, although this is arguably the best package available it may not install everything you want, but will certainly allow you to enter fewer commands to get mono set up.


Free space issue Ubuntu 14.04 not loging in after update

I have the same issue. I used Synaptic; searched for 4.4.0-38; marked for removal; apply. After, apparently redundant, not required, I ran "suso update-grub" then rebooted. Just for sanity, after reboot, I ran "sudo apt-get autoremove" then "sudo apt-get clean" then "sudo apt -f install"

I rebooted, again, and all was well, running kernel 3.19.0-69.

Then I ran the system tools - administration - software updater, which started to re-install 4.4.0-68. I cancelled the system update. Still Googling for a permanent fix for not being able to log into 4.4.0-38.

I can't take credit for the following - found them online. I've successfully used them all:

Show all saved versions of kernel - Ubuntu

dpkg -l linux-image-\* | grep ^ii

Show all kernels and headers that can be removed, excluding the current running kernel - Ubuntu

kernelver=$(uname -r | sed -r 's/-[a-z]+//') dpkg -l linux-{image,headers}-"[0-9]*" | awk '/ii/{print $2}' | grep -ve $kernelver

After upgrading kernels and rebooting to test it, you can remove all other old kernels with: (Ubuntu)

sudo apt-get purge $(dpkg -l linux-{image,headers}-"[0-9]*" | awk '/ii/{print $2}' | grep -ve "$(uname -r | sed -r 's/-[a-z]+//')")


Login screen black (and non-functional) after 18.04 update

This was solved using:

sudo apt-get install sddm
sudo dpkg-reconfigure sddm


Why doesn't this second nohup command run?

Adding

sleep 1

to the end of the script seems to have resolved the issue.


Xubuntu 16.04 wireless not working anymore on ms-1688

Based on your output the reason wireless doesn't work is that your particular laptop doesn't have the optional wifi or if it does, the card is faulty.

The specs are as follows:

• Intel® Core™ i3 Processor
• Genuine Windows® 7 Home Premium
(MSI recommends upgrade to Genuine Windows® 7 Professional)
• 15.6” 16:9 wide screen display
• Easy-to-carry lightweight design
• ATi HD545V with DDR3 512MB VRAM graphics card
• 802.11b/g/n Wireless LAN with Bluetooth (optional)
• HDMI (High-Definition Multimedia Interface) Output
• Exclusive GPU Boost Technology
• msi Exclusive ECO Engine Power Management System

The fact that it doesn't show up in the lshw command indicates that it isn't there (or isn't connected). If your certain that you have one, visually verify that it exists and insure that it's properly connected.

Source


Android client can't access shared files from another account?

Right now we don't expose shares in the Android client. It could be considered either a bug or a feature request  :)
Either way, it's on our horizon to extend the application, but I can't give you any estimated dates at the moment.


Port Forwarding from domain1.com:25565 to 40000 and from domain2.com:25565 to 30000

Typically, the incoming packets attempting to initiate a connection wouldn't contain the destination domain name, only the destination IP address. Therefore there isn't enough information to create any iptables rules to redirect the packets. You can not do what you are trying to do.

Now, you might be aware that often web servers can deal with many different domains, all resolving to one IP address. That is done via the web server configuration, and not at the network packet level. Eventually, once the network connection has been established, the destination domain name is included and the web server can decide what actual pages the user is trying to access and respond accordingly.


Replace Mint with Ubuntu in dual booting system

If you want to use the Mint partitions (this will ERASE Mint), in the screen that you described in your question you have to select the option "Something Else", then:

Select the ext4 partition
Set the mount point to /
Flag the format the partition option

If my memory assist me good enough the swap area is auto-detected.

In the something else screen you have a mini-gParted during the installation, so pay attention on what you're doing.


Running VST Plugins on Ubuntu Linux by Building Ardour with VST Support. A complete step by step tutorial is here

http://noisyheron.wordpress.com/2009/04/05/running-vst-plugins-on-ubuntu-linux-by-building-ardour-with-vst-support/

and one more, LMMS tutorial on where to get VST instruments or effects and how to add them.

http://brycecoulson.com/tutorials/vstinstruments/.


Can Unity reprogram Touchpad mouse click 2 to a keyboard key?

This is probably not suited as a feature for Unity - it's more related to configuring the underlying X11 input devices. I'm not sure how to do it, but I am certain there is some X11 feature that lets you do this, an there probably is no nice GUI for it so I hope you don't mind text config files or scripts :-)

It seems someone on stackoverflow already have solves this problem maybe... https://stackoverflow.com/questions/294177/is-it-possible-to-map-a-key-press-to-simulate-middle-click-in-xwindows


Use webcam to sense lighting condition and adjust screen brightness

I've improved on my previous attempt (python):

import opencv
import opencv.highgui
import time
import commands

def get_image():
    image = opencv.highgui.cvQueryFrame(camera)
    return opencv.adaptors.Ipl2PIL(image)

camera = opencv.highgui.cvCreateCameraCapture(-1)

while 1:
    image = get_image()
    image.thumbnail((32, 24, ))
    image = tuple(ord(i) for i in image.tostring())
    x = int((int((max(image) / 256.0) * 10) + 1) ** 0.5 / 3 * 10)
    cmd = ("sudo su -c 'echo " + str(x) +
        " > /sys/devices/virtual/backlight/acpi_video0/brightness'")
    status, output = commands.getstatusoutput(cmd)
    assert status is 0

Two problems with this approach: The display brightness, at least with my webcam, never goes lower than four, because the camera doesn't work well in darkness, and it might skip a bit between four and five. Anyway,

This is how to use it:

sudo apt-get install python-opencv
Save this script somewhere, say ~/test.py
Run it via python test.py

Instead of the average brightness, I'm now getting the maximum brightness of a small tumbnail (this is to avoid dead pixel problems and make it faster). And at least with my combination of lights and camera, it works rather well!

Give it a try (:


The screen locks as soon as I close the lid of my laptop

Go to Gnome Control Center --> Brightness and Lock and turn off Lock and uncheck require my password.


How to mount ubuntu share on other ubuntu machine?

I would suggest to use NFS to share between Ubuntu (Linux) machines.

Take a look at https://help.ubuntu.com/community/SettingUpNFSHowTo

Maybe be you have to install the package rpcbind additionally.


Strange behavior when copy-pasting in libreoffice writer

You may be running into problems because LibreOffice writer is pasting the formatting as well as the text. If you don't need to preserve the formatting, you can select "Paste Special..." from the Edit menu (or press ctrl+shift+V) and select "Unformatted text". Note that this will also erase any character-level formatting such as bold, italics, etc.


If you are using gpg-agent all passwords (including the master password) are stored/saved in ~/.password-store.

From the "pass" website:

  There will be a nice password input dialog using the standard gpg-agent (which can be configured to stay authenticated for several minutes), since all passwords are encrypted.

gpg-agent manual page:

--default-cache-ttl n  Set the time a cache entry is valid to n seconds.
The default is 600 seconds.

--default-cache-ttl-ssh n Set the time a cache entry used for SSH keys
is valid to n seconds.
The default is 1800 seconds.

--max-cache-ttl n  Set the maximum time a cache entry is valid to n seconds.

After this time a cache entry will be expired even if it has been accessed recently.
The default is 2 hours (7200 seconds).

--max-cache-ttl-ssh n Set the maximum time a cache entry used for SSH keys is valid
to n seconds. After this time a cache entry will be expired even if
it has been accessed recently.
The default is 2 hours (7200 seconds).

and ...

  gpg-agent.conf

  This is the standard configuration file read by gpg-agent on
      startup. It may contain any valid long option; the leading
      two dashes may not be entered and the option may not be abbreviated.
      This file is also read after a SIGHUP however only a few
      options will actually have an effect. This default name may be
      changed on the command line (see: [option --options]).
      You should backup this file.

This will only be read if you actually use gpg-agent. If it is "seahorse" (the default in Ubuntu) gpg-agent is ignored).

So you can put any of the 4 parameters in the configuration file with a time in seconds to keep password valid (that includes the master password since that is also stored in ). To release the passwords you can use echo RELOADAGENT | gpg-connect-agent (see the manual for more options).


Deja-dup keeps asking me for my password every few minutes and doesn't seem to be doing anything

I have already encountered this problem (in Ubuntu). I solved it by deleting all the files of the last backup. This solution does not work in all case hope it may help you.


why am i not able to add any ppa repositories?

Reading the last line: "Launchpad PPA for Daniel Richter" not changed gpg: Total number processed: 1 GPG: unchanged: 1

It looks like the ppa is already enabled. Try this:

cat /etc/apt/sources.list.d/danielrichter2007-grub-customizer-precise.list

I have this same ppa enabled and the output should be this:

darent@helena:~$ cat /etc/apt/sources.list.d/danielrichter2007-grub-customizer-precise.list
deb http://ppa.launchpad.net/danielrichter2007/grub-customizer/ubuntu precise main #Grub Customizer PPA

Good luck!


Why do most window managers fail to show a custom cursor correctly?

Edit this file /usr/share/icons/default/index.theme and type the cursor theme then logout and login again, it should work on all windows.


How to emulate XInput device with DirectInput gamepad?

Answered here by Reddit user theliphantGen:

As I spent quite some time to figure it out I just wanted to note this somewhere.
Long story short - I couldn't make Brutal Legend or Shank to recognize any of my gamepads. Today I found out that xboxdrv can work on top of ANY joystick/gamepad using evdev. So with this simple mapping I have xboxdrv create another gamepad which mimics xbox360 controller using xpad driver and works out-of-the-box in both Shank and Brutal Legend (and should with others too):
xboxdrv --evdev /dev/input/event15 --evdev-absmap ABS_X=x1,ABS_Y=y1,ABS_RZ=x2,ABS_Z=y2,ABS_HAT0X=dpad_x,ABS_HAT0Y=dpad_y --axismap -Y1=Y1,-Y2=Y2 --evdev-keymap BTN_TOP=x,BTN_TRIGGER=y,BTN_THUMB2=a,BTN_THUMB=b,BTN_BASE3=back,BTN_BASE4=start,BTN_BASE=lb,BTN_BASE2=rb,BTN_TOP2=lt,BTN_PINKIE=rt,BTN_BASE5=tl,BTN_BASE6=tr --mimic-xpad --silent

/dev/input/event15 should point to correct event device of your gamepad. This is the mapping for PS2 controller adapter. You can adjust it by removing --silent and adding --evdev-debug to output evdev codes for pressed buttons/axes


16.04 new installation gives grub-efi-amd64-signed failed installation /target/ ubuntu 16.04 at the end

I had exactly the same issue installing 16.04 64 desktop on a new SSD with UEFI enabled using USB install media. Unlike in the question I chose to create my own partitions as I had other disks to mount. I hit this error near the beginning of the package installation.

After a bit of googling I found this page:

https://help.ubuntu.com/community/UEFI#General_principles

which states in the General principles section:

  if there was not any UEFI partition on your HDD, you first will have
  to create it

and points to:

https://help.ubuntu.com/community/UEFI#Creating_an_EFI_System_Partition

Which states:

Mount point: /boot/efi (remark: no need to set this mount point when using the manual partitioning, the Ubuntu installer will detect it automatically)
Size: minimum 100Mib. 200MiB recommended.
Type: FAT32
Other: needs a "boot" flag.

So I reinstalled and when I came to partition my drive, I chose the EFI option from the list that includes filesystems and swap etc and made it 200MB at the start of the disk. I did not get the option to select the filesystem or set the bootable flag.

After this the rest of the install went fine.

This is how the partitions on this disk look after the install:

The same information can be seen by running parted:

$ sudo parted /dev/sda
GNU Parted 3.2
Using /dev/sda
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) p
Model: ATA Samsung SSD 750 (scsi)
Disk /dev/sda: 250GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags:

Number  Start   End    Size    File system     Name  Flags
 2      1049kB  200MB  199MB   fat32                 boot, esp
 3      200MB   242GB  242GB   ext4
 1      242GB   250GB  8000MB  linux-swap(v1)

(parted) q

Note that the partition that was created is an EFI System Partition (ESP) and the disk has a GUID Partition Table (GPT) rather than an MBR partition table.

If you look in /boot/efi or /sys/firmware/efi/ on this disk you should find them populated, likewise running sudo efibootmgr should provide real output, see the link below if you want more information.

More Information

If you wish to know more about how UEFI works then the post UEFI boot: how does that actually work, then? by Adam Williamson is highly recommended.

He describes the situation that causes this error in the article (note that he is a Fedora user but the same applies for Ubuntu):

  Handling EFI system partition if doing manual partitioning

  I can only give authoritative advice for Fedora here, but the gist may
  be useful for other distros / OSes.

  If you allow Fedora to handle partitioning for you when doing a UEFI
  native installation – and you use a GPT-formatted disk, or allow it to
  reformat the disk (by deleting all existing partitions) – it will
  handle the EFI system partition stuff for you.

  If you use custom partitioning, though, it will expect you to provide
  an EFI system partition for the installer to use. If you don’t do
  this, the installer will complain (with a somewhat confusing error
  message) and refuse to let you start the installation.

  So if you’re doing a UEFI native install and using custom
  partitioning, you need to ensure that a partition of the ‘EFI system
  partition’ type is mounted at /boot/efi – this is where Fedora expects
  to find the EFI system partition it’s using. If there is an existing
  EFI system partition on the system, just set its mount point to
  /boot/efi. If there is not an EFI system partition yet, create a
  partition, set its type to EFI system partition, make it at least
  200MB big (500MB is good), and set its mount point to /boot/efi


Dual boot Windows 7 64-bit Ubuntu Studio 13.10 64-bit Asus M5A99X EVO R2.0 AMD FX-8350 UEFI secure boot

Windows 7 doesn't support Secure Boot, so if Windows 7 is already installed, Secure Boot is disabled (or perhaps not supported at all by your motherboard).

Chances are Ubuntu is mostly installed, and you need only install any EFI boot loader you like. Given your current situation, either of two options is likely to be the easiest:

Download and prepare a USB flash drive or CD-R of my rEFInd boot manager. You should be able to boot to that, and from there into Ubuntu. Once Ubuntu is running, you can install the Debian-package version of rEFInd, and it should become your default boot manager.
Run the Boot Repair tool from an Ubuntu live CD. This action should install a fresh copy of GRUB on your hard disk and make it the default.

Neither option is 100% guaranteed to work. If both fail, post back with the URL that Boot Repair provides and a description of what happened.

You could also try any of the other boot loaders described on my EFI boot loaders page. Installing most of them will take more effort than installing rEFInd or using Boot Repair, but if you learn to do it, you'll be better able to cope with problems in the future.


I managed to resolve my issue using "purge" to the 460 driver and all nvidia drivers as well. The driver that worked for me was de 450 tho.


We you log onto Ubuntu and the resolution mysteriously changes or all your desktop icons are gone, chances are good you logged into a "Guest Session" the simple solution is to log off and log back on using your "normal" account.

In some cases you may need to reboot if your software behaves abnormally like conky did in this AU Question: (Accidentally logged into Guest account, then normal account & conky broken) where I logged out of "Guest Session" and immediately logged into "normal" account without rebooting.


Unable to start 'network' in recovery mode

You will need to boot to runlevel3 to access network without the GUI from the grub menu. Follow these steps:

Boot to the grub menu
Make sure your selection is the first entry, then press the e key to access the kernel command line.
Use your cursor to go down to where you will see the word linux, at that point press the end key. This will take you to the end of that line.
Using the backspace key delete the entry $vt_handoff, then add this line there:

systemd.unit=runlevel3.target

Now press Ctrl + x to boot.

You should be in the runlevel 3 which gives you access to network on your system.


How to access and modify files from my Windows installation?

It's not clear what you mean when you say drop into a root prompt.  Most likely you're saying drop into a console prompt (where you see a black screen).

Unless you installed something special that you're trying to run after your OS installation you don't have to be concerned with the files in the /opt folder.  However, you will have to be concerned with the files in the /usr directory.  The lack of that directory will prevent normal functionality.

If all you did was move the /usr directory and it's othewise still in tact you can boon into the live disk (try ubuntu), mount that drive, and move the directory structure back to where it originally was.

When you boot into the live cd try option you'll have full access (the "root prompt") included.

You can't do this from Windows.  But you can do it from Ubuntu.


how to set charging to 80% on ubuntu 20.04?

I wrote a command line application that does this.
The easiest way to get started is download the app from the releases page and run
$ ./bat --help

from the terminal in the directory where it is located which should show the help documentation.
If there's an error, it might have to do with permissions. The following command might solve the problem.
chmod +x ./bat

Basically, running
$ ./bat --threshold

will print out the current threshold.
To set a new threshold, say 60%, run
./bat --threshold 60

To persist the current threshold between restarts, run
sudo ./bat --persist

Note: Persisting uses systemd under the hood but this is bundled with most Linux distributions including Ubuntu.
Tip: Putting the app in a directory like /usr/local/bin/ that is in the $PATH will enable you to run it from anywhere and not just in the directory the app is in. Then the above commands become,
bat --help

bat --threshold 60

bat --persist

respectively.


Where can I change shortcut for expo in current workspace only (ALT+SHIFT+up)?

This function is provided by the Scale plugin. You can change the shortcut in CompizConfig Settings Manager ▸ Scale ▸ Bindings ▸ Initiate Window Picker.


Disable compression for ReplayGain in Banshee

Banshee currently does neither; it doesn't handle clipping at all, merely applying the needed gain.  This is somewhat less important given that it also doesn't expose the pre-amp knob so it's much less likely that the audio will clip in the first place.

So, the answer to the question “How do I disable compression for ReplayGain in Banshee” is: you do nothing; there is no compression for ReplayGain in Banshee ☺.

Banshee's ReplayGain support is largely influenced by what I care about and think makes sense from a UI perspective.  There are a bunch of knobs that could potentially be exposed, but I don't think make a huge amount of sense, or should be automatic (selection of album versus track gain, for example).

Clipping prevention is something that probably should be implemented, though.  At some point ☺.


How can I get the names contained in the first file that are not i?

If they're sorted and separated by newlines, you could use comm show you the lines that are unique to file1:

comm -23 file1 file2

A demonstration:

$ comm -23 <(echo -e 'john\nmike\nanna\npaul\nlaura'|sort) <(echo -e 'john\nmike\npaul'|sort)
anna
laura

Or you could diff to do much the same thing (the grep is looking for line deletions):

diff sorted-file-1 sorted-file-2 | grep -oP '(?<=< ).+'

If you need to avoid sorting or you're dealing with serious numbers, I'd turn to a proper language to do dictionary-based lookups. Simple python example:

file2 = {}
with open("file2") as f:
    for line in f:
        file2[line] = 0

with open("file1") as f:
    for line in f:
        if not line in file2:
            print line

Anything bigger than that and you might want to look at an actual database and some simple SQL. They're geared for big data.


Theme not displaying correctly (logo, terminal) 16.04

So I solved the problem.
First I ran:

sudo update-alternatives --config default.plymouth

And selected

/usr/share/plymouth/themes/ubuntu-logo/ubuntu-logo.plymouth        100       manual mode

And it worked fine.

To solve the theme inconsistencies, I ran:

sudo apt-get purge numix*

Removing both the gtk-theme and the icon-theme, restarted, re-added the PPA of Numix, and installed the theme, went to Unity Tweak Tool, selected Numix and it was fine.


The Cryptkeeper indicator doesn't show in the Unity panel on the top-right in 12.04. This is a known bug.
Until the bug is fixed, the workaround is to whitelist its indicator via dconf-editor; install it via the dconf-tools package if necessary.
Open dconf-editor, go down to Desktop-->Unity-->Panel, and add the highlighted part as shown in the screenshot. Then close.

Logout, start Cryptkeeper, and the indicator should now appear as below:


If you are using Gnome then it would seem that you don't actually  need to use XFCE and therefore it would perhaps be best to revert to Network Manager.

To do this, you need to follow these steps:

For Gnome / Unity

Open up a Terminal and execute the following commands:

Install NetworkManager:

    sudo apt-get install network-manager-gnome network-manager
Then remove WICD:

    sudo apt-get remove wicd wicd-gtk

Restart your system. Confirm everything is working, then remove WICD config files:

    sudo dpkg --purge wicd wicd-gtk


Screen Tearing on Ubuntu Xorg 20.04 with Intel Graphics

This didn't work for me, unfortunately. I was able to fix with modifying my /etc/X11/xorg.conf.d/20-intel-graphics.conf file to include DRI3, which I found here
Section "Module"
    Load "dri3"
EndSection

Section "Device"
    Identifier  "Intel Graphics"
    Driver      "intel"
    Option      "DRI"   "3"
EndSection


Connect WebKit WebView form to a Python callback?

Ways to communicate from an embedded WebKit widget to the controlling Python program

Gtk or Qt:

set window.status from JavaScript; trap the corresponding event in Python
set document.title from JavaScript; trap the corresponding event in Python
redirect the page to a custom URL (say, x-my-app:thing1/thing2/thing3); trap navigation-policy-decision-requested event in Python and look at the URL that's being navigated to, and deal with it if it's your custom URL scheme

Qt only:

use frame.addToJavaScriptWindowObject to add a (specifically designed) Python object to the JavaScript global namespace; call methods on it from JavaScript. (See http://pysnippet.blogspot.com/2010/01/calling-python-from-javascript-in-pyqts.html for an example.)

Methods which theoretically should work but in practice don't, very well

Fire a custom DOM event on an HTML element (which would include the document object) from JavaScript; trap that event in Python by navigating the WebKit DOM from Python and listening for events. This works, but I can't find a way of having Python be able to read custom data from the event, which means that you can't pass information other than the event having fired.

Ways to communicate from Python to JavaScript

use webview.execute_script(js_code). Note that if you're passing variable values in with the JS, it's a good idea to JSON encode them; that way you can worry a bit less about escaping, and JS can read JSON natively

Here's some example Gtk code:

from gi.repository import Gtk,WebKit
import json

w = Gtk.Window()
v = WebKit.WebView()
sw = Gtk.ScrolledWindow()
w.add(sw)
sw.add(v)
w.set_size_request(400,300)
w.connect("destroy", lambda q: Gtk.main_quit())
def window_title_change(v, param):
    if not v.get_title():
        return
    if v.get_title().startswith("msgtopython:::"):
        message = v.get_title().split(":::",1)[1]
        # Now, send a message back to JavaScript
        return_message = "You chose '%s'. How interesting." % message
        v.execute_script("jscallback(%s)" % json.dumps(return_message))
v.connect("notify::title", window_title_change)
v.load_html_string("""<!doctype html>

<title>A demo</title>

A tiny JavaScript demonstration

<form>

What's your favourite thing about Jono? <select>
    <option>------choose one------</option>
    <option>his beard</option>
    <option>his infectious sense of humour</option>
    <option>his infectious diseases</option>
    <option>his guitar ability</option>
    <option>his wife</option>
</select>

</form>

""", "file:///")
w.show_all()
Gtk.main()


Does 64 Bit AMD Works on intell core 2 duo?

Yes. The AMD64 architecture was developed by AMD as an extension to the Intel x86 architecture. It is implemented by AMD and Intel in consumer-grade 64-bit CPUs. AMD64 is alternately called x86-64 (which makes its Intel heritage more apparent).


Is Ubuntu compatible with laptops that have touch screen features?

Yes of course. I know some Dell and HP models that work well.

Take a look at the Ubuntu wiki help page on touch screen devices for tips on configuration.


Which VGA is in use if I'm gaming? (amd hybrid laptop)

On modern systems with Intel/AMD hybrid it's usually Intel by default and if you want to run something on AMD GPU you set environment variable DRI_PRIME=1 for that process. For example, if you know how to start the process in question from command line you can just add the variable before the command:

$ DRI_PRIME=1 glxinfo | grep Device
Device: AMD ...

As opposed to

$ glxinfo | grep Device
Device: Mesa DRI Intel...

If you are trying to run Steam game, try this exact line in Launch Options setting for the game:

DRI_PRIME=1 %command%


I've had this problem consistently with each version of Ubuntu since 9.04. For me, I had to add the users to the audio and pulse-access groups, and to do so, you'll need sudo rights and a graphical user interface, or a text editor. In my case, I use vim from the terminal. You may wish to use gedit:

    evilsupahfly@black-beast:~$ sudo vim /etc/group
    (enter sudo password)

Find the audio and pulse-access groups (only one group listed per line) and append the users to the list, each with a comma but no space:

    audio:x:29:pulse,evilsupahfly,doc-brown,marty_mcfly
    ...
    pulse-access:x:123:evilsupahfly,doc-brown,marty_mcfly

Don't change any other groups, and don't erase anything that's already there. Just add the names so they make a list like mine, above (obviously not with those names) and save your changes. After that, usually, logging out and back in will restore sound, but sometimes you need a full-on reboot.

Edit: Some non-Unity desktop environments, like Cinnamon (to name just one), will allow you to manage the group settings right from the user settings control panel, but sadly, default Unity doesn't (see screenshot) requiring you to manually edit /etc/group to make the changes.


How to switch windows of the application in Ubuntu 18.04

We can use Alt+` (usually the button with tilde symbol, the one between Tab and Esc) to switch between the windows of the same type. Additionally, to switch between tabs in the same window, we can use Ctrl+Tab or Ctrl+Pg Up/Pg Dn depending on the application.


Usually this is a result of no configuration of the shell during startup.

Try running a new shell with the command bash -ls

This will give you a login shell as when logging in with SSH.


Where is the X.org config file? How do I configure X there?

The xorg.conf does not exist by default any more. You CAN create one though.

Boot into recovery mode and select Root Shell. Then run:

X -configure

Then:

cp /root/xorg.conf.new /etc/X11/xorg.conf

Reboot and you can edit the new Xorg.conf.


How should I specify command-line arguments for MongoDB?

The various parameters that you wish to enable or disable can be set in the

/etc/mongodb.conf

config file.

All the command-line parameters can be mentioned in that file, and setting the values to true or false.

In your case, add a line as follows, preferably somewhere after the dbpath is mentioned.

rest = true

After each change to the configuration file, you need to restart the server to take effect:

sudo service mongodb restart

For more options, take a look at the documentation.


Run sudo apt-get autoremove --purge skype-bin and the install the new package you downloaded from the Skype site, with sudo dpkg -i newskype.deb (where newskype.deb is the filename of the package you downloaded.


Not able to log-in ubuntu using pkcs#11 module

Problem is in trace statements.. Internally we called syslog() in trace, here bug raised because of not closing the log (i.e: closelog() is missing). Now there is no problem with the module..


To compile the file, open your terminal and type

javac filename.java

To run the generated class file, use

java filename

But to do this you need to have the Java JDK installed in your computer. You can install it with the instructions in How do I install Java?.


How to resolve the Error opening directory '/etc/cups/ssl': Permission denied error in Disk Usage Analyzer?

It is OK. Some directories do not have permissions to list the content for a non-root user.

These directories usually are not large and that "problem" does not seriously affect the result of the scan.

You can ignore it safely.

If you really suspect that something is wrong in this directory in terms of disk usage, you can look into it by

sudo ls -l /etc/cups/ssl

It should have only two symlinks there.


To see your model number, open a Terminal with Ctrl + Alt + T and type:

sudo dmidecode | grep Version | sed -n '2p'

or alternatively type:

sudo dmidecode | grep 'SKU Number' | head -1

to see your SKU Number.

If you want to see a more detailed view of your System information type:

sudo dmidecode | grep -A 9 "System Information"

or

sudo dmidecode | less

and use the  ↓  key to go to the section System Information.


Connect Windows 8.1 to Ubuntu 14.04 using crossover cable

Connect the computers using your crossover cable (may not be necessary most modern ethernet cards should auto negotiate the connection see this Wikipedia article.)
Setup both computers IPv4 settings:

On the Ubuntu computer go to network connections and edit your current connection by doing the following:

Select the IPv4 tab
Select "manual" from the method drop down box.
Click the add button
Enter an address that makes sense like 192.168.1.2
Enter a netmask that makes sense like 255.255.255.0
Gateway can be left blank.

I don't have a Windows 8.1 computer but you should be able to select the network adapter and configure the IPv4 settings.

Use a different IPv4 address that makes sense like 192.168.1.3
Use the same netmask

Verify the connection works by using the ping on the ubuntu computer:  open a terminal by pressing Ctrl+Alt+T at the same time.  At the prompt, type: ping 192.168.1.3 or the address of the Windows computer.  If you get a response, then the connection is working.
To transfer files you have a few choices. Windows file sharing (Samba), FTP, or SCP.  I would start with Windows file sharing.  Assuming you have the directory on Windows already setup for sharing.

On the Ubuntu computer open the Files application (this should be a file drawer on the launcher)
Open the File toolbar at the top.
Click Connect to server
Enter the following: smb://192.168.1.3 or the address of the windows computer
Enter your Windows user name and password.
A new window should open with all the available shares.

Take a look at this guide.


So i have figured it out. This happened due to  installation of gnome-shell-extensions from ubuntu repositories. Removing it fixed the problem .


Not exactly windows 7 but there is a Chicago95 theme that is rather faithful to windows 95 for xfce. It also has some light dm stuff at the end that helps customize the login screen.


Is it possible to convert SUSE Linux device drivers to Ubuntu's?

The description in the download table is wrong (probably, HP only wants to support one distribution), the drivers are just .tar files, i.e. archives which should work for all Linux distributions.

However, usually, there is no need to download any drivers from the manufacturer's webpage, since all drivers are either available out of the box or can be installed through the package management.

edit: Scratch it, HP indeed packed rpm packages into the archives. The second part is, however, still true, you should not need to install any drivers from HP's webpage.


Can I boot from a SD Card  on a Dell Mini 9?

The BIOS for the Mini 9 doesn't allow it to boot off of an SD card.  You could burn it onto a USB stick instead and it should work.


You can try to use this script.

It raise a notification and play sound (with pulseaudio) when battery level reach selected value. It doesn't keep track of charge/discharge cycles, but with some edit you can add this feature.

#! /bin/bash

# read battery percentage value
OUT=`upower -i /org/freedesktop/UPower/devices/battery_BAT0 | grep percentage`

# select only the int value
IFS=':' read -ra P <<< "$OUT"
PERCENTAGE="%"
BATTERY_VALUE=${P[1]%$PERCENTAGE}

# send a notification and play sound if battery level is under 10%
if (( $BATTERY_VALUE  < "10")); then
  notify-send "Battery Low level! You need to plug your PC!"

# command to play sound - you can select your preferred sound if this doesn't work
  paplay /usr/share/sounds/freedesktop/stereo/complete.oga
fi

# send a notification and play sound if battery level is equal to 100%
if (( $BATTERY_VALUE  >= "100")); then
  notify-send "Battery charged! You can now unplug your PC!"
  paplay /usr/share/sounds/freedesktop/stereo/complete.oga
fi

Copy this script into a bash file and move it into local bin folder:

sudo mv <script_file> /usr/local/bin/

Where script_file is the name (or path) of your script. Then you can use cron daemon to run it every 5 minutes to check battery level. So edit cron:

crontab -e

Select preferred editor and add at the end of file this line:

*/5 * * * * /usr/local/bin/<script_file>

Change script_file with your script name.

Now it should work. Check it after a system reboot.

I hope to be useful.


Is possible to run the jsc (JavaScriptCore) utility from the command line in Ubuntu, like in OSX?

Install  rhino and use rhino-jsc (see manpage)