ecryptfs-recover-private creating unreadable encrypted folders

Whenever I try to use the MOUNT passphrase, I get these errors too (my encrypted home folder was not corrupted):

[ 2977.052719] ecryptfs_parse_tag_70_packet: Error attempting to find auth tok for fnek sig [2e1f1a0ca6f5f8f3]; rc = [-2]
[ 2977.052721] ecryptfs_decode_and_decrypt_filename: Could not parse tag 70 packet from filename; copying through filename as-is
[ 2977.052726] Could not find key with description: [2e1f1a0ca6f5f8f3]
[ 2977.052728] process_request_key_err: No key

I managed to successfully mount my old home folder simply using the LOGIN passphrase, that is the original password you used when you first created your ecryptfs home folder.

host:/mnt/mountpoint/home/.ecryptfs/user> ecryptfs-recover-private .Private
INFO: Found [.Private].
Try to recover this directory? [Y/n]:
INFO: Found your wrapped-passphrase
Do you know your LOGIN passphrase? [Y/n]
INFO: Enter your LOGIN passphrase...
Passphrase:
Inserted auth tok with sig [XXXXXXXXXXXXXXXXXX] into the user session keyring
INFO: Success!  Private data mounted read-only at [/tmp/ecryptfs.8dXogIbs].


Problem with files in External Hard Disk

It seems as if the data has been corrupted somehow.

From your Ubuntu 12.04, try running a fsck on the external drive.

Install Dosfsck with the following command:

sudo apt-get install dosfstools

Find the partition you want to 'repair' with mount. Then unmount the partition by running
sudo umount /dev/sdc1(replacing /dev/sdc1 with the mount point of your device).

Then you can verify and repair the partition with
sudo dosfsck -t -a -w /dev/sdc1
(replacing /dev/sdc1 with the mount point of your device).

If this fails to repair the partition, you can try recovering the files from the partition with a utility such as TestDisk. Which you can read more about here: http://www.cgsecurity.org/wiki/TestDisk_Step_By_Step


Switch between Intel & nVidia cards ubuntu 16.04

The problem is that in Ubuntu 16.04 with UEFI and SecureBoot enabled unsigned kernel modules do not load.

In your case nvidia module is not loaded. The module is not signed. That should be fixed as a bug.

Disable SecureBoot and the problem should be fixed.


i think you need to
sudo apt-get update
sudo apt-get dist-upgrade
sudo apt-get autoremove
sudo apt-get autoclean
or as a one liner
sudo apt-get update && sudo apt-get dist-upgrade && sudo apt-get autoremove && sudo apt-get autoclean


viber executable crashes on Ubuntu 20.10

It seems that segfaults happen with free intel-media-va-driver but not with intel-media-va-driver-non-free for other programs as well: https://bugs.launchpad.net/ubuntu/+source/gthumb/+bug/1903569
Try to replace the free driver like this:
apt install intel-media-va-driver-non-free


Press Ctrl+Alt+T to open Gnome Terminal
Search for Terminal in Unity Dash

PS: Default Terminal of Ubuntu is Gnome Terminal


You can install another display manager such as LightDM, MDM, Slim, GDM

sudo apt-get install lightdm

select LightDM

sudo dpkg-reconfigure lightdm

You can add greeters to have nice themes How to change the LightDM theme/greeter?

There is also lightdm-kde-greeter mentioned here How do I install KDE and retain LightDM as a login manager?


A similar question was posted some times ago:

Best Ubuntu version for my netbook

Dont forget that this is not a PC but a netbook so a full version of Ubuntu can disapoint you by his responce time.

To check if the netbook is able to boot on a USB stick you could need to enter the CMOS and change the boot sequence.
http://dfarq.homeip.net/2011/01/how-to-make-hp-and-compaq-computers-boot-off-usb/

Best


Restarting the IPv6 network stack without restarting the IPv4 network stack?

You can issue the commands to manually configure the IPv6 stack manually.  ip -6 is your friend here, both for setting things up and checking things out.

The same config scripts that configure IPv4 configure IPv6.  They will configure whatever is set, so you can't use them to configure IPv6 without restarting IPv4.  Depending on what is configured you will start with any combination of IPv4 and IPv6.

You will likely find that IPv6 is already configured in link local mode.  The following is an example /etc/network/interfaces stanza.  This is for a host getting the gateway from a radv notification.  The MTU is to handle a 4to6 or 4in6 tunnel to the Internet.  However, if you are using a radvd daemon most of your servers should configure themselves.  You only need the stanza if you want to add the hosts to DNS.  Your radvd will need one or two stanzas to setup it's interfaces.

iface eth0 inet6 static
    address 2001:DB8:1234:16::10
    netmask 64
    mtu 1480

I documented my IPv6 setup for OpenWRT, and the radvd setup works for Ubuntu.  Most of what I documented in IPv6 Part2 runs on Ubuntu.


you should run this

sudo apt-get install python3-pyqt4

and for Ubuntu 18.04, you will need both pyqt4 and pyqt5

sudo apt-get install python3-pyqt5

font: https://help.ubuntu.com/community/HpAllInOne


Unable to install 11.10 to a new OCZ Agility 3 SSD

SSD contains more electronics than an usual hdd, be sure that the firmware of your SSD is up to date otherwise this can be considered "a normal behaviour"; from this point of view the standard hdd are way more reliable than an SSD.

check the download page for your product http://www.ocztechnology.com/ocz-agility-3-sata-iii-2-5-ssd.html


The uptime command gets its data from /proc/uptime, which is exposed entirely by the kernel. So, we'll check out the kernel documentation to see what this actually represents.

In Documentation/filesystems/proc.txt, we see:

uptime      Wall clock since boot, combined idle time of all cpus

(there are two values in this file, hence the two descriptions)

The reference to "wall clock" is important here - it means all elapsed time, regardless of whether or not the machine's clocks are running. So, this time will keep increasing in suspended or hibernated state.

Putting it another way, the uptime value is effectively the time elapsed since the last boot.


How do I remove the unity 2D option in lightdm (login sceen) in ubuntu 12.04?

You cannot shrink the font in the user box without a re-compile of the greeter unfortunately. If you don't ever want to use Unity-2d, you can simply rename the ubuntu-2d desktop file.  I don't have a 12.04 system handy, but I think the file is ubuntu-2d.desktop, it lives in /usr/share/xsessions:

sudo mv /usr/share/xsessions/ubuntu-2d.desktop /usr/share/xsessions/ubuntu-2d.desktop.OLD

After you do that you need to reboot or restart lightdm from a virtual terminal. Here's one thing to note, in 12.10, the session chooser is hidden if there's only one session, I'm not sure that's true in 12.04, but try it and let me know and I can edit my answer.


"cd `" (backtick) command results in ">", why and how do I exit it?

Backticks work in pairs. Bash is waiting for you to provide another backtick to complete the command/expression.

> is simply a prompt for newline which is determined by the value of PS2 generally defined in .bashrc.

Whenever you hit Enter (if the command/expression is incomplete, i.e. backtick isn't closed), bash expects you to complete the command/expression either in one line or multiple lines. For example, you want to evaluate value of 'a' using expr. You can do

$ a=`
> expr 1 + 3`

will be interpreted as

$ a=`expr 1 + 3`

So, if you want to run some command either complete the required expression or if there is no command/expression required in between backticks, refrain from using that. Another way is to use Ctrl+C, but that would be a Keyboard Interrupt and will make your command to terminate immediately.

To read more about backticks, read these questions on U&L: Understanding backtick and What does ` (backquote/backtick) mean in commands?


Run the below commands on terminal,

sudo dpkg -P oracle-java7-installer
sudo apt-get -f install


The Apache user, www-data, is not allowed to access the /var/log/apache2 directory. It is forbidden for a lot of very good reasons. Openly hosting the access.log (or error.log) file can make your web server much easier for script kiddies and random bots to exploit. If you are trying to implement some barebones form of log-shipping, I would strongly advise you do all of the work over SSH connections. You can have a server in your house (or anywhere really) connect to the web server(s) at regular intervals with something like:
scp -i ~/.ssh/id_rsa user@123.123.123.123:/home/user/apache_access_$(date +\%Y-\%m-\%d).gz /path/to/save/files

Note: This is just an example. If you do decide to do something like this, you'll need a scheduled job on your web server(s) that copies the current or previous Apache access log to a directory that your connecting account has access to.
Do not make your servers an easy target.


Dovecot Install: "/usr/lib/dovecot/imap: No such file or directory"

To cite Florian Dieschs comment:

You have to install not only the dovecot-common package, but the dovecot-imapd package as well (dovecot-pop3d as option if one wants to propose access over POP3).

To cite NimChimpskys comment:

For further informations about the installation of Dovecot, read more on help.ubuntu.com/community/Dovecot.


How to move the Show Applications icon to the middle of the GNOME Dock?

Short and perhaps disappointing answer: no. This would need to be implemented as an additional option in Dash to Dock, next to the current options of moving the application icon to the start or to the end.


I struggled with this recently; it turned out to be simple ...

Nautilus > file system/etc/timidity/timidity.cfg

Use gedit to look at the file; as it happened, lucky me, both soundfonts were in the folder! At the bottom of the config file, I commented out the freepats.cfg entry (simply put the # in front of the line) and select the fluid-soundfont (remove the #)
:-)

Of course, if you haven't the alternate soundfont, you'll have to find it. It is:

fluid3_gs.cfg

Now I have to figure out how to fix Totem ...


Touchpad locked when I press the keyboard

Fixed + instructions on how to fix it: So I accidentally fixed my touchpad problem. I downloaded a software called "touchpad indicator", it didn't do much, other then tell me that the touchpad driver is called "libinput". So from there I found a website that instructed me on how to access the driver properties/settings and how to change them. I wrote down a list on how to fix this problem if anyone else has it.

Open the terminal, and type xinput --list (xinput should come pre installed with ubuntu, but if it is not just type sudo apt install xinput )

You should get a list that looks a bit like this:
⎡ Virtual core pointer                      id=2    [master pointer  (3)]
⎜   ↳ Virtual core XTEST pointer                id=4    [slave  pointer  (2)]
⎜   ↳ ELAN0501:00 04F3:300B Mouse               id=11   [slave  pointer  (2)]
⎜   ↳ ELAN0501:00 04F3:300B Touchpad            id=12   [slave  pointer  (2)]
⎣ Virtual core keyboard                     id=3    [master keyboard (2)]
    ↳ Virtual core XTEST keyboard               id=5    [slave  keyboard (3)]
    ↳ Power Button                              id=6    [slave  keyboard

So here (in my case) the "settings number" for my touchpad is "12" (it says in my case on the list ELAN0501:00 04F3:300B Touchpad id=12, so the "id=(X number)" is what you are looking for, my case it was "id=12")

After you have found out what your touchpad "id" is, type xinput --list props 12 (<- the number should be the "id" number that you have, so not necessarily "props 12" but "xinput --list (your number)"

After that you should get a list displaying your settings. Here is a portion of what mine look like:
libinput Tapping Drag Lock Enabled (320):   0
libinput Tapping Drag Lock Enabled Default (321):   0
libinput Tapping Button Mapping Enabled (322):  1, 0
libinput Tapping Button Mapping Default (323):  1, 0
libinput Natural Scrolling Enabled (300):   1
libinput Natural Scrolling Enabled Default (301):   0
libinput Disable While Typing Enabled (324):    1
libinput Disable While Typing Enabled Default (325):    1
libinput Scroll Methods Available (302):    1, 1, 0
libinput Scroll Method Enabled (303):   1, 0, 0
libinput Scroll Method Enabled Default (304):   1, 0, 0

So here is what my settings for my touchpad looked like before I ""fixed"" the problem. There is a settings that is called:
"libinput Disable While Typing Enabled Default (325): 1"
To disable the setting just type:
xinput set-prop 12 325 0 (<- again the touchpad setting id in my case was 12, but it may be a different number in your case)
And that should fix the problem, atleast it did in my case. Thank you so much for your help tough! I really appreciate it :)


Chrome remote desktop "failed to start remote access service"

I had similar problem on xubuntu 14.04.
The last step that solved the problem was to add the user to the group as follows:

sudo groupadd chrome-remote-desktop
usermod -a -G chrome-remote-desktop <username>

You can check if the user is in the group by:

groups <username>

before the last step I also followed the linux section in:

https://support.google.com/chrome/answer/1649523?hl=en


Lightdm dumps to tty. Cannot start GUI interface when booting off harddrive, but can when booting off usb

Ok, so I figured out a solution- purge almost everything nvidia.  First steps were through the terminal since I didn't have a working GUI.
I followed http://peniwize.wordpress.com/2009/07/27/how-i-solved-my-nvidia-driver-kernel-module-api-mismatchj-problem/
Which basically boiled down to the following:

sudo nvidia-installer --uninstall
sudo rmmod nvidia
sudo find / -type f 2> /dev/null | grep -i nvidia | grep -i \\.ko | sudo xargs rm -f

sudo apt-get remove nvidia-current

Then reboot:

sudo shutdown -r now

That got a low resolution incorrect ratio (stretched) GUI going again.

Then once some GUI is back, get synaptic package manager and purge everything left with nvidia in the name EXCEPT for the nvidia-common that depends on ubuntu-desktop (there were two nvidia-common packages in my case).  Everything else goes. Then restart again and presto it's my old desktop back at proper resolution.


errors while using 'sudo apt-get update'

No, it's not preventing you to install wine.Just try to remove or put # before the below line in /etc/apt/sources.list file,

deb cdrom:[Ubuntu 13.10 Saucy Salamander - Release amd64 (20131016.1)]/ saucy main restricted

And then run an update,

sudo apt-get update


Getting Ubuntu to do nothing when laptop lid is closed

If your desktop environment is gnome, you can try setting->power and modify the setting on the right panel. The settings in your configuration files may be overwritten by this settings.


Is it safe to change my Lucid sources to Maverick, to get one app, then revert to Lucid?

No, it's not safe. Evolution will pull lot's of updates that can break nearly anything. Looks like a fun thing to try in a Virutal Machine (with snapshots) anyway.


Unity slow on  Ubuntu 12.04 with ATI X1250 graphics card

Open your terminal and type:

sudo apt-get install htop

After it gets installed, type htop and see what process is consuming the most RAM and CPU. You have to observe it and judge whether it a necessary one or not.

If you find any process/application as behaving abnormally (by consuming more RAM, CPU)  that is the cause of problem. Report the memory intensive process as a bug/problem.


I would use commandline arguments, so you could run it like that

/example/folder/script.sh 6

Then, inside your script you could refer to it as $1


How to organise a shared HOME directory?

You can use owncloud https://owncloud.org/ or nextcloud https://nextcloud.com/ instead of 3rd party cloud services (like dropbox).

You setup one of your PCs as a server and setup all the other PCs as clients (including the PC acting as server).

The "server" PC preferably should be a desktop, with a Gbit ethernet connection (not wifi) which should be always on or should be able to wake on lan.

As an alternative to having a PC always on, there are solutions based on Rasberry Pi's or other low energy boards. eg https://nextcloud.com/box/


Will Ubuntu 12.10 work on Lenovo Ideapad Z585 laptop?

I have your setup and it works perfectly. All the necessary drivers are installed. You only might want to check whether you have an nvidia card. If so, you could take a look at the bumblebee project.


Avoiding installation of certain dependency packages (texlive)

Create a dummy package which doesn't provide any file but declares that it provides the package names from texlive. There's a tool for that: equivs-build from the equivs package.

equivs-build takes a file that declares package dependencies (such as Provides: foo, bar meaning that installing the package is as good as installing the packages foo and bar), and builds a .deb binary package. You can use equivs-control to generate a template. TUG provides equivs files for TeXlive 2011 and TeXlive 2013. I'll reproduce their 2013 file here:

Section: misc
Priority: optional
Standards-Version: 3.9.4

Package: texlive-local
Version: 2013-1
Maintainer: you <you@yourdomain.example.org>
Provides: chktex, biblatex, biblatex-dw, cm-super, cm-super-minimal, context,
 dvidvi, dvipng, feynmf, fragmaster, jadetex, lacheck, latex-beamer,
 latex-cjk-all, latex-cjk-chinese, latex-cjk-chinese-arphic-bkai00mp,
 latex-cjk-chinese-arphic-bsmi00lp, latex-cjk-chinese-arphic-gbsn00lp,
 latex-cjk-chinese-arphic-gkai00mp, latex-cjk-common, latex-cjk-japanese,
 latex-cjk-japanese-wadalab, latex-cjk-korean, latex-cjk-thai, latexdiff,
 latexmk, latex-sanskrit, latex-xcolor, lcdf-typetools, lmodern, luatex,
 musixtex, passivetex, pgf, preview-latex-style, prosper, ps2eps, psutils,
 purifyeps, t1utils, tex4ht, tex4ht-common, tex-gyre, texlive, texlive-base,
 texlive-bibtex-extra, texlive-binaries, texlive-common, texlive-extra-utils,
 texlive-fonts-extra, texlive-fonts-extra-doc, texlive-fonts-recommended,
 texlive-fonts-recommended-doc, texlive-font-utils, texlive-formats-extra,
 texlive-games, texlive-generic-extra, texlive-generic-recommended,
 texlive-humanities, texlive-humanities-doc, texlive-lang-african,
 texlive-lang-all, texlive-lang-arabic, texlive-lang-cjk, texlive-lang-cyrillic,
 texlive-lang-czechslovak, texlive-lang-english, texlive-lang-european,
 texlive-lang-french, texlive-lang-german, texlive-lang-greek,
 texlive-lang-indic, texlive-lang-italian, texlive-lang-other,
 texlive-lang-polish, texlive-lang-portuguese, texlive-lang-spanish,
 texlive-latex-base, texlive-latex-base-doc, texlive-latex-extra,
 texlive-latex-extra-doc, texlive-latex-recommended,
 texlive-latex-recommended-doc, texlive-luatex, texlive-math-extra,
 texlive-metapost, texlive-metapost-doc, texlive-music,
 texlive-omega, texlive-pictures, texlive-pictures-doc, texlive-plain-extra,
 texlive-pstricks, texlive-pstricks-doc, texlive-publishers,
 texlive-publishers-doc, texlive-science, texlive-science-doc, texlive-xetex,
 thailatex, tipa, tipa-doc, xindy, xindy-rules, xmltex
Architecture: all
Description: My local installation of TeX Live 2013.
 A full "vanilla" TeX Live 2013
 http://tug.org/texlive/debian#vanilla

You may want to put your email address on the Maintainer line (so that you remember where this package is coming from) and tweak the list of provided packages if you didn't install a full TeXlive. Assuming you've used debian-equivs-2013-ex.txt as above (if not, you may need to tweak the file names), run the following commands:

equivs-build debian-equivs-2013-ex.txt
sudo dpkg -i texlive-local_2013-1_all.deb


juju bootstrap environment: Failed to connect to streams.canonical.com port 443: Connection refused

I am also using the forwarding NAT Network but it can not fix the issue.
The vm doesn't have internet access. That is why it is stuck at the downloading steps and make whole bootstrap failed.

Here I follow other's solution and test in my lab env. It works fine:

mkdir ~./.juju/sync-tools
set sync-tool destination folder.

If maas 1.8 version:

sudo juju sync-tools -e maas --destination="/home/xxx/.juju/sync-tools/"

If maas 1.9 version:

sudo juju sync-tools -e maas --local-dir="/home/xxx/.juju/sync-tools/"

Here is the bootstrap command:

~/.juju$ juju bootstrap --upload-tools=true --metadata-source="/home/xxx/.juju/sync-tools"  --to bootstrap-node.maas --debug


How to show Windows System Reserved partition using Ubuntu live dvd?

I don't believe Nautilus (nor GParted, for that matter) can recognize the reserved partition for Windows. In fact, I don't know of any Linux tool that can.


syntax using rsync to remote server with id_rsa

You haven’t stated that you’re using a non-standard port for SSH but I suspect that’s the case from your use of the -p option. If this is the case, you should quote the remote shell command that is specified with the -e option, like so:

rsync -auvtz --delete -e 'ssh -p 42' username@host.tld:/var/www/data /home/user/dir


How do we copy file which only are named as hash format

So if the other files have no digits, i.e. 0123456789, in the name as you said then something like this would probably do what you want

#!/bin/bash
pattern="[0-9]"

for fn in ./* ; do
    if [[ $fn =~ $pattern ]]; then
        cp $fn ./directory2/
    fi
done

Just replace /directory2/ with the correct destination directory you want to copy the file to.

NB: This is a very rudimentary script, it also requires you to be in the directory when you execute it. It could do with some polishing, so modify it as you need to.


Force wget to use actual Google Docs file

If I remember correctly you'd have to use double quotes (") around the url...

wget --content-disposition "http://spreadsheets.google.com/pub?key=0AqSBI1OogE84dGN2bXRSZkZPVVRuNkMtN0p4eXpyVlE"

If this redirects you to https and you dont have the certificates installed you might need to issue the following instead:

wget --no-check-certificate --content-disposition "http://spreadsheets.google.com/pub?key=0AqSBI1OogE84dGN2bXRSZkZPVVRuNkMtN0p4eXpyVlE"


For the record, the Launchpad bug URL is:
https://edge.launchpad.net/soyuz/+bug/139855

It looks like the fix is going to be released real soon :)


How long have you had this issue? you may be able to use the status-old file e.g. sudo cp /var/lib/dpkg/status{,.broken} then sudo cp /var/lib/dpkg/status{-old,} or from one of the backups /var/backups/dpkg.status.0, /var/backups/dpkg.status.1.gz etc. – steeldriver 3 hours ago


I can't conect to Wifi internet after upgrading to Ubuntu 13.10

13.10 is old and unsupported.

I would advise you to go hook it up to Ethernet and upgrade to the newest version Ubuntu 14.10, because there is better hardware compatibility.

And you wont have to bother installing a bunch of drivers.


Ubuntu 18.04 LTS: Slow down on localhost after recent update

Downgrading from Linux kernel 4.15.0-36-generic to 4.15.0-34-generic resolved the issue for me. As originally suspected, something specifically dealing with the TCP/IP broke after the upgrade.

To downgrade, I pressed the ESC key repeatedly after the reboot to enter the Grub menu and selected the specific kernel (not the recovery mode) from the "Advanced options".


Argument list too long when removing files in trash

ARG_MAX is being triggered in the process of listing/removal.

You can:

Let find handle the removal, it inherently handles ARG_MAX:

find /home/ahmed/.local/share/Trash/ -type f -iname '*.png' -delete

Leverage a for construct, this is slow BTW:

for f in /home/ahmed/.local/share/Trash/*.[Pp][Nn][Gg]; do
    [[ -f $f ]] && rm "$f"
done


What is the difference between wine(x86) and wine(amd64)?

Can anyone explain the difference between the two?

x86 denotes 32-bit machine architecture.
amd64 denotes 64-bit machine architecture.

Which version is more reliable for gaming?

Depends.
x86 is reliable for 32-bit games.
amd64 is reliable for 64-bit games.

Postscript:

amd64 is commonly referred to as x64. The previously used 64-bit version was designed by the Intel corp which was called as x86-64. It was not compatible with the native x86 instruction set. In 2003, AMD introduced the perfect 64-bit version for the x86 instruction set. Since they introduced it, it is named after them as amd64. Hope you would have enjoyed the history :)


Creating a static HTML website for dummies?

A simple HTML file with a bunch of image thumbnails and links can be created fairly easily. Assuming:

The HTML file is the same directory as the images
The images all have some property which makes it easy to loop over them in the command line (all files with extension .jpg, for example).

This makes it easier to create thumbnails for them. You should use thumbnails so that people don't download the entire set of images just by opening your page.

Adapting this post:

printf "%s\n" '<!DOCTYPE html><meta charset=utf-8><title>Images</title>' > images.html
mkdir thumbs
for i in *.jpg
do
    convert "$i" -thumbnail 100 "thumbs/$i"
    printf '\n' "$i" "thumbs/$i" "$i"
done >> images.html

Now, images.html has the minimum valid HTML5 displaying a bunch of thumbnails and linking to the images of the thumbnails. Point your Apache instance to the directory and serve as needed.

You can probably try to make a table out of it or something, but this should be sufficient.

An example using the images from /usr/share/background:

$ head images.html
<!DOCTYPE html><meta charset=utf-8><title>Images</title>


Script to cat log files that have been rotated

You can use bash globes for this purpose:

cat ABC_[0-9]*.txt

which only cats files started with the name "ABC_" followed by one number and some character then ended to .txt.


how to safely Uninstall Ubuntu 12.04 and reinstall 11.10

There is a rather lengthy HowTo here. It comes with its own disclaimer so I won't bother with that. BUT before you do that, read here why that is probably a BAD idea.
It is probably a much better idea to simply backup your files and re-install ubuntu if you can't figure out a way to make 12.04 work for you.


This is a new feature of Ubuntu 19.10. That partition is there to store logged data, that can be used in order to debug problems during boot but also during installation (into an internal drive).

See the following links,

How is it easier to make a persistent live drive with Ubuntu 19.10?
How can I get a live-only drive with Ubuntu 19.10 and newer versions?


Had a similar issue. In case it is helpful for anyone, for me it was just a matter of changing from TLS to PEAP under the network settings.


Press Alt+F2 and enter:

unity --replace &

This should drop it down to less memory usage.


Debian can boot but can't boot Ubuntu after installing it

Ubuntu Minimal CD is die-hard boot magic.
How to make an Ubuntu Minimal USB using dd
While the minimal iso image is handy, it isn't useful for installing on UEFI-based systems that you want to run in UEFI mode. The mini iso lacks the proper files for booting the computer in UEFI mode. Thus the computer will boot in BIOS compatibility mode, and the installation will be in BIOS mode.

Download the Ubuntu Mini CD iso file for Ubuntu 18.04 and earlier from the link on the Ubuntu Documentation Installation Minimal CD webpage. Download the Ubuntu Mini CD iso file for Ubuntu 20.04 from http://archive.ubuntu.com/ubuntu/dists/focal/main/installer-amd64/current/legacy-images/netboot/mini.iso. Download the file called mini.iso to your Downloads folder. You can download the mini.iso file to wherever on your computer that you want, but download it to your Downloads folder so that you can easily run the commands in the following steps without changing anything.

Verify the md5 checksum of the Ubuntu mini CD iso file that you downloaded by running these commands:
cd ~/Downloads/
md5sum 'mini.iso'

If you are using Windows Subsystem for Linux download the Microsoft File Checksum Integrity Verifier tool from the official Microsoft Download Center. The Microsoft File Checksum Integrity Verifier tool is a command line utility that computes MD5 or SHA1 cryptographic hashes for files.

Check that the results of the command match the MD5 checksum of the mini.iso file on the Ubuntu Documentation Installation Minimal CD webpage.

Get a USB flash drive, 1GB or larger. Delete all the files from the USB flash drive. Mount the flash drive using the Disks disk utility.

Check in the Disks disk utility (the package name of the Disks disk utility is gnome-disk-utility) to find out the device name of your USB flash drive. This is very important because if you use the wrong device name in step 6, you will overwrite your whole operating system instead of writing to the USB flash drive. So check the USB flash drive device name twice.  It should be something like /dev/sd* where instead of the * character there is a lower case letter like a, b, c, etc. In the following step I am assuming that the device name is /dev/sdc, but the device name of your USB drive could be something else like /dev/sda or /dev/sdb so check the device name of your USB drive twice and make sure that you get it right in step 6!

Open the terminal or Windows Subsystem for Linux version 2 and run the following commands:
cd ~/Downloads/
sudo -i
dd if='mini.iso' of=/dev/sdc bs=4096  ## make sure that the device name of your USB drive is correct!

The dd if='mini.iso' of=/dev/sdc bs=4096 command should take only a few seconds to complete on most computers because the mini.iso is a small file, less than 40MB. The result of running this command will be a bootable Ubuntu mini CD.

Boot the computer from the Ubuntu mini live USB. The Ubuntu mini live USB should boot successfully and show a menu screen.

If you select the Install option (not the cli install, the complete install) from the menu screen in Step 7, then you can select other options during the Ubuntu installation process to download all the packages that you need to perform a complete Ubuntu installation. Select the Ubuntu desktop package collection from the list of predefined collections of software in the Software selection screen in the Ubuntu mini CD installer. When you restart the system at the end of the installation, you will have a working Ubuntu desktop with the default desktop environment.


error while installing ceph storage cluster quick start on Ubuntu

you need synchronize the config to others machine:

ceph-deploy --overwrite-conf  admin node01 node02 node03 node04


This sounds like it could be a problem with user watches. I had a similar issue with ng serve (Angular) failing to reload files I changed in IntelliJ until I increased the limit.

echo 65536 | sudo tee -a /proc/sys/fs/inotify/max_user_watches

The above command will work until you log out (so you can test if that was the issue). More information about what this is and how to make it permanent can be found here.

https://github.com/guard/listen/wiki/Increasing-the-amount-of-inotify-watchers


Suggest you use Gparted to delete the FAT12 and FAT16 partitions and then create one FAT32 partition.  Pick your USB device from the spin box at upper right http://www.zimagez.com/zimage/screenshot-01262014-025522pm.php then delete the old partitions http://www.zimagez.com/zimage/screenshot-01262014-025931pm.php by right-clicking on each partition and selecting Delete. Then reformat it as the current preferred FAT32 partition type for maximum utility.


What version of CodeBlocks are you using ? The one in the Ubuntu repositories, or the latest release (CodeBlocks 10.05) ?

If you're using the 10.05, you need to install the corresponding wxWidget libraries (see the CodeBlocks site), because the wxWidgets in the Ubuntu repositories are not up to date for the latest CodeBlocks.


"enable wireless" option gone after installing rtlwifi_new

Disable secure boot in your BIOS.

Update #1:

Disabling secure boot now gets the driver to load.

Update #2:

There are issues with signal strength. This may be due to an incorrect antenna setting for your configuration. Try this...

Reboot. After the system comes up:

sudo modprobe -rv rtl8723be
sudo modprobe -v rtl8723be ant_sel=1

Now test. If that still does not work, then try

sudo modprobe -rv rtl8723be
sudo modprobe -v rtl8723be ant_sel=2

Depending on which ant_sel command makes the signal strength better, then edit /etc/modprobe.d/rtl8723be.conf so:

gksudo gedit /etc/modprobe.d/rtl8723be.conf

Add or change the line to:

options rtl8723be ant_sel=1

or

options rtl8723be ant_sel=2

Then reboot and retest.


You can use xrandr -q to see what resolutions are available for your display

From the manpage

  Xrandr  is  used  to set the size, orientation and/or reflection of the outputs for a screen. It can also set the screen size.

To change the screen resolution to 1024 by 768, you would type:

xrandr -s 1024x768

Just use that to change it to the size you want.


Bluetooth not working on a Lenovo ideapad 100-15iby (Wi-Fi unstable too)

I would buy a new mini-PCIe Wi-Fi card (30-50 bucks) if I were you. Lot's of good ones out there. If you want to keep up on the bug reports for your card not working with bluetooth and flaky wifi you can read what others have tried and sign up here


I just bought one and I managed to make it work with Ubuntu 20.04 LTS.
Remember to disable RAID ON to AHCI with the safe boot procedure
Install dual boot ubuntu with windows 10 and RAID on
and to disable SECURE BOOT from BIOS setup.
After that you should be able to install and manage everything with GRUB.
I'm still having some graphic issues, but better than nothing as start.
[UPDATE]
I have no more graphic problem after following this procedure for updating the nvidia drivers
https://linuxconfig.org/how-to-install-the-nvidia-drivers-on-ubuntu-20-04-focal-fossa-linux


you need to provide the dependency, which it demands ...

it's the Assistive Technology Service Provider Interface AT-SPI2.

sudo apt-get install libatspi2.0-dev

there's also bindings for Qt & Python & a profile manager.


Migrating from Thunderbird to Microsoft Outlook

This is not possible without any external solution.
Few months ago, I have solved the same issue by email conversion tool.


Your CPU is probably overheating. It was crashing for me too when I was compiling it using 4 cores make -j 4, once I used only a single core make -j 1, the compilation completed successfully.


First you check with the partition which you have to give the permission to access by opening the terminal and typing....

 sudo fdisk -l

And format the partitioned drive by....

sudo mount -t ext4 /dev/sdb3 /media

(/dev/sdb3  is the example which I have given here, check with yours)

And enter into the superuser mode....

sudo su

and enter your password

Copy the address of your partitioned drive by opening the file manager (basically nautilus) and press ctrl+l for the appereance of the address bar.

Paste that with

chmod +x paste-it-here

in the terminal and proceed further, you will get the privilage to get access to it.

And don't forget to exit the superuser mode by typing exit.

Even I got the same problem and solved it on my own, GParted didn't helped me any ways.


The screenshot below shows the secondary ext4 partition that is going to be automounted at startup. This partition is mounted at /dev/sda4

How to automount an ext4 partition that is on a secondary hard drive

Install udisks: sudo apt-get install udisks

Update: In Ubuntu 16.04 and later install udisks2: sudo apt-get install udisks2
Search for startup in the Dash and open the Startup Applications Preferences app.
Click the Add button to add a new startup program.

In the Name: field type in any name for the partition that you want to automount.
In the Comment: field you can optionally type a descriptive comment about the partition that you want to automount.

Open the terminal and run the command: sudo blkid to find the UUID of the partition you want to automount. The output will be a list of information about all the partitions including their UUIDs. Running the sudo blkid command will produce output similar to:

/dev/sda1: TYPE="ntfs" UUID="72C0DE8EC0DE57C5" LABEL="windows"
/dev/sda2: UUID="30fcb748-ad1e-4228-af2f-951e8e7b56df" SEC_TYPE="ext2" TYPE="ext3"
/dev/sda5: TYPE="swap" UUID="8c4e69f8-5074-42c0-8134-0b2429c4c02c"
/dev/sdb1: SEC_TYPE="msdos" UUID="4848-E35A" TYPE="vfat"

In this example you want to automount the /dev/sda4 partition which is selected and highlighted in blue in the screenshot that is shown above. The UUID is the value of the first hyphenated hexadecimal string that appears after UUID= without including the two quotation mark characters. In the code block that is shown above, the UUID of /dev/sda2 is:
30fcb748-ad1e-4228-af2f-951e8e7b56df
Edit the Command: field so that it is similar to this: /usr/bin/udisks --mount /dev/disk/by-uuid/value-of-UUID-from-step-4

Update: In Ubuntu 16.04 and later edit the Command: field so that it is similar to this: /usr/bin/udisksctl --mount /dev/disk/by-uuid/value-of-UUID-from-step-4
Click the Save button in the Add Startup Program window. In later versions of Ubuntu there is an Add in the lower right corner of the Add Startup Program window instead of a Save button.

The next time you start your computer, the partition on your secondary hard drive will be automounted, and the drive icon for the partition on your secondary hard drive will appear in the Launcher.


Ubuntu on VirtualBox - GParted not showing added disk space

Try booting the VM to a live image containing gparted (for example GParted Live).  That should permit you to see the unallocated space and also to resize/move any of the partitions.

If you need more details I found the following article with screen shots on the Internet.
Resize /dev/sda1 Disk of Your Vagrant / VirtualBox VM


What are the advantages and disadventages of git or bzr + rsync vs rdiff-backup?

tl;dr There are advantages and disadvantages.
Advantages of VCS:
git and bzr let you restore to any version you pushed to the repository and lets you selectively exclude files and only add files to the VCS that you need. You can exclude /tmp and various dot-folders in your home directory (I don't recommend excluding ~/.gnupg and ~/.gnome2/keyrings as these have important data).
Disadvantages of VCS:
bzr and git store diffs of all changes so every time you push a new change, the repository software needs to calculate and store a diff, which takes space and CPU power. With binary files, it's even worse since even a 2KB change in a 2GB file will prompt the storage of another copy of that 2GB file, unless your repository keeps track of changes in small blocks for binary files, or uses some form of bindiff, where even shifts in the file don't cause trouble.
Make your choice. If you need any assistance with this, drop a comment right below.


Nope. You have to create a new partition and move the files.


Sorry, I found the problem. Simply I needed to restart ssh (service ssh restart) after editing the /etc/ssh/sshd_config file. Anyway, thanks for your help!


Step By Step : Making a server accessible worldwide

to build a simple DMZ and set up your server worldwide, you can get a broadband connection with static IP address, then you can connect your "server" to your modem and configure port forwarding on it.

For example, you can forward external port 8888 to 192.168.1.100:80

this way, if a user connects to your modem's IP address but with port 8888, the connection will be redirected to 192.168.1.100 which is your server's IP address.

comment if you have any questions and I'll answer it to you.


How can I get my Airport Extreme network printer working after upgrading to (K)ubuntu 13.10?

Thanks to helpful information from the KDE forums, it seems that Avahi/Bonjour isn't working properly. Presumably this is a regression introduced recently, although I only seem to have problems with the printer connected to the Airport Extreme.

Hence, use the IP address of the printer as specified here. i.e. add the printer as socket://[ip address of Airport Extreme]:9100. Fortunately for me I already had my Airport Extreme set up with a static IP, but it'd be annoying otherwise. Also, I've no idea how you'd configure it if you had two printers connected to the router.


For the first question :

yes n | cp -i -r videos/ resized_video/

It makes an exact mirror of the videos in the resized_video and if there's a file with the same name , it wouldn't update it.

For the latter :

for i in videos/**/*.{mp4,avi,mts,and_whatever_format_you_want}
do
    if [ -f resized_video/$i ]
    then
        echo File $i exists. Skip resizing
    else
        do_resizing_and_moving
    fi
done

It adds videos from videos to resized_videos only if there exists no file with the same name.

If anybody has suggestions for improvements , I'm glad to hear.


How can I keep TPLink wifi adapter working?

Lets get everything cleared out
sudo dkms remove -m 8812au -v 4.2.2 --all
sudo rm -rf /usr/src/8812au-4.2.2
rm -rf ~/rtl8812au
Hopefully there are no rtl8812au or 8812au entries in dkms status Then do
git clone https://github.com/gnab/rtl8812au.git
cd rtl8812au
make clean
sudo dkms_install
Reboot


The default userID of the mysql server is mysql.  Once the running server as become it's effective uid it will loose access to the folders under /root.  You would have to put your data in a different folder, not /root.

Installed of having your area /root/test/mysql either create your own directory such as /myown/test/mysql.  Or you could put it in one of the directories already in the system such as /lib/test/mysql.


Ubuntu hangs when memory is exceeded by large program

If you're getting segmentation faults when you run your simulation software in one system, and massive slowdown when you run it in another, then your simulation software is not meant to handle not having enough memory. Any segmentation fault is an indication of a bug, and often bugs that produce segmentation faults are really bugs where the behavior of code is undefined. On different systems it may act in different (wrong) ways.
So:

If you or someone you work with wrote the simulation software, you should debug it with the hope of improving performance. I'd recommend starting by compiling it with debug symbols (gcc -g ...) and debugging interactively (for example, in gdb) on Slackware to produce a stack trace of the segmentation fault.
You should also debug it to find memory leaks. You can use Valgrind, Boehm GC running in leak detection mode, or a variety of other tools for this.
Of course, the most appropriate way to debug it will depend on details of how it works and what language it's written in.

If you got the simulation software from a totally separate party, you should report a bug. If a debug build or debug symbols are available to you, the bug report would benefit from including a stack trace of the segmentation fault on the Slackware system.

There might be some things you can do to terminate the simulation in Ubuntu.
The whole system shouldn't grind to a halt. That is likely to indicate a bug in Ubuntu, possibly in the kernel. Even massive disk I/O should only slow down Ubuntu moderately. You might want to report a bug in Ubuntu's kernel about this.
If you want to do that, first read this. Then you'd start the bug reporting process by running ubuntu-bug linux (or if it's a command-line only system, apport-cli linux).
To work around the problem, you can try limiting available memory by specifying limits in limits.conf. See also this blog post.
In case the problem has something to do with CPU priority, you can run the simulation at a lower priority with nice (e.g., nice -n 15 command...) or lower it while running with renice.
If you can use the machine at all as it slows down and the simulation needs to be stopped (sometimes a virtual console responds better than the GUI), you can try killing the process with the KILL signal (which is the strongest way to kill a process):
kill -KILL command
Here command is just one word, the name of the executable. All executables with that name will be killed (hence "killall"). If you have the PID (from ps), you can of course run kill -KILL PID instead.


Connection refused is typically related to a firewall rule actively blocking the connection as opposed to a network configuration error that might result in a connection timeout response.

It's quite possible something on your LAN is preventing access.  Is the IP assigned to your Linux environment the same as the IP assigned to your Windows environment?  If not, can you statically assign the same IP to both environments and test again.


Yes, it's possible.
I have tried to back-up Meizu Pro5 (Android originally)  from within TWRP recovery and it managed to back it up in about 2-3 min., including all data, system, cache, recovery, just tick all boxes when doing a backup.
Then I decided to test the backup and I was able to restore the phone from within TWRP just like it was an Android phone.
Back it up to your external sd and when anything happens while you play with your PRO5 you have a full backup to restore the phone.
This is handy when you want to try FLYME and want to come back to UBUNTU or vice versa.

Enjoy.


Installation hangs during boot on new computer

Well, I managed to do it! I had to:

use alternate ISO
use a CD, not a pendrive
use PS/2 keyboard (my USB keyboard is crazy, even under Windows, it didn't work with LiveCD)
use acpi=off, noapic, nolapic

Now I only have one issue left: Resolution is 1024x768, but this is because Acer AL1716 doesn't like Linux at all... I think it's time for xorg.conf editing...


Anthy Japanese is using Japanese keyboard layout. How do I use US?

I prefer fcitx-mozc than iBus-Anthy.
Because it's efficient when I type Japanese, it suggests with its prediction.
E.g. When I type 'きょ' and it shows a panel with the word list
such as 今日　教科　教室　強化 and I select one of them by
Tab and PgDn/Up or a mouse click.


Can only start arduino-ide from terminal

You should create custom desktop launcher for Arduino IDE beta version and then use it.
mkdir -p ~/.local/share/applications/

cat <<EOF > ~/.local/share/applications/arduino-beta.desktop
[Desktop Entry]
Version=1.0
Type=Application
Name=Arduino IDE beta
Icon=/home/$USER/path-to/arduino-beta/lib/arduino_icon.ico
Exec=/home/$USER/path-to/arduino-beta/arduino-executable
Comment=The Arduino Software IDE
Categories=Development;IDE;
Terminal=false
EOF

Note: adjust Exec and Icon paths before copying and pasting above code to terminal.


How to install Adobe Master Collection CS6 in Ubuntu 12.10

I'm afraid that Wine, and VM might be the way to run Adobe Master Collection CS6 in Ubuntu.

My recomendation would be to use VM, because it will run the application better that Wine.  Wine is still a compatibility layer that may have some problems, and incompatibility.

One other thing you can try is Playonlinux, although it may have the same results as Wine.  You may look at the Wine AppDB, where you can get information on application compatibility with Wine.

You may also look at Creative suite for Linux.


Can't adjust brightness on my MSI VR420 laptop

In /etc/default/grub change:

GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"

to

GRUB_CMDLINE_LINUX_DEFAULT="quiet splash acpi=off"

run sudo update-grub in the terminal.


Running Executable Files (Popcorn Time & Gunpoint)

right click on the file and click properties. Make sure in the permissions tab That "Allow executing file as program" is checked. Open up a terminal, and cd into the directory the file is in. Simply type ./filename replacing filename with the name of your file.


Why can't tuxboot and ubuntu play well together?

I just downloaded tuxboot myself and had no problem to get it running in Ubuntu 10.04. You do not need to build it from source, you can download the *.bin file from the homepage.

After that, open a terminal and navigate to the folder where tuxboot is, in my case this was ~/Downloads. Execute it with:

sudo chmod +x tuxboot-linux-25-64bit

Replace tuxboot-linux-25-64bit with the appropriate file name in case of different version (like 32-bit). After that run it with:

./tuxboot-linux-25-64bit


Unable to log in and flashing command line message after restarting frozen Ubuntu 16.04.1 using REISUB

Try holding Alt+Ctrl+F2
It seems to do that randomly sometimes.  It could be due to a late start of gdm, but I'm not certain as I don't know what each application does exactly.  I do know that my graphical interface disappeared as well and went to that same screen, but the interface was still on tty2, so I just switched back over to it as simply as the above method.


Ubuntu 20.04 cannot resume from suspension

Think I found a workaround, at least for my hardware. Have a completely different setup but experienced exactly the described behaviour two times within weeks, the last time three days ago. During the last ten days, after I had made changes to the BIOS setup, Resume from Suspend would never work and always showed a black screen with (today) the symbols ^@ on the top left. Only way out: Pressing the power button for five seconds, leading to a hard shutdown.
My workaround: In BIOS setup I found the setting which obviously didn't work together with the Resume routine: In my HP EliteBook 850G6, in Port Options, the setting 'Thunderbolt Type C Ports' must remain 'on' (which is the factory default) and must not be turned off. Now Resume works fine, again.
But I cannot state whether the behaviour initially described in this thread will never appear again.
Hope that helps at least someone (experiencing only dead Resumes), if not the originator of this thread.


bind9 problem - named: user 'bindi' unknown

The problem is that the username should be bind, not bindi. I believe this is configured in /etc/default/bind9:

cat /etc/default/bind9
# run resolvconf?
RESOLVCONF=no

# startup options for the server
OPTIONS="-u bind"

Check that it doesn't say -u bindi under options.


Sound only through subwoofer on laptop Acer Predator G9-792

I just got the same machine yesterday. Here is what I did to get sound working.

sudo apt-get install alsa-tools alsa-tools-gui

Then using the HDAJackRetask select Realtex ALC255 codec and choose "Show unconnected pins" option.
I put an override on the following items:
0x14 - change to Internal Speaker (LFE)
0x17 - change to Internal Speaker
0x1b - change to Internal Speaker (Back)

I played around for a long time with various advanced overrides but could never get it quite perfect, however using these options you at least get good sound on left and right speakers. I don't think it is playing through the front speakers, there are 2 speakers on the bottom front and I believe it is using both of these now.
I'm happy with it for now, I mainly use headphones anyway.
I should add, I did this on Ubuntu 16.04 and later on Xubuntu 17.04. I was able to get sound working well on both.

On Ubuntu 16.04 I also had to add an override for headphones on 0x21 changing the channel to 2 in advanced options. In Xubuntu I didn't have to do that. This could have been due to playing around with all of the other pins first until I figured out which ones were actually tied to speakers.

I'm hoping an updated firmware or kernel will provide a better fix in the near future.

---Update--- I just installed Xubuntu 19. Not sure if this was an issue 2 years ago, but I cannot get it to apply so I the only way to test is to make the changes above and click Install boot override then reboot and test.

---Update--- Same with Xubuntu 20.04. Same pins above fixed the sound and it has to be applied as a boot override.


Check your php.ini settings; if you have a separate xdebug.ini file under /etc/php5/conf.d containing a zend_extension=*.xdebug.so line, it's possible that it already exists in the main cli/php.ini file too, so when it tries to load the second config file it'll produe the already loaded error message.


1. If you installed ALSA, the ALSA mixer is set to mute by default and needs to be taken off of mute after installation before it can be used.

As for the error, it says that puseaudio is already running so it cannot start or create a pid for the daemon as one already exists because the daemon is in use.
To restart pulseaudio, use the following command(s):

sudo service pulseaudio stop
sudo alsa force-reload
sudo service pulseaudio start

On newer versions of ubuntu, run the following instead:

sudo killall pulseaudio
sudo alsa force-reload
pulseaudio --start --log-target=syslog

2.
Check to see if you have a file in /etc/pulse/default.pa

If you do not have one, use the following command:

sudo nano

Copy and paste the following into the terminal. When you are done, press CTRL+o and then press ENTER to save the file and then press CTRL+x to exit nano.

After you are finished, save any unsaved work on your computer and reboot. You should have more than a dummy output after you sign back in.

The following is for 16.04

#!/usr/bin/pulseaudio -nF
#
# This file is part of PulseAudio.
#
# PulseAudio is free software; you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# PulseAudio is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with PulseAudio; if not, see <http://www.gnu.org/licenses/>.

# This startup script is used only if PulseAudio is started per-user
# (i.e. not in system mode)

.nofail

### Load something into the sample cache
#load-sample-lazy x11-bell /usr/share/sounds/freedesktop/stereo/bell.oga
#load-sample-lazy pulse-hotplug /usr/share/sounds/freedesktop/stereo/device-added.oga
#load-sample-lazy pulse-coldplug /usr/share/sounds/freedesktop/stereo/device-added.oga
#load-sample-lazy pulse-access /usr/share/sounds/freedesktop/stereo/message.oga

.fail

### Automatically restore the volume of streams and devices
load-module module-device-restore
load-module module-stream-restore
load-module module-card-restore

### Automatically augment property information from .desktop files
### stored in /usr/share/application
load-module module-augment-properties

### Should be after module-*-restore but before module-*-detect
load-module module-switch-on-port-available

### Load audio drivers statically
### (it's probably better to not load these drivers manually, but instead
### use module-udev-detect -- see below -- for doing this automatically)
#load-module module-alsa-sink
#load-module module-alsa-source device=hw:1,0
#load-module module-oss device="/dev/dsp" sink_name=output source_name=input
#load-module module-oss-mmap device="/dev/dsp" sink_name=output source_name=input
#load-module module-null-sink
#load-module module-pipe-sink

### Automatically load driver modules depending on the hardware available
.ifexists module-udev-detect.so
load-module module-udev-detect
.else
### Use the static hardware detection module (for systems that lack udev support)
load-module module-detect
.endif

### Automatically connect sink and source if JACK server is present
.ifexists module-jackdbus-detect.so
.nofail
load-module module-jackdbus-detect channels=2
.fail
.endif

### Automatically load driver modules for Bluetooth hardware
.ifexists module-bluetooth-policy.so
load-module module-bluetooth-policy
.endif

.ifexists module-bluetooth-discover.so
load-module module-bluetooth-discover
.endif

### Load several protocols
.ifexists module-esound-protocol-unix.so
load-module module-esound-protocol-unix
.endif
load-module module-native-protocol-unix

### Network access (may be configured with paprefs, so leave this commented
### here if you plan to use paprefs)
#load-module module-esound-protocol-tcp
#load-module module-native-protocol-tcp
#load-module module-zeroconf-publish

### Load the RTP receiver module (also configured via paprefs, see above)
#load-module module-rtp-recv

### Load the RTP sender module (also configured via paprefs, see above)
#load-module module-null-sink sink_name=rtp format=s16be channels=2 rate=44100 sink_properties="device.description='RTP Multicast Sink'"
#load-module module-rtp-send source=rtp.monitor

### Load additional modules from GConf settings. This can be configured with the paprefs tool.
### Please keep in mind that the modules configured by paprefs might conflict with manually
### loaded modules.
.ifexists module-gconf.so
.nofail
load-module module-gconf
.fail
.endif

### Automatically restore the default sink/source when changed by the user
### during runtime
### NOTE: This should be loaded as early as possible so that subsequent modules
### that look up the default sink/source get the right value
load-module module-default-device-restore

### Automatically move streams to the default sink if the sink they are
### connected to dies, similar for sources
load-module module-rescue-streams

### Make sure we always have a sink around, even if it is a null sink.
load-module module-always-sink

### Honour intended role device property
load-module module-intended-roles

### Automatically suspend sinks/sources that become idle for too long
load-module module-suspend-on-idle

### If autoexit on idle is enabled we want to make sure we only quit
### when no local session needs us anymore.
.ifexists module-console-kit.so
load-module module-console-kit
.endif
.ifexists module-systemd-login.so
load-module module-systemd-login
.endif

### Enable positioned event sounds
load-module module-position-event-sounds

### Cork music/video streams when a phone stream is active
#load-module module-role-cork

### Modules to allow autoloading of filters (such as echo cancellation)
### on demand. module-filter-heuristics tries to determine what filters
### make sense, and module-filter-apply does the heavy-lifting of
### loading modules and rerouting streams.
load-module module-filter-heuristics
load-module module-filter-apply

# X11 modules should not be started from default.pa so that one daemon
# can be shared by multiple sessions.

### Load X11 bell module
#load-module module-x11-bell sample=x11-bell

### Register ourselves in the X11 session manager
#load-module module-x11-xsmp

### Publish connection data in the X11 root window
#.ifexists module-x11-publish.so
#.nofail
#load-module module-x11-publish
#.fail
#.endif

### Make some devices default
#set-default-sink output
#set-default-source input
#load-module module-dbus-protocol

Alternatively, this is the /etc/pulse/default.pa for 18.04:

#!/usr/bin/pulseaudio -nF
#
# This file is part of PulseAudio.
#
# PulseAudio is free software; you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# PulseAudio is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with PulseAudio; if not, see <http://www.gnu.org/licenses/>.

# This startup script is used only if PulseAudio is started per-user
# (i.e. not in system mode)

.fail

### Automatically restore the volume of streams and devices
load-module module-device-restore
load-module module-stream-restore
load-module module-card-restore

### Automatically augment property information from .desktop files
### stored in /usr/share/application
load-module module-augment-properties

### Should be after module-*-restore but before module-*-detect
load-module module-switch-on-port-available

### Use hot-plugged devices like Bluetooth or USB automatically (LP: #1702794)
.ifexists module-switch-on-connect.so
load-module module-switch-on-connect
.endif

### Load audio drivers statically
### (it's probably better to not load these drivers manually, but instead
### use module-udev-detect -- see below -- for doing this automatically)
#load-module module-alsa-sink
#load-module module-alsa-source device=hw:1,0
#load-module module-oss device="/dev/dsp" sink_name=output source_name=input
#load-module module-oss-mmap device="/dev/dsp" sink_name=output source_name=input
#load-module module-null-sink
#load-module module-pipe-sink

### Automatically load driver modules depending on the hardware available
.ifexists module-udev-detect.so
load-module module-udev-detect
.else
### Use the static hardware detection module (for systems that lack udev support)
load-module module-detect
.endif

### Automatically connect sink and source if JACK server is present
.ifexists module-jackdbus-detect.so
.nofail
load-module module-jackdbus-detect channels=2
.fail
.endif

### Automatically load driver modules for Bluetooth hardware
.ifexists module-bluetooth-policy.so
load-module module-bluetooth-policy
.endif

.ifexists module-bluetooth-discover.so
load-module module-bluetooth-discover
.endif

### Load several protocols
.ifexists module-esound-protocol-unix.so
load-module module-esound-protocol-unix
.endif
load-module module-native-protocol-unix

### Network access (may be configured with paprefs, so leave this commented
### here if you plan to use paprefs)
#load-module module-esound-protocol-tcp
#load-module module-native-protocol-tcp
#load-module module-zeroconf-publish

### Load the RTP receiver module (also configured via paprefs, see above)
#load-module module-rtp-recv

### Load the RTP sender module (also configured via paprefs, see above)
#load-module module-null-sink sink_name=rtp format=s16be channels=2 rate=44100 sink_properties="device.description='RTP Multicast Sink'"
#load-module module-rtp-send source=rtp.monitor

### Load additional modules from GConf settings. This can be configured with the paprefs tool.
### Please keep in mind that the modules configured by paprefs might conflict with manually
### loaded modules.
.ifexists module-gconf.so
.nofail
load-module module-gconf
.fail
.endif

### Automatically restore the default sink/source when changed by the user
### during runtime
### NOTE: This should be loaded as early as possible so that subsequent modules
### that look up the default sink/source get the right value
load-module module-default-device-restore

### Automatically move streams to the default sink if the sink they are
### connected to dies, similar for sources
load-module module-rescue-streams

### Make sure we always have a sink around, even if it is a null sink.
load-module module-always-sink

### Honour intended role device property
load-module module-intended-roles

### Automatically suspend sinks/sources that become idle for too long
load-module module-suspend-on-idle

### If autoexit on idle is enabled we want to make sure we only quit
### when no local session needs us anymore.
.ifexists module-console-kit.so
load-module module-console-kit
.endif
.ifexists module-systemd-login.so
load-module module-systemd-login
.endif

### Enable positioned event sounds
load-module module-position-event-sounds

### Cork music/video streams when a phone stream is active
load-module module-role-cork

### Modules to allow autoloading of filters (such as echo cancellation)
### on demand. module-filter-heuristics tries to determine what filters
### make sense, and module-filter-apply does the heavy-lifting of
### loading modules and rerouting streams.
load-module module-filter-heuristics
load-module module-filter-apply

See this post. How to make pulseaudio work again?

and this: http://itsfoss.com/fix-sound-ubuntu-1304-quick-tip/


How do I change the background to one and the same color during the whole boot process?

Xubuntu uses LDM not GDM. So gnome-extensions will be no help. They simply don't work with Xubuntu.
Go to the menu and select the "LightDM GTK+ Greeter Settings"
The following dialog opens:

Select "color" and choose the one you'd like
If you want to change the background color of you desktop - that is the color AFTER you've logged in - open the context menu on your desktop and select "Desktop Settings...". A dialog opens where you select "Style: None" and the background color you want:


Hibernation/Suspend effects on encoding process

No, it has no affect.  Only real time sensitive things can be negatively impacted by suspending, such as network connections or recording live video.


File exists but is inaccessible via script

Filename changed to error.log instead of the user create error_log.


How can I combine multiple images into a single GIMP file with the command line?

You'll have to use gimp in batch mode. See: http://www.gimp.org/tutorials/Basic_Batch/

You would probably need to learn script-fu...  http://docs.gimp.org/nl/gimp-using-script-fu-tutorial.html


Most default installations of apache have a redirection that /doc/ points to /usr/share/doc/ that you can read the apache documentation when browsing to http://localhost/doc/. You have to look in your apache configuration /etc/apache2/apache2.conf or other files in the folder /etc/apache2/ to find out.

If it's not that please add to your question what /var/log/apache2/error.log says when you navigate to this folder via web browser.


Blank Screen after login Ubuntu 18.04 no desktop

I just did an upgrade from Lubuntu 16.?? to Lubuntu 18.04. My symptoms were a blank screen and visible/movable mouse cursor. I could get to my desktop by switching to vt1 (ctrl-alt-F1) and switching back to vt7 (alt-F7). My issue was an xrandr command in .xprofile which worked on the earlier version of Lubuntu, but not on 18.04. I commented out the that line in .xprofile and all returned to normal.


How to prevent system blocking due to some I/O activities?

There's definitely a bug with mlocate.db, see https://bugs.launchpad.net/ubuntu/+source/mlocate/+bug/1190696.  I'm not quite sure that this is what's effecting you.  To know for certain, run iotop, with sudo, from the CLI.  You may need to install iotop first, apt-get install iotop with sudo.


off-topic: How can I update "Quickly" using a PPA or similar in the Source file?

Quickly depends on multiple other packages that also have newer version in Ubuntu 12.04.  You should either upgrade to Ubuntu 12.04 or install it in a virtual machine and use that for your development environment.


Install Ruby, Rails, Gems, Passenger for 1.8.7 on Ubuntu 14.04

You should check gems versions that match the Ruby version.

Example:

https://rubygems.org/gems/passenger

That "Ruby Dependency >= 0" It means it will work on any version.

Another example:

Rake gem 10.2.1 depends of Ruby >= 1.9: https://rubygems.org/gems/rake/versions/10.2.1

But click on another version like this: https://rubygems.org/gems/rake/versions/10.2.2 and it says ">= 1.8.7" and it should work in your case.

So, you need to manually check for the right version of each gem.


Backup recovery partition of windows 8 in GPT

Well one thing you can do is image the partition using dd. Create a Bootable Ubuntu USB/CD and Boot from it(Make sure you choose the "Try" option). Then just open a terminal window in Ubuntu and do the following:

List the available partitions on your internal drive

fdisk -l | grep sda

Once you've made sure of which Partition is the Recovery Partition(ex: /dev/sda7) you can now use dd to backup the partion:

sudo dd if=/dev/sda7 of=/location/to/save/the/image/Recovery-Backup.dd bs=1m

Now in the future you can restore the partition if you ever need to.


You don't make clear in your question as to how you have set up name resolution in your network for your server.
Do you have a DNS server configured with the name of the server in it or have you added the server-name to the hosts file on your client.

A couple of ways you could progress here:

Check in file /etc/hosts for an entry  of the form:
server_ipaddress   servername

or

Try

$ sudo mount server_ip_address:/export/users /mnt

or

Try:

$ sudo mount servername.local:/export/users /mnt

I think 13.04 deploys avahi by default which provides a service called multicast dns using this allows all hosts to be identifed as hostname.local

HTH

Rob


Your long shutdowns are caused by a possible unresponsive ambient light sensor D-Bus proxy. You can find some information on the GNOME website here. If you can live without needing an accelerator or ambient light sensor on your computer, just uninstall it using sudo apt-get remove --auto-remove iio-sensor-proxy. If this is a laptop like a Lenovo Yoga, where an accelerator might be used to see if the device should be in "tablet mode" this might have been automatically installed while Ubuntu was looking for drivers. Another option, if you still want to use the accelerator, is to kill the task after a certain amount of time. To do that i would try timeout KILL_TIME ~/FILE.


Formatting drive doesn't do anything and shows no errors

you must try to correct filesystem with fsck tool, Connect your USB-Stick and open terminal by pressing Ctrl-Alt-t and run the commands as follows-

sudo fdisk -l

it will give you the dev name of the USB partition , and lets say it sdb2 for example your might be diffrent , then -

sudo umount /dev/sdb2
sudo fsck.vfat -f -p /dev/sdb2

hope it helped you. if you will get any error paste it in your question as update, or use gparted to format it using GUI, seach in dash if its there if not then use following to install it-

sudo apt-get install gparted

or install it from Ubuntu-Software-Center and then use it with sudo permission as-

sudo gparted

and format that pendrive.

The other way to format it is use windows and right click on Pendrive and make Quick format. that is all.


Ubuntu installed /home to visible RAID array, but can't find it on boot

First, make sure that the mdadm package is present in the installed system (not just the live system) using apt-get install mdadm. I will assume you are doing this from a root shell, either via recovery mode or for example by invoking sudo -i, and hence none of the following commands are prefaced with an explicit sudo. If you are doing this from recovery mode, you will need to remount the root filesystem in read-write mode first i.e.

mount -o remount,rw /

You will also need a working internet connection if the package has not already been downloaded into the cache - if you have a wired ethernet connection to a router that's running a full DHCP connection, that should be possible by running

ifconfig eth0 up

dhclient -v eth0

Alternatively, you can try exiting back to the recovery mode menu and choosing 'Enable networking' - which should have the side effect of remounting in rw mode as well. Then

apt-get install mdadm

That should create a default /etc/mdadm/mdadm.conf file, however in order for the system to assemble the array on boot, you need to append the details of your new array to that file

mdadm --detail --scan >> /etc/mdadm/mdadm.conf

It may also be necessary to write the array details to the initial ramdisk using

update-initramfs -u

(I think that's only strictly required if you want to boot from a RAID device, but it won't do any harm).


If you want to see all man pages about a command, one after the other, use the -a to man:

man -a mkdir

then use the SPACE bar, then q to quit the first page and then the ENTER key to see the next (2) page.

To find out more you can lookup the manpage of man using

man man


How do I run specific sudo commands without a password?

Use the NOPASSWD directive

You can use the NOPASSWD directive in your /etc/sudoers file.

If your user is called user and your host is called host you could add these lines to /etc/sudoers:

user host = (root) NOPASSWD: /sbin/shutdown
user host = (root) NOPASSWD: /sbin/reboot

This will allow the user user to run the desired commands on host without entering a password. All other sudoed commands will still require a password.

The commands specified in the sudoers file must be fully qualified (i.e. using the absolute path to the command to run) as described in the sudoers man page. Providing a relative path is considered a syntax error.

If the command ends with a trailing / character and points to a directory, the user will be able to run any command in that directory (but not in any sub-directories therein). In the following example, the user user can run any command in the directory /home/someuser/bin/:

user host = (root) NOPASSWD: /home/someuser/bin/

Note: Always use the command visudo to edit the sudoers file to make sure you do not lock yourself out of the system – just in case you accidentally write something incorrect to the sudoers file. visudo will save your modified file to a temporary location and will only overwrite the real sudoers file if the modified file can be parsed without errors.

Using /etc/sudoers.d instead of modifying /etc/sudoers

As an alternative to editing the /etc/sudoers file, you could add the two lines to a new file in /etc/sudoers.d e.g. /etc/sudoers.d/shutdown. This is an elegant way of separating different changes to the sudo rights and also leaves the original sudoers file untouched for easier upgrades.

Note: Again, you should use the command visudo to edit the file to make sure you do not lock yourself out of the system:

sudo visudo -f /etc/sudoers.d/shutdown

This also automatically ensures that the owner and permissions of the new file is set correctly.

If sudoers is messed up

If you did not use visudo to edit your files and then accidentally messed up /etc/sudoers or messed up a file in /etc/sudoers.d then you will be locked out of sudo.

The solution could be to fix the files using pkexec which is an alternative to sudo.

To fix /etc/sudoers:

pkexec visudo

To fix /etc/sudoers.d/shutdown:

pkexec visudo -f /etc/sudoers.d/shutdown

If the ownership and/or permissions are incorrect for any sudoers file, the file will be ignored by sudo so you might also find yourself locked out in this situation. Again, you can use pkexec to fix this.

The correct permissions should be like this:

$ ls -l /etc/sudoers.d/shutdown
-r--r----- 1 root root 86 Jul 16 15:37 /etc/sudoers.d/shutdown

Use pkexec like this to fix ownership and permissions:

pkexec chown root:root /etc/sudoers.d/shutdown
pkexec chmod 0440 /etc/sudoers.d/shutdown


Conky can show actual amount of RAM being used plus cached memory or just the former one. To toggle between two, You can use buffer settings:

If no_buffers yes Conky will show only actual amount of RAM being used.

If no_buffers no Conky will show actual amount of RAM + Cached memory


Connect to FTP/SFTP in Dolphin or transfer Nautilus Bookmarks

On the left hand side of the Dolphin window, click Network. There will be a item for adding a network location like ftp or scp. Dolphin is a great file manager...


Where are Adobe Flash cookies (sol files) stored?

If you checked the "Install this third party software" option during Ubuntu installation process, you're using NPAPI Adobe Flash plugin installed through flashplugin-installer package. The same plugin is provided by adobe-flashplugin package from Canonical Partner repo as well. This is the plugin generally used by Firefox and all other browsers not based on Chromium. In this case, the cookies are stored at:

~/.macromedia/Flash_Player/#SharedObjects/
~/.macromedia/Flash_Player/macromedia.com/support/flashplayer/sys/

Google Chrome bundles a Pepper Plugin API (PPAPI) based Flash plugin. For this plugin, the .sol files are stored at:

~/.config/google-chrome/Default/Pepper Data/Shockwave Flash/WritableRoot/#SharedObjects/

If you use the PPAPI Flash plugin on other Chromium based browsers, replace google-chrome in the path given above with name of your browser. For example, with Chromium:

~/.config/chromium/Default/Pepper Data/Shockwave Flash/WritableRoot/#SharedObjects/

Tested on Adobe Flash 21.0 PPAPI and 11.2 NPAPI plugins.

Source : Wikipedia page on Local Shared Object
Thanks to Xen2050 for providing info about Flash plugin on Chromium!


How do I install old programs saved from Windows?

Windows programs will not run natively on Ubuntu. You would probably be able to run them in Wine (a Windows compatibility layer for Unix-systems), but in most cases, there is also a Linux version. If you're looking for alternative programs simply browsing the software center (search for "Ubuntu Software" in the dash) will get you results, if not, search the web or check out alternativeto.net. They have a filter option for Linux programs.

Be careful fooling around with folders outside your home directory. Usually you're supposed to install apps using the apt-get install application-name or snap install application-name command, from the software center, or by downloading and installing .deb files.

But if you need to do something funky in etc, just prefix your commands with sudo or type the sudo bang bang (sudo !!) command directly after you issued a command with insufficient permissions. If don't want to retype the sudo command every time, you can issue sudo -i to login as root or sudo su to log in as root and stay in your home folder. Doing this will give you administrative rights within that terminal session. After you're finished, type exit to log back in with your user account or close the terminal window. But be careful: With great power comes great responsibility. And don't drink and sudo.

Also, most programs don't go in the etc folder. Use usr or opt. If you're using wine to run your old windows apps, you will use what is called a virtual C drive - essentially just a folder inside you home directory. Detailed instructions can be found on their website.


Share folder from Ubuntu Virtualbox to Windows host

There are two straight forward ways to accomplish this that are independent of the virtualization software that you are using.
1. set up a samba share folder on the guest and then add it like a shared network folder on the host.
2. Share a folder on the Windows host and then use samba to open/map it on the Ubuntu guest.

Virtual box, and I believe VMWare have an option to share folders between guest and host that uses this underlying setup but is all done through the gui of the virtualization software.

To be more specific I would need to know what path you would like to take.  Option 1 would best match the paradigm of guest to host.


How to reset Network Manager to default?

In a terminal, run

nmcli con

This will output something like this:

NAME                      UUID                                   TYPE              TIMESTAMP-REAL
Wired connection 1        67d66f2c-9a03-4298-8136-35933de5febe   802-3-ethernet    Wed 17 Jun 2015 17:00:08 BST

this will list all your connections defined in NetworkManager

So now, pick the one you want to delete either by name or by uuid and run

nmcli con delete uuid 67d66f2c-9a03-4298-8136-35933de5febe

All the settings associated with that connection will be lost. But it will not clean your nm-applet menu.

You will need to logout/relogin or reboot for this to be visible in nm-applet menu


Need authentication on OS startup assistance

It depends on what you mean by boot-up, but most likely what you want can be done by adding custom entry into systemd.
https://www.freedesktop.org/wiki/Software/systemd/ - systemd wiki.
https://wiki.archlinux.org/index.php/systemd#Writing_unit_files - arch wiki entry on systemd.

Managed to create service that does something close to what you asked, adding solution.

Disclamer: I've implemented and tested this process in Ubuntu MATE 17.04. It should work in 16.04 or above, but there can be problems in older versions. Also worth noting, that systemd was not used in much older versions of Ubuntu either.

Creating bash script that will perform our auth check by checking if specific USB device is connected.

First of all, we need to create bash script to perform our "auth" check. Here is example of script to perform check based on connected USB device ID:

#!/bin/bash
# test usb auth script
CHECKID="0461:4de3"
READID=$( lsusb -d "$CHECKID" | awk '{print $6}' )
wait
printf "Required: ${CHECKID} \nObtained: ${READID}\n"
if [ "$CHECKID" == "$READID" ]
then
    echo "Usb-auth check passed!"
else
    echo "Usb-auth check failed!"
    echo 'Calling for shutdown...'
    shutdown 0
fi

CHECKID contains predefined ID of device manufacturer and device itself.
READID variable will get result of performing command contained inside $( ), in this case it will be lsusb -d "$CHECKID" | awk '{print $6}'.
lsusb -d "$CHECKID" will try to find device with ID saved in $CHECKID variable, while awk '{print $6}' will parse result to save only word number 6 in resulted row. For example lsusb -d "0461:4de3" in my system returns this:
Bus 002 Device 003: ID 0461:4de3 Primax Electronics, Ltd
and 6th word in this output is exactly device ID.
wait call will tell script to wait until any of our previous child commands are done before moving on to comparison.
printf is included solely for logging\debugging purposes.
if [ "$CHECKID" == "$READID" ] is where actual check is run. In compares CHECKID with READID, and if they are equal, we have passed check, otherwise we did not and shutdown will be executed.

Step by step process:

1. Create bash script file.
Navigate to /usr/local/bin while having root privileges (if you are using nautilus\caja, you can open /usr/local, right click on "bin" folder and use "open as administrator" option). This folder is used to locate system wide custom scripts. Local user scripts can be created at /home/[user]/bin instead. Create empty file and open it with your preferred text editor. Fill it with your check script, as example I will be using USB device check from above:

#!/bin/bash
# test usb auth script
CHECKID="0461:4de3"
READID=$( lsusb -d "$CHECKID" | awk '{print $6}' )
wait
printf "Required: ${CHECKID} \nObtained: ${READID}\n"
if [ "$CHECKID" == "$READID" ]
then
    echo "Usb-auth check passed!"
else
    echo "Usb-auth check failed!"
    echo 'Calling for shutdown...'
    #shutdown 0
fi

I used "#" to comment out actual shutdown call, to prevent shutdown during setup and tests.
For the sake of simplicity of example, we will assume that script is named usb-auth and full path is /usr/local/bin/usb-auth. I will use it in future steps, so make sure to modify them if you use different file name or path.

2. Give your script executive permissions.
You can do that by running command sudo chmod +x [file], in my case it will be:
sudo chmod +x /usr/local/bin/usb-auth

3. Find out ID of device you want to use.

To list usb devices connected to your system you can use command lsusb. Connect your USB device, run command, disconnect device, run lsusb again, check which device now missing, replace CHECKID variable in script with one for your device.
Here is part of my output of this command:

lsusb
Bus 002 Device 006: ID 0480:b206 Toshiba America Inc
Bus 002 Device 005: ID 8086:0189 Intel Corp.
Bus 002 Device 004: ID 0b38:0010 Gear Head 107-Key Keyboard
Bus 002 Device 003: ID 0461:4de3 Primax Electronics, Ltd

Device 003 in this case is my mouse, and it will be used in our check, so we will need ID "0461:4de3". After we got it, we can store it in our script as base for check, in this line:
    CHECKID="0461:4de3"

4. Check your script in terminal to make sure it works as intended.
Make sure that shutdown call is commented out during tests.
Just type name of your script in terminal and it should automatically pick it up, because we located it in ``/usr/local/bin/`.
Checking with device connected:

ethuil~$ usb-auth
Required: 0461:4de3
Obtained: 0461:4de3
Check passed!

Disconnect device, check again:

ethuil~$ usb-auth
Required: 0461:4de3
Obtained:
Check failed!
Executing shutdown...

After you make sure that script works as intended in running system, we can move to creating service and perform first checks during actual system start-up.

Creating systemd service to call bash script

5. Create service file and locate it in /etc/systemd/system/.
You will need root privileges again for this. Create empty file with extension .service, I will name mine auth-usb.service.
Open it with your text editor and fill it with content like this:

[Unit]
Description=usb-auth bash script
After=network-online.target

[Install]
WantedBy=sysinit.target

[Service]
ExecStart=/bin/bash /usr/local/bin/usb-auth
Type=oneshot
RemainAfterExit=yes

Breaking down this part:

Description - this is what you will see in your systemd logs or console during system launch, when systemd will be trying to start this service.

After - this property specifies after which service we need to launch our script. In this example we have "network-online.target", which means that our script will be launched only after network will be online. This part can be important if your script uses parts of system affected by other services, for example network connection in this example. You can list all main target services using command:
systemctl list-units --type=target
If you are looking for specific service to be up when you run your script, you can list all services using command:
systemctl list-unit-files

WantedBy - this is important part, which will define at what point our service will be called. Usually custom scripts will be using "WantedBy=multi-user.target" and run after system is started and fully working. In our case we will use "sysinit.target" to make it run during system initialization. If you want to run script at different time, you can use same systemctl list-units --type=target as before to list possible values. In my example I will stick to "sysinit.target".

More about [Unit] and [Install] parts:
https://www.freedesktop.org/software/systemd/man/systemd.unit.html#%5BUnit%5D%20Section%20Options

ExecStart - this is where we tell what exactly we want our service to be running. "/bin/bash" will execute bash interpreter, and "/usr/local/bin/usb-auth" is passed as parameter to tell it location of script to run. If you plan to use not bash script, but actual self made program, you can specify path to your program instead of "/bin/bash *".
Type=oneshot - this is type of our service.
RemainAfterExit=yes - this part tells that system will consider our service as active even after all its called processes will exit.

More about different types and [Service] part:
https://www.freedesktop.org/software/systemd/man/systemd.service.html#Type=

6. Enable our newly created service.
Now that we created our /etc/systemd/system/auth-usb.service and /usr/local/bin/usb-auth files, we can enable our service by running command systemctl enable [service filename]:

ethuil~$ systemctl enable auth-usb.service
Created symlink /etc/systemd/system/sysinit.target.wants/auth-usb.service → /etc/systemd/system/auth-usb.service.

More about systemctl command:
https://www.freedesktop.org/software/systemd/man/systemctl.html#start%20PATTERN%E2%80%A6
7. Check if our service is working.
Run command systemctl restart auth-usb.service to run our check service.
After you did it, check logs to see if it works as intended using command journalctl -u auth-usb.
In my case:

ethuil~$ systemctl restart auth-usb.service
ethuil~$ journalctl -u auth-usb
-- Logs begin at Tue 2017-07-25 19:15:23 EEST, end at Tue 2017-07-25 19:15:52 EEST. --
Jul 25 19:15:49 ethuil-300E5Z systemd[1]: Starting usb-auth bash script...
Jul 25 19:15:49 ethuil-300E5Z bash[1262]: Required: 0461:4de3
Jul 25 19:15:49 ethuil-300E5Z bash[1262]: Obtained: 0461:4de3
Jul 25 19:15:49 ethuil-300E5Z bash[1262]: Check passed!
Jul 25 19:15:52 ethuil-300E5Z systemd[1]: Started usb-auth bash script.

If there are some issues with script, now is the time to modify it and make sure it works as intended.

8. Restart system and see if it was launched during system startup as intended.
Self explanatory. Just restart PC and run journalctl -u auth-usb to see if service run as it should. If something is not working the same during startup as during fully running system,  this is way you can check it, by restarting and checking log. You can also run journalctl -t systemd to see at which point of system startup your service is getting started and see if you need to change that.

9. Uncomment "shutdown" command in your script.
Uncomment part of your script that should be run if check failed and restart system to see if your check script works. This is final check, try running PC with your device connected and without, to see if it works fine. Make sure that you have ways to access script if you wont be able to pass check yourself, for example by having external USB stick with system, from which you can load-up and modify your script.

10. This is it, we are done. Now you can improve process to fit your personal need.
At this point you can just modify whole process to fit your needs. Make more complicated bash script or create fully functional program instead, make it to check which USB port you connecting device to, doing something else instead of shutdown (for example silent logging of unauthorized activity instead of just shutting down) etc. In any way, that would be outside of scope of this answer. I did try to make it work with MAC address, and it is possible to do, but my current setup does not have proper and reliable way to test it properly and stable, so I did not include that example.


Preferred method for installing Oracle Sun JAVA in 16.04.3 LTS?

Both of these are not 100% official. One uses a custom repository (questionable), the other a PPA (less questionable, but still not fully official. The official method includes:

Going to java.com and finding the link to the linux version.
You will notice that there is 4 versions of the package, x64 and x86. Find the appropriate one for your PC, then choose the .tar.gz format when downloading.
Extract the .tar.gz archive into a folder and chmod +x each file if needed. Then, this is technically done, but you need to be in the directory to invoke java. To fix this, you have to...
Copy the directory to a place where anyone can see it and recursively set the permissions so that anyone can access it. A good place to copy the directory would be /usr/bin/java or /usr/java and while technically against the FHS, it works. Then, open a new terminal and invoke java. If the command is not found, then open /etc/environment and with path, use :. Java is now installed.


The MonoDevelop package from the default Ubuntu 17.10 repositories is named monodevelop. Alternatively you can also run C# code from the terminal without installing MonoDevelop IDE as shown in the following example.

Run C# program in the terminal

Install mono-complete from the default Ubuntu repositories.

sudo apt install mono-complete

Optionally you can also install the Mono Visual Basic Compiler (VB.NET).

sudo apt install mono-vbnc

Save this example C# code in a file called hello.cs.
libdvdcss
    using System;

namespace Project_1 {
    class MainClass {
        public static void Main (string[] args) {
            Console.WriteLine ("Hello World!");
            Console.ReadKey ();
        }
    }
}

Make hello.cs executable. Right-click the hello.cs file -> select Properties -> Permissions tab -> put a check mark to the left of Allow executing file as program.
Change directories using the cd command to the directory that contains the hello.cs file.
Use the mcs compiler and create a Windows executable named hello.exe from the source hello.cs.

mcs -out:hello.exe hello.cs

Run the hello.exe program with mono.

mono hello.exe

The results of running your program in step 6. should be:

Hello World!

Press Enter to exit back to a default terminal prompt.

Run C# program in MonoDevelop

Install MonoDevelop from the default Ubuntu repositories.

sudo apt install monodevelop # 17.10 and earlier

Open MonoDevelop application.
Create a new project. Select File -> New -> Solution -> .NET -> Console Project -> check the dropdown menu next to Console Project to make sure that C# is selected -> click the Next button  -> select a name and directory location for your project -> click the Create button.
In the left pane select Program.cs. Copy the example C# code from the hello.cs file in Step 2. into Program.cs.
Select Build -> Build All.
Click the Run arrow ▶ in the upper left corner of MonoDevelop to run the program.


Tried installing bumblebee and now unity is corrupted?

I see that optirun does not work for you. The Troubleshooting article mentions a solution for an error in your /var/log/Xorg.8.log: edit /etc/bumblebee/xorg.conf.nvidia and change DFP to CRT-0.

I've downloaded the acpidump for your laptop model and it looks like that the calls in /etc/bumblebee/cardo{n,ff} are correct. To get PM really working, you also need the acpi_call kernel module. You can install it by installing acpi-call-tools from the bumblebee/stable PPA (which you've already enabled):

sudo apt-get install acpi-call-tools

In /etc/bumblebee/bumblebee.conf, change STOP_SERVICE_ON_EXIT=Y to STOP_SERVICE_ON_EXIT=N to allow the card to be disabled after the last optirun instance has been quit. You need to restart the daemon after that change:

sudo /etc/init.d/bumblebee restart


[I get different partitions on Gparted and Windows]

It sounds like you tried to create a partition for Ubuntu using the Windows partitioning tool. This was a mistake, since the Windows partitioning tool converts from standard disk partitions to Microsoft's proprietary LDM/"dynamic disk" whenever the number of partitions exceeds four. Without more detailed information, I can't be 100% positive that this is what happened, but my hunch is that it was. Unfortunately, Microsoft provides no easy way to undo this change. I've heard that some third-party Windows tools, such as EaseUS Partition Master, can make this change, but I've never tried such tools.


ubuntu 13.10 can't detect windows 7 and NTFS partition

Is your drive partitioned correctly?

If not here's the solution that may help you:

Method 1 (with Gparted):

Boot into Ubuntu liveCD and click 'Try Ubuntu'
Then go to the GParted application
Shrink the Windows volume, for an example see below (or click here):

After that create a partition for Linux with EXT2, EXT3 or EXT4 partition (I recommend EXT4)

*Then reboot (restart) , and you will see the installation option, 'Install Ubuntu'.

Method 2 (using Ubuntu LiveCD):

When Ubuntu installation shows the option 'Something Else' click it
Then click 'Advanced Partition Tool' and shrink Windows volume
Create one partition with EXT2 / EXT3 / EXT4 partition in the free space.
After that you will see the button install now enabled, click it.


Does snap require particular certificates to be installed?

If you are installing a snap you've built locally you need to add the --dangerous, so in your case:

sudo snap install hello_2.10_amd64.snap --dangerous


This has been acknowledged by Mozilla, and a fix has been released as a "study" that should automatically install itself if you have them enabled in Firefox's settings.

Here's the blog post discussing the issue and the fix:

https://blog.mozilla.org/addons/2019/05/04/update-regarding-add-ons-in-firefox/


In the Dropbox entry, <release-main> needs to be replaced with precise, and in the tucan PPA entry, prec needs to be replaced with precise.

Open up Software Sources or Software & Updates, and switch to the Other Software tab. Find the Dropbox entry and click Edit. Then, replace <release-main> with precise. Do the same with the tucan PPA entry, but replace the prec with precise.


You need to use trap to intercept the error signal.
#!/bin/bash

ERROR=0
error_handling(){
    ((ERROR > 0)) &&
    printf %s\ %s\\n "$1" "$2"
    exit $ERROR
}
trap "ERROR=1" ERR

jdshfsduoifh

error_handling 1 "PANIC error!"

Bash has a built-in function for handling missing commands
#!/bin/bash

command_not_found_handle(){
    echo "Command '$@' not found, please install me!"
}

jdshfsduoifh

If you really want to silence messages, you can redirect stderr to /dev/null.
#!/bin/bash

exec 3>&2 2>/dev/null

# This error will be
# redirected to /dev/null
ls nonexistant_1
(($? > 0)) &&
echo "Error: this isn't right!"

# Let's restore our old descriptor.
exec 2>&3 3>&-

ls nonexistant_2
exit

Stderr may already have a descriptor assigned; example script.sh 2> file.log, using exec to manipulate the descriptor of the current shell, we first need to duplicate stderr to a new descriptor before assigning /dev/null to stderr, it allows for restoring the old descriptor.


Try this link on adding menu item to the EFI bootloader.
https://www.linuxbabe.com/command-line/how-to-use-linux-efibootmgr-examples


After downloading gcc-4.6.3 follow this steps:

sudo su -
cd /usr/bin
ls -l gcc*

You have to see like this at the end gcc -> 4.8 with light blue colered.

rm gcc
ln -s gcc-4.6 gcc

And finally to check if gcc linked to gcc-4.6 enter follow command:

ls -l gcc*

You have to see like this at the end gcc -> 4.6 with light blue colered.


run-init /sbin/init exec format error after reinstalling Ubuntu 32-bit with Ubuntu 64-bit

So, if anyone wondered I managed to fix my issue by overwriting back the 64-bit mess I made with a 32-bit copy of Ubuntu 12.10 (the broken system was untouched - I did not try to fix it anyhow except overwriting it with a 32-bit Ubuntu).
The instructions on how to overwrite the existing installation can be found here.
After reinstalling my system, I still had to run update-manager -d to update my applications, otherwise I was getting weird errors (like touchpad or wifi not working correctly).


Selective copying would be easier in that you only copy folders such as Documents, Movies, Photos etc. over to your Ubuntu partition...  Windows will see shortcuts as a small link file whereas Ubuntu/Linux has it's own method called symbolic links so it may treat Windows' links as a complete directory in itself...