Transfer a ssh session between the same physical devices from one network to another

It is not possible. SSH is use tcp protocol for session between end's.
TCP create socket address for communication. Socket address is address witch combines ip_address+protocol+port. Example of socket address when you go to some web is   69.59.197.24:80:tcp. When you move from one network to another you change socket becouse you change ip address, and all tcp connection will be killed. More explination about socket address you can find   here. Also you can do some resarch for tcp/ip protocol.


Any advantage or disadvantage to using the command line vs the graphical update process using update manager?

I don't think so, both should do the same thing. only thing is graphical method is more suitable for people who are new or don't play with CLI much.


Here is the filesystem folder:

/var/snap/anbox

And here is i.e. the "Download" folder:

/var/snap/anbox/common/data/media/0/Download


XFCE un- lock screen not working (XFCE4, lightdm)

light-locker is buggy, see e.g.
Bug #1832960, Bug #1855753

In 19.10 you can use xfce4-screensaver for locking, instead of light-locker.
In 18.04 (and in 19.10) you could use xscreensaver instead of light-locker. You have to install the screensaver first. Make sure only the one you use is autostarted during login in "Session and Startup" dialog.

You could use which locker you want with Xubuntu 19.10, see here for instructions. As an administrator you could use any locker with an older release, too, by putting your version of xflock4 script in /usr/local/bin. (Otherwise the default version at /usr/bin/ is used.)


Uninstalling damaged program installation

Run sudo apt install -f in a terminal window. It will ask you for your password.


How to connect my Ubuntu 18.04 to TV by HDMI

I also had this problem. I tried everything and nothing worked, until I changed the login display manager from gdm3 to lightdm. Run these commands in the terminal.

sudo apt-get install lightdm
sudo dpkg-reconfigure lightdm

Select and use the Enter key to click Accept as seen in this screenshot.

Then select lightdm as the default login display manager as seen in this screenshot.

And that's it, reboot and go. If your login display manager is modified according to your preferences, there is also a program for Ubuntu to customize it LightDM GTK + Greeter Settings.


How do I check how much free space is on my usb stick? (Kubuntu 18.04)

You should look in the lower right corner of the Dolphin screen after you've inserted the USB stick. In the example, my USB stick has 3.7 GiB free.

If you don't see anything like that, open Dolphin, press Ctrl+Shift+, to bring up Dolphin Preferences. In there, click on General in the left pane and then on the Status Bar tab and ensure that Show Space Information is active.

Dolphin also allows you to examine the USB stick's properties. With the device inserted, move up to root and then to media. Open media. There you'll see, possibly among other folders, a folder with your username. Open that: you should see a folder bearing your USB stick's name (as seen by Dolphin). Right-click on that folder to get the window shown below. The General tab will show you what you want.

And, I know you asked for a route using the graphical interface but you can get the basic information, somewhat quicker, using the command line. See the last line in the output below on running df -h:

dkb@kububb:~$ df -h
Filesystem      Size  Used Avail Use% Mounted on
udev            3.9G     0  3.9G   0% /dev
tmpfs           785M  1.6M  784M   1% /run
/dev/sda6       288G   26G  248G  10% /
tmpfs           3.9G     0  3.9G   0% /dev/shm
tmpfs           5.0M  4.0K  5.0M   1% /run/lock
tmpfs           3.9G     0  3.9G   0% /sys/fs/cgroup
/dev/sda1       496M   34M  463M   7% /boot/efi
tmpfs           785M     0  785M   0% /run/user/118
tmpfs           785M  4.0K  785M   1% /run/user/1000
tmpfs           785M   12K  785M   1% /run/user/1001
/dev/sdb1       466G  196G  271G  43% /media/dkb/TOSHIBA EXT


Maybe you can try this:

sudo setxkbmap -option grp:alt_shift_toggle no,ru

This maybe can help you but you have to do it everytime you log in to your system. You can add this command to execute


Not really, I personally only do my updates once a week, so it won't really make a difference. Ubuntu, as a rule, is pretty secure security wise.


Download SVG EDIT for using it in mediawiki

Download SVGedit and place it (unziped) in extensions/SVGEdit/svg-edit
Open LocalSettings.php (with some terminal editor such as vim or nano) and add or change the following:

i. require_once("$IP/extensions/SVGEdit/SVGEdit.php");

ii. $wgFileExtensions[] = 'svg';

iii.  $wgAllowTitlesInSVG = true;

iv. $wgSVGConverter = 'ImageMagick';
In terminal issue the following to install ImageMagick:

sudo apt-get update
sudo apt-get install imagemagick
Finally try first without setting the $wgSVGEditEditor setting


Don't use * for this. Use grep 'ki' trial_file.txt or grep -F 'ki' trial_file.txt.

Unless you pass it the -x/--line-regex option, grep will return lines that contain a match anywhere, even if the whole line isn't a match. So all you have to do is match part of the line. You don't have to do anything special to indicate there may be more characters.
In a regular expression, * means "zero or more of the previous item." This is an entirely different from its meaning in shell pathname expansion (see also this article, man 7 glob, and this section). So, for example:

ax*b matches a, followed by any number of xes (even none), followed by b: ab, axb, axxb, axxxb, ...
a[xz]*b matches a followed by any number of characters where each is x or z, followed by b: ab, axb, azb, axxb, axzb, azxb, azzb, axxxb, ...
a(xyz)*b matches a, followed zero or more occurrences of the string xyz, followed by b: ab, axyzb, axyzxyzb, axyzxyzxyzb, ...

In this case, it seems like you're just searching for text. You don't need to use any regular expression metacharacters like ., *,  or \ that have special meanings. That's why I suggest passing the -F flag, which makes grep search for "fixed strings" rather than performing regular expression matching.

If, however, you only want to match starting at the beginning of the line, then you do want to use a regular expression metacharacter: ^, as mjb2kmn suggests. This anchors your match to the start of the line. In that case you would run grep '^ki' trial_file.txt.

For more information on the options grep supports, see man grep and the GNU Grep manual.

Although in general I suggest enclosing regular expressions in ' ' quotes, in this case no quoting is necessary because the shell does not perform any expansions on ki or ^ki before passing them to grep.


Unicode (Hebrew) typing: Works in some applications but not others

Turns out that the problem was incorrect setting of my locale. My locale was set to en_IL.UTF-8, which apparently isn't recognized/supported. I changed all entries in /etc/default/locales to be en_US.UTF-8, and then logged out and logged in again - now I can type in Hebrew where previously I couldn't.


Samba server doesn't appear to work on system restart

Have you verified that Samba is running on the server? That would be the first thing to verify, you should be able to run the command:

sudo restart smbd
sudo restart nmbd

to verify that Samba is actually available and running.


using deja dup to backup my ubuntu to a windows shared folder

I had the same issue. Following rbello1824's link I was able to resolve it. I had to select the custom location option and manually enter the location as:

smb://WORKGROUP\Username@server/Folder

Worked perfect! Thanks rbello!


New to ubuntu problem in accessing internet

This is resolved by editing resolv.conf by adding nameserver with my ISP's DNS server address.

Thanks to all for replying.


HP Color Laserjet M252dw does not print some files

I have this printer and it works flawlessly with ubuntu linux , i am using the HP Color LaserJet Pro M252 Postscript (recommended) driver.

You will need some disk space for spooling to print.


How to open large file with extension .v2.gz?

Yes, use gunzip:

gunzip file.v2.gz

The extracted file file will be file.v2.


can you schedule the start and stop time of copying in wget?

wget itself doesn't have scheduling properties, but as you are using Linux then you probably have to take a look for cron.

Cron is a time-based job scheduler in Linux, used to schedule jobs (commands or shell scripts) to run periodically at fixed times, dates, or intervals.

To add a job to cron scheduler as normal user run the command:

crontab -e

else if you want to schedule a job for root:

sudo crontab -e

Linux Crontab Format

MIN HOUR DOM MON DOW CMD

Field      Description       Allowed Value

MIN        Minute field        0 to 59
HOUR       Hour field          0 to 23
DOM        Day of Month        1-31
MON        Month field         1-12
DOW        Day Of Week         0-6
CMD        Command             Any command to be executed.

For example:

Run the wget in a specific time let's say in 15july 8:20 AM

then the cron entry would be like:

20 08 15 07 * wget URL://

Take  a look at:

man cron
man crontab
man 5 crontab
http://www.adminschoice.com/crontab-quick-reference
https://askubuntu.com/a/630124/150504

Now by the time you want to stop wget you have also to add another cron entry using pkill command: let's say I want to stop wget at  15july 10:30 PM then add this entry to cron:

30 22 15 07 * pkill wget

To resume again a broken wget download, you can use the -c or --continue option in wget.

wget -c URL://
wget --continue URL://

man wget

-c
   --continue
       Continue getting a partially-downloaded file.  This is useful when
       you want to finish up a download started by a previous instance of
       Wget, or by another program.


How do I increase the total size of my storage devices?

There's no magic switch to flip to make it bigger. End of answer. Congratulations on a handy conspiracy theory.

Storage devices aren't like Atheros wireless devices where they used a wireless chipset across all their products and limited the channel capabilities in software.


Play music to bluetooth, but system sounds to internal speakers

Yes it is, through pavucontrol.

In fact, that's my configuration too.

Spotify goes to CSL-27998 (my Bluetooth adapter) and everything else goes to the Internal Stereo (because this is the one selected in the screen you posted).

EDIT: This is my configuration on the Sound System Setting

Please also note that when you modify the settings in the System Setting (second screenshot) it resets what you did in pavucontrol (because it's more coarse) and redirects everything to the output you choose.


Is it possible to change the Terminal font?

Bash terminal:

Menu, Edit => Profile Preferences => General tab; uncheck Use the system fixed width font, and select the font you want.

For general xterm terminal, you need to create a file ~/.Xresources, and add settings to it, such as xterm*font: Sublime\ Text\ 2-12 for 12 point (this is a guess, I don't know if it's totally correct).


Ubuntu 18.04.2 Server + Intel VROC Array on a Dell 7920

Ok, got around it.
Used the daily: 20190314.
Had to install using HWE kernel.


I want to install Nvidia module 352.30 on ubuntu 14.04 (2 video cards intel and nvidia)

A much better way to install 352 driver is running in terminal

sudo add-apt-repository ppa:graphics-drivers/ppa
sudo apt-get update
sudo apt-get install nvidia-352 nvidia-prime

and reboot.


Detect right and left shift keys pressed together from within Awesome WM

On my computer, it ended up working with the following:

  awful.key({ "Shift", }, "Shift_R", function () somefunction() end),

Shift_L does not seem to be recognized.  But Shift + Shift_R did the trick.


Alternative to ibus typing booster Ubuntu 18.04

ibus-typing-booster is available in the official repositories since Ubuntu 20.04. Unfortunately, it is not available as .deb package for releases of Debian or Ubuntu prior to 20.04.
That means you will need to compile it yourself. Here are some brief instructions (source):
sudo apt-get install ibus libibus-1.0-dev
git clone git://github.com/mike-fabian/ibus-typing-booster.git
cd ibus-typing-booster
./autogen.sh
./configure --prefix=/usr --libexecdir=/usr/lib/ibus
make
sudo make install

The official manual is available here.


How can I permanently/globally disable word wrap in kate?

There is another setting you need to turn off.

Uncheck the checkbox in settings -> configure kate -> Editor Component -> Appearance -> Dynamic Word Wrap and it should now work the way you want.


Ubuntu 8.10 will install on 32 bit sys but 12.04 won't

Wild guess, have you tried to remake the label on the disk ( right click new master boot record) and then partitioned on a 4k alignment? I recall that parted was doing something weird back then and if it didn't hit the alignment it would break. It might also be the case that on such old drives, one of the important sections of the disk where the partition holds metadata might have a bad sector. One way of checking would be to use ctrl+alt+F2, after you initiate the format, drop into console and type dmesg and see if it complains of bad sectors. If it does, then the disk is bad.
Look for something similar to:

   [Sun Jul 21 13:36:32 2013] ata4.00: exception Emask 0x0 SAct 0x1 SErr 0x0 action 0x0
   [Sun Jul 21 13:36:32 2013] ata4.00: irq_stat 0x40000008
   [Sun Jul 21 13:36:32 2013] ata4.00: failed command: READ FPDMA QUEUED
   [Sun Jul 21 13:36:32 2013] ata4.00: cmd 60/20:00:2c:eb:7e/00:00:08:00:00/40 tag 0 ncq 16384 in
   [Sun Jul 21 13:36:32 2013] res 41/40:00:2f:eb:7e/00:00:08:00:00/40 Emask 0x409 (media error) &lt;F&gt;
   [Sun Jul 21 13:36:32 2013] ata4.00: status: { DRDY ERR }
   [Sun Jul 21 13:36:32 2013] ata4.00: error: { UNC }


How to fix APT error during the "install the base system" in Ubuntu Server installation?

Have you tried type in this in terminal:

sudo apt-get install -y --force-yes shim-generic-efi shim-generic-amd64 shime-generic

and it might work fine this way, and it might provide a question to your answer.


Can I delete "WINRE_DRV" OEM Partition if I only want to install Ubuntu and Not dual Boot?

don't pre-partion.

the installer is perfectly capable of doing this and it's made really really easy too.

way easyer than whatever you were about to do

Just run the ubuntu install process and when you reach this step select this :

this will give you the exact result you are looking for.


Fix for wireless issues with netgear a7000 usb adapter (rtl8814au, rtl8812au)

That solution didn't work for me. But after the installation of realtek 802.11ac driver netgear A7000 works fine now. (Ubuntu 20.04.1 LTS)
The steps are on this blog post
The driver is from this Kali Linux repository
Simply download the latest .deb package for the driver from there, and install using a command like this (depending on the version you download) in the same directory as the downloaded file: sudo apt install ./realtek-rtl88xxau-dkms_5.6.4.2~git20200916-0kali1_all.deb (tip: type realtek and then press tab to get the full name!).


I have developed the following guide in order to install Cadence SW in ubuntu/debian 64bits distributions:

http://vlsi.die.upm.es/?page=staticContent&staticPageName=vlsi_sw

It has been tested with ubuntu 13.10 (64bits).


sed variable expansion not working (unterminated `s' command)

It turns out that CSTRING contains a literal newline.

By enabling shell debugging we can see what sed sees:

$ set -x
$ sed "s/<ADD DEVICE CONNECTION STRING HERE>/$CSTRING/g" config.yaml
+ sed 's/<ADD DEVICE CONNECTION STRING HERE>/
HostName=PulseAzure-BetterTogetherDemo.azure-devices.net;DeviceId=ubuntu1804-ko-001;SharedAccessKey=xdWDu2gnzsfsdfdsfds=/g' config.yaml

and it's the sed 's/<ADD DEVICE CONNECTION STRING HERE>/ that is causing the

sed: -e expression #1, char 38: unterminated `s' command

error.


Have ran tasksel to remove some stuff on fresh 18.10, got "update-initramfs: failed for..." error

We need to determine which plymouth-related packages were installed

$ dpkg -l | grep plymouth
ii  libplymouth4:amd64                    0.9.3-1ubuntu10                    amd64        graphical boot animation and logger - shared libraries
ii  plymouth                              0.9.3-1ubuntu10                    amd64        boot animation, logger and I/O multiplexer
rc  plymouth-theme-ubuntu-mate-logo       18.10.1                            all          graphical boot animation and logger - ubuntu-mate-logo theme
rc  plymouth-theme-ubuntu-mate-text       18.10.1                            all          graphical boot animation and logger - ubuntu-mate-text theme
ii  plymouth-theme-ubuntu-text            0.9.3-1ubuntu10                    amd64        boot animation, logger and I/O multiplexer - ubuntu text theme

and then reinstall them:

sudo apt-get install --reinstall $(dpkg -l | grep plymouth | awk '{print $2}')

And voila, problem fixed:

$ sudo apt-get install -f
Reading package lists... Done
Building dependency tree
Reading state information... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

So this example again demonstrates that tasksel should not be used for removing packages on all modern Ubuntu versions!


The solution was in this post, at least the link to the config that was loading...
Why is /etc/mysql/my.cnf EMPTY?


Gnome Calendar and Contacts have generic Gnome application icons in the launcher

The default icon set for Gnome is contained in two packages in synaptic:

adwaita-icon-theme
adwaita-icon-theme-full

I did a normal system install and only have adwaita-icon-theme and everything looks normal to me, so try just installing or reinstalling that package.


Start Debugging Item Option Not Showing Up For Monodevelop

Well turns out that the add in Mono Soft Debugger Support was disabled, which is weird since I don't recall ever directly modifying it.


External drive: Error when getting information for file"/myfile": Structure needs cleaning. Actually an alignment issue

Folks, I have no idea why this worked, but it did. I spent my morning transferring and backing up as much of the data on the drive in question as I could, unmounted it, opened the disk editor on ubunutu, tried to repair the partition using the repair option, I received an error saying it couldn't be done, so I ran the partition check, and suddenly ... the partition was fine. In disbelief I opened the drive and folder in question and it was fine as if this whole day was just a bad dream.


USB drive not consistently recognized in Lubuntu. Why?

Your drive is faulty. If you recently purchased it, I suggest returning it to where you bought it if they will accept a return in such a case.

I've had this problem before with relatively cheap drives, though it usually happens after they have been used for some time (in heavy read/write operations or after being reformatted a number of times).

Another possible cause for this (which does not seem to be the case here) is udev, which occasionally encountered bugs with formatting USB drives in older versions of Ubuntu (and would cause this kind of error). The problem would manifest as a failed attempt to format the drive, after which it would appear that the drive was faulty. This bug has since been fixed.

*Unfortunately I don't have links to the related bug(s) at this time, but I ran into them back in 12.10 or 12.04.


Ubuntu 18.4 Try without install works 100%, but once installed it won't boot

Faced same problem. I just added 'nouveau.modset=0' in grub.
When you are in grub press 'e' and then on linux line add nouveau.modeset=0.


How can I multiboot Windows XP, Ubuntu 12.04, Windows 7 and Pardus 2011?

Whenever the going gets rough partition-wise (independent of your OS) you may want to turn to Terabyte Unlimited with its excellent products and near-immediate support. BootIt allows you to boot up to 200 (!) primary (!) partitions.

Disclaimer: I'm not affiliated etc, just a long-time happy customer of theirs. Good luck!


Need Help to troubleshoot building of custom kernel on Ubuntu 14.04

first, run

sudo make -j5

then, run

sudo make install -j5

to install it


Will ALSA 1.0.25 version have time to enter 12.04

Yes.

As for today, ALSA packages in Ubuntu Precise are in version 1.0.25, which means that it did have time to be included in Precise, and, of course, that should mean that your sound carts will be supported in Ubuntu 12.04!


ubuntu 19.10 cant install VMWare Workstation

You need to make sure you have given executable permission to the .bundle file. Go to the folder in which the .bundle file is present, run the command chmod +x VMware-Workstation-12.5.6-5528349.x86_64.bundle. Now, run the installer using ./VMware-Workstation-12.5.6-5528349.x86_64.bundle


Run scripts automatically in server after ssh connection

You can do so by adding the following parameter to your config file (/etc/ssh/sshd_config).

 ForceCommand
         Forces the execution of the command specified by ForceCommand, ignoring any command supplied by the client and ~/.ssh/rc if present.  The command is invoked by using the user's login shell
         with the -c option.  This applies to shell, command, or subsystem execution.  It is most useful inside a Match block.  The command originally supplied by the client is available in the
         SSH_ORIGINAL_COMMAND environment variable.  Specifying a command of “internal-sftp” will force the use of an in-process sftp server that requires no support files when used with
         ChrootDirectory.

An other option is to use the .ssh/rc files on a per user basis.

To use the ForceCommand method you just add ForceCommand /usr/bin/ownscript at the bottom of the file /etc/ssh/sshd_config (on the server).

The script looks like this:

#!/bin/bash
#Script file for ssh
#
#put your commands here
echo "test" > /tmp/test.txt
#
#exit by calling a shell to open for the ssh session
/bin/bash

Don't forget to chmod the script sudo chmod +x /usr/bin/ownscript


If you are using LVM and/or LUKS, then you need to:

add the discard option in your /etc/crypttab and /etc/fstab
ensure that issue_discards = 1 is set in your /etc/lvm/lvm.conf
rebuild your initramfs
then reboot

(source)


TL;DR: It's not bash, it's apt-cache that's messing around with file descriptors.

apt-cache is doing something very interesting - it tends to not write out lines starting with N: characters intended for stdout.

Consider this:

$ apt-cache show nonexistent
N: Unable to locate package nonexistent
E: No packages found

We see two lines, one starting with N: one starting with E:. N: lines go to stdout. In your example, you have two N: lines.

# apt-cache show php5
N: Can't select versions from package 'php5' as it is purely virtual
N: No packages found

If you trace the system calls via strace -e write -f bash -c 'apt-cache show randomtext >&-' you'll see that writing E: lines happens, but N lines aren't there:

[pid 12450] write(2, "E", 1E)            = 1
[pid 12450] write(2, ": ", 2: )           = 2
[pid 12450] write(2, "No packages found", 17No packages found) = 17
[pid 12450] write(2, "\n", 1
)           = 1
[pid 12450] +++ exited with 100 +++
--- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=12450, si_uid=1000, si_status=100, si_utime=5, si_stime=2} ---
+++ exited with 100 +++

So apt-cache is smart enough to check for redirected stdout. But what about stderr ? Apparently writes are still there: if you do
strace -e write,openat,dup2 -f bash -c 'apt-cache show randomtext 2>&- you'll see that apt-cache opens /dev/null to still have something present for stderr:

[pid 12543] openat(AT_FDCWD, "/dev/null", O_WRONLY|O_CREAT|O_TRUNC, 0666) = 2
....
[pid 12543] write(2, "N", 1)            = 1
[pid 12543] write(2, ": ", 2)           = 2
[pid 12543] write(2, "Unable to locate package randomt"..., 35) = 35
[pid 12543] write(2, "\n", 1)           = 1
[pid 12543] write(2, "E", 1)            = 1
[pid 12543] write(2, ": ", 2)           = 2
[pid 12543] write(2, "No packages found", 17) = 17
[pid 12543] write(2, "\n", 1)           = 1
[pid 12543] +++ exited with 100 +++
--- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=12543, si_uid=1000, si_status=100, si_utime=5, si_stime=3} ---
+++ exited with 100 +++

If you perform the same with other programs in bash, it works as expected:

# stdout closed, stderr not
$ ls -l /proc/self/fd >&-
ls: write error: Bad file descriptor
# stdout open , stderr closed, and it's number is assigned to whatever command is trying to open - in this case /proc/self/fd directory
$ ls -l /proc/self/fd 2>&-
total 0
lrwx------ 1 xie xie 64 Oct  6 11:32 0 -> /dev/pts/1
lrwx------ 1 xie xie 64 Oct  6 11:32 1 -> /dev/pts/1
lr-x------ 1 xie xie 64 Oct  6 11:32 2 -> /proc/12723/fd


Auto shutdown server if there was no activity

This will provide a list of users and idle times, one user per line.

w | tr -s " " | cut -d " " -f 1,5 | tail -n +3

Important: See the NOTES section in the man page for w. The line above produces something like this:

username1 0.00s
username2 48.08s

Then use cron to execute the script that you created to utilize the output from w.
Use whichever scripting language you prefer. Perhaps you do not care about usernames, only idle times?

w | tr -s " " | cut -d " " -f 5 | tail -n +3

Any result < 3600 seconds does not meet the one-hour idle time requirement.

  My server should shutdown after 01:00 am, if there was no activity in the past hour. Lets say there was the last connection at 00:43 then it should check again at 01:43.

Doesn't that require a dynamic modification of the cron job itself? I think I might be satisfied to run it once hourly; otherwise, I would have to run the script every minute to acquire that precision.

Here is a script in PHP that works well on Linux Mint 13. It should be fine for Ubuntu or any other Linux.

#!/usr/bin/env php
<?php
/* Shutdown Script
 *
 * If idle times exceed a defined value or if no users are logged in,
 * shutdown the computer. If running from cron there should be no "dot"
 * in the script file name. Make the script executable.
 *
 * Caveat: running the script as root in an interactive shell will cause
 * immediate shutdown, as though typing 'shutdown -P now'.
 * (It should only be run from cron.)
 */
$max_idle_time = 3600; // seconds
$cmd_idle_time = 'w|tr -s " "|cut -d " " -f 5|tail -n +3'; // idle times
$shutdown_now = true; // boolean

function shutdown() {
    exec('/sbin/shutdown -P now'); // or -h
}

// Form an array from the output of $cmd_idle_time
$idle_times = explode("\n", shell_exec($cmd_idle_time));

foreach ($idle_times as $idle_time) {
    // Are there no users logged on, or did root run this from a shell?
    if (empty($idle_time)) {
        continue;
    }

    // Remove trailing "s" from idle time and round to nearest second
    $idle_time = round(substr($idle_time, 0 , -2));

    // Cancel shutdown if any user's idle time is less than $max_idle_time
    if ($idle_time < $max_idle_time) {
        $shutdown_now = false;
    }
}

// If the $shutdown_now boolean is still true, shutdown.
if ($shutdown_now === true) {
    shutdown();
}
?>


Here it is :

Home page
Wikipedia
Source Code


It doesn't make sense to install gnome-shell on Lubuntu. Instead you should consider installing Ubuntu GNOME if your computer hardware is compatible with the Ubuntu GNOME system requirements. According to the Ubuntu GNOME wiki:

"System Requirements

It is recommended to have at least 1 GB of RAM or more (we shall soon do re-assessment for further specific details). If you have an old machine, you may consider other alternatives like Lubuntu."

If the reason why you want to install gnome-shell in Lubuntu is to have an interface customized for netbooks, you should consider installing the lxlauncher package from the default Ubuntu repositories. Lxlauncher is an add-on for the LXDE Desktop Environment on which Lubuntu is based as its default GUI. From the description of lxlauncher in the Ubuntu Software Center: "...Easy-Mode launcher for netbooks like EeePC".


Every user has a .bash_history file, present in his home directory. i.e. /home/<USERNAME>/.bash_history. It stores all the command executed by a particular user.

You can use this file to see the command executed by a user. (You need root privilege to access file of other user.)

tail -n /home/<USERNAME>/.bash_history

Don't forget to replace n with actual number.


The entries in /etc/sysctl.conf and any files included from it specify what sysctl settings will be applied at boot time, or when you run sudo sysctl -p. But the absence of an entry in this file means that such a sysctl (of which there are thousands) will not be changed from whatever value it currently holds.

You removed the sysctl entries that disabled IPv6 from this file, but it doesn't appear that you actually changed the sysctl settings themselves. Running sudo sysctl -p didn't change them, because they were not in /etc/sysctl.conf.

In order to change these entries back to their defaults, you can either reboot your system, or use sysctl to set them explicitly.  For example:

sudo sysctl net.ipv6.conf.all.disable_ipv6=0
sudo sysctl net.ipv6.conf.default.disable_ipv6=0
sudo sysctl net.ipv6.conf.lo.disable_ipv6=0


dual boot problem windows 10 Ubuntu 20.04

If you can't find Windows boot manager in the grub menu, sudo update-grub should fix it.


How to remove unattached panel in Kubuntu?

You have to unlock widgets. Right click on any free space on your desktop and choose "Unlock Widgets".
Panels are generally removed this way:

Click on hamburger button (right side of the panel you want to remove - it should be visible after unlocking widgets)
Chose "More Settings..."
"Remove Panel"

In my humble opinion - this thing on your desktop does not look like a panel - it seems to be some kind of widget. In case I am right and you are unable to remove it using the method above, try this one:

Long left click on the widget
A toolbox should appear next to the widget. You should find "X" button there.

Do not forget to lock widgets (the same way you have unlocked them). Otherwise you can unintentionally move/remove some desktop elements.

More about panels and widgets on KDE UserBase Wiki


$ dpkg -S /usr/bin/file
file: /usr/bin/file

So the package which provides the /usr/bin/file executable file is file.Install file by running,

sudo apt-get install file


How can I zoom out the lock screen on Ubuntu 18.04?

Just hover your mouse on the upper right corner of the window. You will see a down caret icon.

From this dropdown menu just turn off zoom option.


This question is actually a duplicate of Fn + F5 / F6 brightness keys not working on Asus R556L, but the most helpful answers for systems where backlight adjustment doesn't work out of the box can be found under How to increase brightness in smaller steps?

xbacklight is one option. For me acpilight works best, but it has to be set up manually, as there's no Ubuntu package AFAIK.


How do I install or get the dependency libexiv2-12

As Florian said above, you only need to install UFRaw from repository.

If you absolutely need to build and install UFRaw from source code, run:

sudo apt-get build-dep ufraw

This will get you all dependencies for building UFRaw.


Don't waste your time typing the full path. Use tab completion:

Example, type:

sudo dpkg -i ~/Dow

Press Tab (not Enter afterwards) and it will auto complete the path for you.

sudo dpkg -i ~/Downloads

Press Tab twice and a list of files will appear.

some_file
some_other_file
package_to_install

Note that if package_to_install is not there, the following won't work

Start typing the name of the file you want to install

sudo dpkg -i ~/Downloads/pack

Press Tab and it will auto complete the file name.

sudo dpkg -i ~/Downloads/package_to_install

Now you can press Enter


Installing Ubuntu 14 on an acer timeline x

To install ubuntu simply:

Insert the disk into your computer.
Restart your computer.
Press f9 (Or the key that says boot menu on the screen)
When ubuntu loads select install from the list.
Work through the guide.
When you get to the partition stage select the partition you made
Your done!

Thanks, hope this helps!


How to configure hardware volume control buttons on a Dell Inspiron 9400?

With amixer you should be able to adjust the volume with a single shell command. gnome-keybinding-properties enables you to set a custom short cut. So you can place a amixer command with appropriate paramaters for every multimedia button on your keyboard. This is kind of a work a round. I don't know if it would be possible also directly, but I don't see any advantages too.


There are a couple of different options. I think the easiest is:

dvd+rw-format -force=full /dev/sr0

I also think that is the one most commonly already installed on your system. I think there's an option in k3b to blank it for you... Oh, just found it, under tools->format/erase rewritable disk. Back in the day we would just do a dd and write zeros over the whole disk, lol. Good luck!


How to make "File" (default file manager in Ubuntu 13.04) as default file manager?

To change the default file Manager, you can follow the instructions posted on How to set PcManFm as the default file manager?

All you need do is substitute pcman to file.

Hope this helps.


What is the appropriate command line to connect through SSH?

Command is

ssh -l username server_ip_address

or

ssh username@server_ip_address

If server refuse connection maybe is some different problem.
Some firewall settings ...


apt-get ends up with errors after nvidia 331 installation

A brutally way to remove the problem is the following

edit the file /var/lib/dpkg/info/package-name.postrm; in this case
it should be  sudo gedit /var/lib/dpkg/info/nvidia-331.postrm
adds exit 0 after the line #!bin/sh and save.
run "sudo apt-get remove --purge nvidia-331". It should end without errors.
make sure to delete the previously added line from the file (so again sudo gedit /var/lib/dpkg/info/package-name.postrm, remove the line and save).
before trying anything else, run sudo apt-get update and sudo apt-get upgrade and check that it returns without errors.


There are things that could cause this, one is heat as others have mentioned, and another is the power supply. Open the side of the pc if this is a desktop, and leave it open. Start up the pc. If it stays on, heat is your issue. Try blowing it out with a blower or another less preferred option is to use the vacuum cleaner to remove dust from the heatsink on the cpu.

If this does not solve the problem replace you Power Supply. The fact that it doesn’t come on for a while after the shutdown is making me suspect static in the power supply.


Tried different headphones, problem persisted. Reinstalled the operating system, problem persisted. Switched to Fedora, problem persisted. Tried same headphones on a different computer running Fedora, and only then it went away.

The only explanation is physical defect on the hardware, probably (on-board) sound card.

Still one of the weirdest issues I have seen.


Why does compiling the "alx" driver from "compat-wireless" fail?

Note that the alx driver is available packaged now, so you may not need to install it from source. This will save you having to reinstall it each time the kernel version gets bumped.

try: apt-cache search linux-backports-modules

and then depending on your ubuntu version:

sudo apt-get install linux-backports-modules-cw-3.6-quantal-generic
sudo modprobe alx

See: How do I install drivers for the Atheros AR8161 Ethernet controller?


D-Link 2750U Wi-Fi Router Not showing in Ubuntu

Since not being able to get a proper solution from here I went on and took the risk of downloading a driver from gitub and manually installing my realtek driver.

type this in your terminal window

$ iwconfig

and found out my wifi's name. wlp13s0

https://github.com/lwfinger/rtlwifi_new/tree/rock.new_btcoex

went to this link and downloaded the zip file (clone).
put it in the desktop and change directory using commands

$ cd Desktop

and extracted the file on desktop

$ cd rtlwifi_new-rock.new_btcoex

$ make && sudo make install && sudo modprobe -rv rtl8723be && sudo modprobe -v rtl8723be ant_sel=2 && sudo ip link set wlp13s0 up

THe last command is supposed to turn n wifi so just in case it doesn't work , manually turn on the Wi-Fi

and

$ sudo iw dev wlp13s0 scan

and THere my Wi-Fi hotspot name was listed.

$ echo "options rtl8723be ant_sel=2" | sudo tee /etc/modprobe.d
/50-rtl8723be.conf

to save the current configurations into the file.

Restarted my system. and Wi-Fi is normal and working all well.

another way is to change the tx power which is risky so I skipped.

In case anyone have the same problem with realtek linux drivers, follow these steps.

Note: For installing it in kali linux you will need to have latest kali release and kernel.


Toshibia Satellite C640 automatically scrolls up or down according to its own mood

click/point at the line you're reading , sometimes it scrolls up because the automatic line scroll stays up at the very top. so they keep scrolling up back to the top

because it happens to me many times


Can't decompress data; zlib not available

I don't find a Python 2.4 package for Ubuntu, so I assume you tried to compile it from source. If so, you would have had to explicitly configure and compile it with zlib support.

I found a blog article on how to do this here:

http://www.1stbyte.com/2005/06/26/configure-and-compile-python-with-zlib/

basically install zlib1g-dev, and then configure Python with

./configure --with-zlib=/usr/include

then you can do "make" to generate the Python 2.4 binaries.


Mouse pointer invisible after reinstalling Unity on top of Gnome in Ubuntu 13.10

Well, I have been able to solve the issue. This seems to be a known problem caused by installing Gnome 3.10. The issue is mentioned here, and the fix is also given.

http://www.webupd8.org/2013/09/how-to-install-gnome-310-in-ubuntu-1310.html

The fix is hard to find on the link, to fix type in a terminal

gsettings set org.gnome.settings-daemon.plugins.cursor active false


How to prevent systemd from starting services that have RequriedBy on a particular service and/or target

"[I]sn't the RequiredBy instruction supposed to prevent services from starting if the service that has this dependency doesn't start?"
No, it's the other way around.
Your service is saying that it is requires those targets to be up and running before this service can run.
It's a list of dependencies, not a list of reverse dependencies.

EXAMPLE:
Service C requires A and B to start before C can run:
  RequiredBy=A.target,B.target

If A fails, then C won't run.


Can not boot Windows on Legacy BIOS after installing Ubuntu on UEFI

The problem is that you've mixed your installation modes -- Windows in BIOS/CSM/legacy mode and Ubuntu in EFI/UEFI mode. GRUB can't switch between these two boot modes, so you'll need to either re-install one of your OSes so that they both use the same boot mode or find some other way to switch boot modes.

For re-installing, it's likely to be easier to re-install Ubuntu, but you'll need to be sure that the Ubuntu installer is booting in BIOS mode. You can usually select the boot mode of the installer by picking the correct option from your computer's built-in boot manager. There are usually two options for external media, one of which includes the string "EFI" or "UEFI" and the other doesn't. Pick the one that lacks the "EFI"/"UEFI" string to boot in BIOS mode. (In fact, you can get away with installing the BIOS-mode version of GRUB without re-installing all of Ubuntu, but this process is more difficult to explain than just re-installing all of Ubuntu.)

If you want to keep the mixed-mode booting, I know of only two ways to do it:

You can use your firmware's built-in boot manager -- the same one you use to select which way to boot an external medium. You'll probably see an option called "ubuntu" to boot Ubuntu in EFI mode and another one that may be named after your hard disk that will boot Windows in BIOS mode. Details vary from one system to another, though, and some don't support switching boot modes at boot time.
My rEFInd boot manager can switch boot modes. Boot to Ubuntu and install the rEFInd Debian package, then edit the /boot/efi/EFI/refind/refind.conf file. Look for the scanfor line, uncomment it, and add hdbios to its list of options (leaving the existing ones intact). When you reboot, you should see an option for GRUB, at least one option for booting a Linux kernel directly, and at least one (probably two) options for booting in legacy mode. One of the legacy-mode options should boot Windows. This feature doesn't always work, but it should work on most new computers.


Screen goes dark after suspending or locking from Xfce logout menu

Apparently this was caused by the screen locker/screen saver light-locker so I 'solved' the problem by disabling the screen locker.

To disable, click on the Lubuntu menu (in the panel) then 'Preferences > Default applications for LXSession'. Thereafter go to the 'Autostart' tab, and un-check 'Screen Locker'. (Then log out and in again.)

The reason for me putting 'solved' in quotes is that this renders the 'Lock Screen' option in the Xfce logout menu useless – but now 'Suspend' will work (and 'Hibernate' too, if you have enabled that) without the screen going blank when you resume.


Crontab fails because shell path not found

If you are using crontab -e that set of Cron tasks runs as the user which crontab -e was executed as - that is, your user user.

Therefore, you should only provide the cron entry WITHOUT the user bits, i.e.:

* * * * * /usr/bin/python3 /home/user/src/code/prod.py

The user definition you were attempting to use should only be used in the system crontab in /etc/crontab and in entries in cron definitions under /etc/cron.d/.


Are there terminal commands to manipulate the current terminal window position and behaviour?

Both wmctrl and xdotool are command line tools that can act on an existing window. Appropriate commands to position the selected window, or alternatively, select the target window and position it, can be included in a script or bound to a hotkey.

For a fully automated solution, where any terminal window automatically is tiled to the right and appears on all workspaces, devilspie or devilspie2 are perfectly suited. These are small daemons that can change defined windows automatically as they are created. As such, you could automatically have a terminal window tiled to the right and be visible on all workspaces. You could also undecorate the window automatically, i.e., remove border and title bar.


For Kubuntu perhaps the easiest option is to use the gui task scheduler to run your script:

K-Button --> System Settings --> System Administration --> Task Scheduler

Select 'New Task' and then simply follow the menus through:


vscode activity titled 'Visual Studio Code - URL Handler'

sudo rm /usr/share/applications/code-url-handler.desktop worked for me.
However I did have to repeat this after updating VSCode.

Answer was borrowed from part of this answer.
Github issue is here (wherein someone actually linked to this question).


MAAS JUJU cloud-init-nonet waiting for network device

Dumb question on my part, but could you paste a copy of your /etc/network/interfaces ?
I've found out that the way in which devices are brought up in there is somewhat order dependent and has iffy behavior if say the bridge starts first and the card starts after.


NTFS

NT file system, NTFS, is designed to quickly perform standard file operations such as read, write, search,and even advanced operations such as file-system recovery on very large hard disks.

Formatting a volume with the NTFS file system results in the creation of several system files such as $MFT, Master File Table, $Bitmap, $LogFile and others.

The first information on an NTFS volume is the Partition Boot Sector ($Boot metadata file), which starts at sector 0 and can be up to 16 sectors long.

Encryption:
The Encrypting File System (EFS) provides the core file encryption technology used to store encrypted files on NTFS volumes.

Disk Quotas:
Windows 2000 supports disk quotas for NTFS volumes.

Reparse Points:
Reparse points are new file system objects in NTFS that can be applied to NTFS files or folders.

Volume Mount Points:
Volume mount points based on reparse points, volume mount points allow administrators to graft access to the root of one local volume onto the folder structure of another local volume.

Sparse Files:
Sparse files allow programs to create very large files but consume disk space only as needed.

Distributed Link Tracking:
NTFS provides a link-tracking service that maintains the integrity of shortcuts to files as well as OLE links within compound documents.

EXT4

Ext4 is the evolution of the most used Linux filesystem, Ext3. The result is a filesystem with an improved design, better performance, reliability and features.

Bigger filesystem/file sizes:
Ext4 adds 48-bit block addressing, so it will have 1 EB of maximum filesystem size and 16 TB of maximum file size. 1 EB = 1,048,576 TB.  Why 48-bit and not 64-bit? There are some limitations that would need to be fixed before making Ext4 fully 64-bit capable, which have not been addressed in Ext4. The Ext4 data structures have been designed keeping this in mind, so a future update to Ext4 will implement full 64-bit support at some point.

Sub directory scalability:
Ext4 breaks that limit and allows an unlimited number of sub directories.

Extents:
An extent is basically a bunch of contiguous physical blocks. It basically says "The data is in the next n blocks". For example, a 100 MB file can be allocated into a single extent of that size, instead of needing to create the indirect mapping for 25600 blocks (4 KB per block). Huge files are split in several extents. Extents improve the performance and also help to reduce the fragmentation, since an extent encourages continuous layouts on the disk.

Multiblock allocation
Ext4 uses a "multiblock allocator" (mballoc) which allocates many blocks in a single call, instead of a single block per call, avoiding a lot of overhead. This improves the performance, and it's particularly useful with delayed allocation and extents.

Delayed allocation:
Delayed allocation is a performance feature  and it consists in delaying the allocation of blocks as much as possible, contrary to what traditionally filesystems do: allocate the blocks as soon as possible. For example, if a process write()s, the filesystem code will allocate immediately the blocks where the data will be placed - even if the data is not being written right now to the disk and it's going to be kept in the cache for some time.

Fast fsck
Fsck is a very slow operation, especially the first step: checking all the inodes in the file system. In Ext4, at the end of each group's inode table will be stored a list of unused inodes (with a checksum, for safety), so fsck will not check those inodes. The result is that total fsck time improves from 2 to 20 times, depending on the number of used inodes.

Journal checksumming
The journal is the most used part of the disk, making the blocks that form part of it more prone to hardware failure. And recovering from a corrupted journal can lead to massive corruption. Ext4 checksums the journal data to know if the journal blocks are failing or corrupted.

Online defragmentation
While delayed allocation, extents and multiblock allocation help to reduce the fragmentation, with usage filesystems can still fragment. Ext4 will support online fragmentation, and there's a e4defrag tool which can defragment individual files or the whole filesystem.

Inode-related features:
Larger inodes, nanosecond timestamps, fast extended attributes, inodes reservation.
    Ext4 will default to 256 bytes. This is needed to accommodate some extra fields, and the remaining space of the inode will be used to store extend attributes that are small enough to fit it that space.
    Inode reservation consists in reserving several inodes when a directory is created, expecting that they will be used in the future.
    Nanoseconds timestamps means that inode fields like "modified time" will be able to use nanosecond resolution.

Persistent preallocation
This feature, available in Ext3 in the latest kernel versions, and emulated by glibc in the filesystems that don't support it, allows applications to preallocate disk space: Applications tell the filesystem to preallocate the space, and the filesystem preallocates the necessary blocks and data structures, but there's no data on it until the application really needs to write the data in the future.

Barriers on by default:
This is an option that improves the integrity of the filesystem at the cost of some performance (you can disable it with "mount -o barrier=0", recommended trying it if you're benchmarking).

NTFS Source

EXT4 Source


lvmcache failed to boot: "device-mapper: cache-policy: unknown policy type"

This is probably late as an answer, but I did the things in your post (but with a ubuntu 16.04.1 installation), and it worked with the smq-policy. It seems the issue you had has been resolved.

This is what I did, command by command.

First, I had a big harddisk on /dev/sda and an SSD on /dev/sdb.

I formatted the /dev/sda to have 10MB free in the beginning, then followed by a 1GB ext4 primary partition, which will be used for /boot in the installation (you cannot cache the kernel, so kernels can go in there). The rest of /dev/sda is cleared as sda2.

sudo pvcreate /dev/sda2
sudo pvcreate /dev/sdb
sudo vgcreate VG /dev/sda2 /dev/sdb
sudo lvcreate -L 3.5T -n lv VG /dev/sda2
sudo lvcreate -L 450G -n lv_cache VG /dev/sdb
sudo lvcreate -L 4.5G -n lv_cache_meta VG /dev/sdb
sudo lvconvert --type cache-pool --cachemode writeback --poolmetadata VG/lv_cache_meta VG/lv_cache
sudo lvs -a
sudo lvconvert --type cache --cachepool VG/lv_cache VG/lv
sudo lvs -a
sudo lvdisplay
sudo mkfs.ext4 /dev/VG/lv

On this point, I install ubuntu on the /dev/VG/lv partion as /, with /boot on /dev/sda1.

After installation, the kernel of this new installation needs to be recompiled with some modifications (in case of ubuntu 16.04.1)

#### mount existing installation
sudo chmod 777 /var/cache/app-info/xapian/default -R
sudo add-apt-repository universe
sudo apt-get update
sudo apt-get install thin-provisioning-tools
sudo vgchange -a y VG
sudo mkdir /new
sudo nano /etc/fstab
###add this line to fstab: /dev/VG/lv /new ext4 defaults 0 0
sudo mount /dev/VG/lv

### We will need to install some new packages in the chroot, so fix internet
sudo mount --bind /dev /new/dev
sudo mount --bind /proc /new/proc
sudo mount --bind /sys /new/sys
sudo cp /etc/resolv.conf /new/etc/resolv.conf
sudo chroot /new
echo 'nameserver 8.8.4.4' | sudo tee -a /etc/resolv.conf
sudo add-apt-repository universe
sudo apt-get update
sudo apt-get install thin-provisioning-tools

#### recompile kernel with additional hook for dm_cache_smq
echo "dm_cache" >> /etc/initramfs-tools/modules
echo "dm_cache_mq"  >> /etc/initramfs-tools/modules
echo "dm_cache_smq"  >> /etc/initramfs-tools/modules
echo "dm_persistent_data"  >> /etc/initramfs-tools/modules
echo "dm_bufio"  >> /etc/initramfs-tools/modules

nano /etc/initramfs-tools/hooks/cache_hook

contents from here: http://forums.debian.net/viewtopic.php?f=5&t=119644
The last line has been modified for the smq to work

#!/bin/sh

PREREQ="lvm2"

prereqs()
{
    echo "$PREREQ"
}

case $1 in
prereqs)
    prereqs
    exit 0
    ;;
esac

if [ ! -x /usr/sbin/cache_check ]; then
    exit 0
fi

. /usr/share/initramfs-tools/hook-functions

copy_exec /usr/sbin/cache_check

manual_add_modules dm_cache dm_cache_mq dm_cache_smq dm_persistent_data dm_bufio

Then we continue with the following to compile the kernel and put it in the correct spot.

chmod +x /etc/initramfs-tools/hooks/cache_hook
mkdir /realboot
mount /dev/sda1 /realboot
update-initramfs -v -u -k all -b /realboot

Now reboot, and it worked. I tried this on 2 machines already, more to follow.


todo list and memory usage applet on desktop?

todo.txt with Conky is my favorite setup. Command line todo list hotness, displayed on your desktop!


Can't upgrade to Ubuntu 18.04: Failed to fetch http://np.archive.ubuntu.com/ubuntu/dists/bionic/universe/dep11/icons-64x64.tar.gz

you need to remove all the content of /var/lib/apt/lists directory:.
try with combination of these two commands:

sudo rm -rf /var/lib/apt/lists/*

and then

sudo apt-get update

this should work.


getting Netgear WNDA3100 USB adapter working on Ubuntu 15.10

I was finally able to get wireless working by reading and rereading posts at this site: http://ubuntuforums.org/archive/index.php/t-1964173.html as chili555 worked with another user. I think by removing and reinserting the USB transceiver allowed it to make the connection. On reboot, I did have to reinsert the USB device once again to get a connection.
Thanks for all that responded.
Robbo

note: Since that first reboot, the wlan connects automatically on each subsequent reboot.


How can I view the contents of tar.gz file without extracting from the command-line?

Run the below command in the terminal to see the contents of a tar.gz file without extracting it:
tar -tf filename.tar.gz

-t, --list
List the contents of an archive.  Arguments are optional.  When given, they specify the names of the members to list.

-f, --file=ARCHIVE
Use archive file or device ARCHIVE...


How do I uninstall discord on ubuntu 16.04

The .deb install on discord's website installs a package named "discord"
try running

sudo apt-get remove discord

in your terminal. Then reinstall it the same way you installed it in the first place. I don't know if this will work if you installed it a diffirent way.

Edit: I also previously got the discord message to update this afternoon,  and ran the command and used this file to update discord: Discord .deb install from discordapp.com


Can't stream any online videos on Ubuntu 18.04

I have a fix for not being able to run HBO GO on ubuntu 18.04: you have to download the CHROME browser. Not Chromium, but the Linux version for Chrome!
I found a tutorial on linuxize how to donwload it. You will need to use Terminal, but it is a sure fix.
So, hobgo will only stream from the official Chrome browser on ubuntu 18.04

For Netflix, you have to use FIrefox and download the libavcodec pack, also using Terminal. Also, a tutorial for this is available online.
It is my first day on ubuntu 18.04 and I find it annoying that I have to use Terminal so much for so many things. However, I find this OS generally much faster and stable than any WIndows.
Thanks to the Linux community online, most issues are easily solved and there are command lines for almost everything!


wifi does not work in ubuntu 13.10 and broadcom bcm4313 hardware

I found a fix for this. Install the patch from here..

http://www.mindwerks.net/2013/10/wireless-bcm4312-with-the-3-10-and-3-11-kernels/


What's the difference between "cd ../" vs. "cd /.."?

A / at the end of the name of a directory/folder is optional. Most of the time, including or omitting the final slash in a directory name does not change the effect of a command.

So cd ../ is equivalent to cd ...

Paths that don't start with a / are relative paths; they are resolved relative to the current directory.

Every directory has two special entries:

a directory entry called . that resolves to the directory itself
a directory entry called .. that resolves to the directory's parent (i.e., the directory that contains that directory)

Therefore cd ../ and cd .. change directory to the parent of the current directory. Thus, if you start out in /home/fazlan and run cd .. or cd ../, you'll end up in /home.

In contrast, /.. is an absolute path (albeit an unusual one). / is the filesystem root--the directory you get to if you go up in the directory hierarchy all the way. (Using the same parent and child metaphor, we say / is the ancestor of everything in the filesystem.)

Since .. means "the parent directory of this directory" and / means "the top of the filesystem," /.. means "the parent directory of the top of the filesystem."

But what does it mean to talk about the directory that contains /? Well, / is an exception. Since no directory contains it, we say that /'s parent is itself. Therefore, in /, .. is /. Consequently, /.. is the same as /.

This is why cd ../ brings you up one directory from where you started, while cd /.. brings you to the very top. More elegant and easily read ways to do these things are cd .. and cd /, respectively.


program installation permission denied chimera

Your script needs executable permissions. To do so type the following:

cd ~/Downloads && chmod a+x chimera-1.10.2-linux_x86_64.bin

Then to run it type:

./chimera-1.10.2-linux_x86_64.bin


Ubuntu 16 Gnome Not detecting Ethernet cable connection

I have dicovered the source of the problem after trying a couple of alternatives and all failed. The port was disabled/locked from the BIOS, I was trying to load modules, drivers, firmwares and stuffs but with not success. Hopefully someone will find this answer useful.

TLDR : Enable the ethernet port in BIOS settings solved the problem.


Ok, update.

Have something working using lightdm-gtk-greeter instead of unity-greeter (which hung at login).  Thanks to the poster for mentioning he got it to work with lightdm-gtk-greeter or I probably would not have tried another.  Here are the steps I used to get the multi-monitor control login-screen fully working -- even though it's not working with unity-greeter, this is at least some form of a solution for now:

sudo apt-get install lightdm-gtk-greeter

Also make sure arandr is installed:

sudo apt-get install arandr

Configure your monitors how you like them for your layout using the Displays settings under System Settings

Back in a shell, load up arandr:

arandr

A user interface will load with a graphical representation of your current monitor layout displayed.  From the arandr Ui menu, Layout choose  Save As and save monitor layout, it will save a shell script that you can use in your lightdm.conf file.  It defaults to save the layout shell script in .screenlayout directory in your home folder.  I just kept it there so it's easier to update later if I switch monitors around more. Specifically I saved it to a file named: ~/.screenlayout/monitors.sh

Finally, last step, go to a shell and save a new lightdm.conf:

sudo gedit /etc/lightdm/lightdm.conf

If your system is like mine, you won't have a lightdm conf file yet so gedit will be blank, that's fine, copy in the following settings (editing the path with the place you saved the monitor layout file from the arandr in the previous step):

[SeatDefaults]

greeter-setup-script=/home/username/.screenlayout/monitors.sh

More information about config settings and hooking up callback scripts to run before and after events around LightDM can be found here:

https://wiki.ubuntu.com/LightDM#Adding_System_Hooks

Ok, if anyone is reading this and having the same issue, at least this worked for me when several other attempts using other config parameters and methods slightly similar failed.

Good luck, and if anyone has a solution that works with Unity-Greeter that would still be really great.

It would also still be great to find out the answer to the original question: Where does Unity/Unity-Greeter Load X Configuration From?


This seems to work:

ip link set br-3e7279f0a872 down
brctl delbr br-3e7279f0a872


Failed to restart isc-dhcp-server.service: Unit isc-dhcp-server.service is masked

You cannot start the isc-dhcp-server beacuse the systemctl marked it as 'masked'. Masked is an advanced 'flag' similar of 'disabled'. Masking a service is a permanent change, much like disabling a service.

Look at systemctl list-units


Trying to install Ubuntu Server as RAID 1, leads to "ValueError: Failed to find storage volume"

This is somewhat solved?
My "solution" was to only create a partition at / that was 10GB instead of 1.86TB and that somehow let the installer make it all the way through (did the operation time out before? Had the drive become overworked and just quit? I'm unsure) I plan on expanding the storage now while I'm booted into the machine.
At the same time I also did this so unsure if it's part of the solution but sharing just in case: While booting the Ubuntu server installer, in the grub boot menu, I chose "Boot and Install with the HWE kernel".

I hope that helps anyone who runs into the same issue.


Please get a temporary internet connection by ethernet, tethered or wahtever means possible, open a terminal and do:

sudo apt-get update
sudo apt-get install bcmwl-kernel-source

Reboot and your wireless should be working.


ListItem.Subtitled id not defined error in Qt SDK

First of all: please allways show complete code examples. There is so much guessing involved in answering your question as it is now...

I GUESS that you want to access the items in the listview by there id. In your special case there seems to be only one item (because you wrote model: 1, but in general, there are N elements.
Based on your logic, they would all have the same id, because all are based on the same delegate. This however is not possible and the id of the delegate can only be used in the item itself.

Since you only have one item, why do you have the ListView at all? Why not simply use the ListItem.Subtitled itself? Then you can use the id as you indent to use it.


The following worked on my system:

sudo apt-get install snapd
sudo snap install notes

I needed to log out and then back in for Dash to find 'Notes':

Note: There is currently some confusion with another Xenial package called snap which gives: 'location of genes from DNA sequence with hidden markov model'. If you get dpkg errors to do with this package when installing snapd (in particular overwriting of commonly named man pages) run the following:

sudo apt-get purge snap

And then you should be right to go :)

The application 'Notes' was perhaps a little underwhelming, other packages look a little more promising:

andrew@athens:~$ snap find
Name                   Version                  Summary
audovia                3.2.2                    Database application for making music using JFugue MusicStrings
beagleblack            3.1                      OEM Beagle Bone Black
canonical-dragon       0.7.1                    The gadget snap for the dragonboard
canonical-i386         3.1.i386                 The gadget snap for generic i386 systems
canonical-pc           3.2                      AMD64 generic package
canonical-pc-linux     4.4.0-18+20160419.13-26  The ubuntu-core kernel snap
canonical-pi2          3.2                      Raspberry Pi 2 support package
go-example-webserver   16.04-4                  Minimal Golang webserver for snappy
hello-world            6.0                      Hello world example
http                   4.6692016                HTTPie in a snap
john-the-ripper        1.8.0-11765-g9a09113     John the Ripper Jumbo password cracker for Linux
links                  2.12-1                   Web browser running in text mode
moon-buggy             1.0.51.9                 Drive a car across the moon
morse-converter-py     1-2                      Simple command-line Morse converter
nmap                   7.12SVN-0.4              Nmap ("Network Mapper") is a free and open source utility for network discovery and security auditing
notes                  0.0.8~snap3.gita80fd1c   Note-taking application, write down your thoughts
shout                  0.53.0                   A self hosted web IRC client
sshtron                1.0                      multiplayer Tron via ssh
tmux                   2.3bump1                 tmux
tor-middle-relay       0.2.7.6-6                Essential infrastructure node for Tor network
ubuntu-calculator-app  2.1+snap3                Ubuntu Calculator application for the Unity 7 desktop
ubuntu-clock-app       3.6+snap3                Ubuntu Clock application for the Unity 7 desktop
ubuntu-core            16.04+20160419.20-55     The ubuntu-core OS snap
xkcd-webserver         16.04-5                  Show random XKCD compic via a build-in webserver
yacas                  1.4.2                    Yet Another Computer Algebra System

Interesting times ahead...


recordMyDesktop on Ubuntu Studio audio "DEFAULT"?

It seems like you didn't launch Jack.  You should launch it in order to use jack based applications.  There should be a launcher for QJackCTL (Q Jack Control) in your Audio production submenu.

What is Jack?  You can google "jack ubuntu studio" and get many results, as
https://help.ubuntu.com/community/UbuntuStudioPreparation where it states:
"Pulse Audio, the default sound server in Ubuntu, is not designed to work at low latency. You can connect Pulse Audio to Jack, which has been designed for this purpose." (...)
"Jack is a real-time sound server, aimed for very low latency settings with your sound card. You can use it with the integrated sound card of any computer." (...) "Some applications need Jackd to run, some don't."

Hope this helps!


Desktop shortcut to create a new desktop shortcut doesn't do anything

To create Desktop shortcuts in Ubuntu,gnome-panel package is required first.

Open Terminal. To open terminal click the Dash home from Unity launcher. And type terminal in the search field. And click Terminal.
Type the below code in terminal and hit enter.

sudo apt-get install --no-install-recommends gnome-panel

Then type below code in terminal and hit enter

gnome-desktop-item-edit ~/Desktop/ --create-new

The create launcher window will pop-up,Type application name in the name field and type application name or path or browse in the command field. And click OK button.

Example: CinePaint
Now check your desktop for the shortcut.

If you want your shortcut to appear in the Unity launcher panel (the pop-out one on the left), you can drag it there from the desktop.


prevent Ubuntu from getting slow without reboot

Yes, that would be annoying to re-open many terminals. I suggest you install the CPU Frequency Scaling Indicator
(An indicator for monitoring and switching CPU frequency scaling) using the command:

sudo apt-get install indicator-cpufreq

Once installed (and after you reboot), the app icon should appear in the status bar. You may also make sure that the app is in the list of the startup applications (usually by default). Then you would be able to switch to the

  performance mode

to prevent your system from going into the so called power-save mode and to stay on the performance mode.


If the question is How to copy text from one vim window (in one tmux pane) to another vim window (in another tmux pane) then It's a matter of vim-clipboard.

In that case, on your terminal type vim --version | grep clipboard then if output has something like this

+clipboard       +job             +path_extra      +user_commands
+eval            +mouse_dec       +statusline      +xterm_clipboard

Notice the +clipboard means, your vim has clipboard capabilities.

And you can simply copy code by doing this,

Visual Mode

Visually select the text you need to copy.
On your keyboard type "+yy to "yank" text.

Normal Mode

By using numbers you can say 12"+y
Or you can say "+yy to yank the current line.

Pasting

After you have copied text from one vim window, you can then navigate to the second one and go to INSERT mode then type Ctrl r + Control + r + plus sign which pastes text from vim :REG Type that and see everything stored in them which you can actually replace the plus sign in that code.

If however you have something like -clipboard this means you don't have clipboard capabilities in your vim.

Easiest way is to install vim-nox which has lots of capabilities including clipboard. Or install gvim which will add your terminal vim those capabilities.

While pasting it's important to :set paste before pasting and then :set nopaste after pasting to reserve some formatting from the clipboard text into vim.

Regarding copying with tmux

Well, tmux will treat the whole of your vim as a board and it will just copy everything even the status bar the correct way to copy stuffs from vim is using vim's clipboard capabilities and the correct way to copy stuffs from your terminal is using tmux & xclip.

Here is more about vim clipboard


Missing System Settings after removing some packages

You may have accidentally removed some packages (or some dependencies which caused the package to uninstall). In any case, you may try installing (or re installing) the package ubuntu-desktop. Correct any accidental package uninstallation by:

sudo apt-get install ubuntu-desktop


Turns out it's pretty simple; just need to add a .desktop file in the directory:

/usr/share/gdm/autostart/LoginWindow/

A quick way to do this is to copy the nm-applet.desktop file from /etc/xdg/autostart:

cp /etc/xdg/autostart/nm-applet.desktop /usr/share/gdm/autostart/LoginWindow/


Control the available locations in save-as dialog

Well that's embarrassing... The additional directory is the application's CWD (working directory).

Future people who stumble on to this question, additional avenues suggested by @pomsky are ~/.config/user-dirs.dirs and ~/.config/gtk-3.0.


How to add different wallpapers in different workspaces but as shellscript?

Set your environment using the excellent linked Q&A

Install compiz: sudo apt-get install compiz-fusion-plugins-extra
Remove your desktop icons: gconftool-2 --set "/apps/nautilus/preferences/show_desktop" --type=boolean "true"

Your wallpapers are defined in the key:

gconftool-2 --get "/apps/compiz/plugins/wallpaper/screen0/options/bg_image"

It takes a comma separated list thus you can set the value using this as an example:

gconftool-2 --set "/apps/compiz/plugins/wallpaper/screen0/options/bg_image" --type=string "[/usr/share/backgrounds/BosqueTK.jpg,/usr/share/backgrounds/BusquedaNocturna.jpg]"

Linked Question:

Workspace specific wallpapers with Compiz?


press CTRl+ALt+F1 to switch to a terminal and try to remove.. using commands ..

"The following commands will cleanly uninstall and remove package-related database entries from the system database. No additional commands are needed."

sudo dpkg --purge mfecma

sudo dpkg --purge mfert

** if you still receive the error, you may use --force-all

Eg

 sudo dpkg --purge --force-all mfecma

"If the folders still exist, the following commands can be executed to remove agent-specific folders:"

sudo rm –rf /opt/McAfee/cma

sudo rm – rf /etc/cma.d

Then switch back to your desktop with CTRl+ALt+F7

Removal commands source https://community.mcafee.com/thread/73281


Can't apply partition table on pen drive and create partition

You might try zeroing out the drive as mentioned in the comments by running...

# dd count=1 bs=512 if=/dev/zero of=/dev/sdx && sync

... where sdx is the drive you're wanting to format.

BE VERY CAREFUL TO ENSURE THAT YOU ARE DOING THIS AGAINST THE RIGHT DRIVE!

Then create a new partition table...

# cfdisk /dev/sdx
# mkfs.ext4 /dev/sdx1
# e2label /dev/sdx1 USB_STICK

This combined with running gparted with...

gksudo gparted

...worked for me. I had a USB stick that I dd'd an iso on to ot use for booting then had trouble recovering it. These were the steps I took and it as usable again.


"You are trying to save the file on a read-only disk" when trying to save a file in my home directory

I restarted my laptop and when it booted I got a command interface instead of the GUI login screen.

I researched a little and ran fsck /dev/sda2. I had to fix the error by answering yes.

When I booted the system normally and tried saving it worked, so the problem is solved.


for encrypting file system in Linux you can use a tool called eCryptfs.

more information for about how to use this tool can be found here and the tool official documentation.read them carefully.


Minimum system requirements for ubuntu 18.04

If you're going to run Ubuntu Server 18.04 this should be enough for a "staging server", depends on the purpose of the installation though. If you were about to go for a Ubuntu 18.04 desktop I'd say you're not going to have a nice experience, but of course, it will boot :)


Open a terminal (ctrl+alt+t):

sudo apt-get install openjdk-8*

This will install the folowing packages:

openjdk-8-jre-dcevm - Alternative VM for OpenJDK 8 with enhanced class redefinition
openjdk-8-jre-zero - Alternative JVM for OpenJDK, using Zero/Shark
openjdk-8-dbg - Java runtime based on OpenJDK (debugging symbols)
openjdk-8-demo - Java runtime based on OpenJDK (demos and examples)
openjdk-8-doc - OpenJDK Development Kit (JDK) documentation
openjdk-8-jdk - OpenJDK Development Kit (JDK)
openjdk-8-jdk-headless - OpenJDK Development Kit (JDK) (headless)
openjdk-8-jre - OpenJDK Java runtime, using Hotspot JIT
openjdk-8-jre-headless - OpenJDK Java runtime, using Hotspot JIT (headless)
openjdk-8-jre-jamvm - Alternative JVM for OpenJDK, using JamVM
openjdk-8-source - OpenJDK Development Kit (JDK) source files

Now to maven:

sudo apt-get install maven maven*

This will install the folowing packages:

maven - Java software project management and comprehension tool
maven-ant-helper - helper scripts for building Maven components with ant
maven-debian-helper - Helper tools for building Debian packages with Maven
maven-repo-helper - Helper tools for including Maven metadata in Debian packages


If we made a mistake in crontab entry what will happen then

First note that, each cron job is run in a shell (sh i.e. dash by default, changeable via the SHELL environment variable inside crontab). Two cases:

MAILTO environment variable is set: A mail will be sent to the mentioned address(es) with the error (STDERR) (and also STDOUT, if any), as if you were run it in the (used) shell
MAILTO environment variable is null: Nothing, the error message will be thrown away as no consumer available
MAILTO environment variable is unset: The STDERR (and STDOUT if any) will be sent to the local user's mailbox

In all cases, /var/log/syslog will have the relevant error message.

Note that people often use shell redirections to save the STDOUT/STDERR in a file e.g.:

* * * * * your_command >/tmp/cron_msg 2>&1

Or if MAILTO is set, not to have the STDOUT/STDERR in mail as teh primary intention is to run the command, if so it is a common trend to send to /dev/null too:

* * * * * your_command >/dev/null 2>&1


Byobu: Keybindings only respond in first tab; not responsive in new tabs or windows

Maybe this will help someone...because it helped me... and I seem to have missed the fact that this behavior may be disabled by default.

From the Byobu Ubuntu Community Wiki:

  Enable/Disable Byobu can be configured to run by default at every text login (SSH or TTY). That behavior can be toggled with the
  byobu-enable and byobu-disable commands.

byobu-enable

  and

byobu-disable

SO, I just needed to run byobu-enable to let my xfce terminal know that I want byobu in all tabs and windows opened. ...and the inner-child rejoices.


/usr/bin/java is actually a symlink to /etc/alternatives/java, which is itself a symlink to the actual java binary.  The update-alternatives script changes where /etc/alternatives/java is linked to.  By running update-alternatives, /usr/bin/java will end up symlinked to /usr/bin/jvm/java-6-oracle/bin/java.

The reason which java returns /usr/bin/java is that /usr/bin is on your PATH before /usr/bin/jvm/java-6-oracle/bin.  If you run which -a java, it should show you both /usr/bin/java and /usr/bin/jvm/java-6-oracle/bin/java.


Thunderbird addon to send one email to multiple recipients?

Mail Merge for Thunderbird works great, unless you've updated to Thunderbird 11.0. The 'Personalize' function uses a contact list (address book) you create, ie 'Salesmen'. The message you type is sent as an individual email for each person on that list.

Worked great until Thunderbird updated to 11.0. BTW- it's considered 'deadware' now. Too bad.


You need to have root access to scp to that directory. So you can try

scp /local/file/path root@192.168.1.xxx /media/more/path

If that does not work you would have to scp to somewhere in the home directory and then move it to the /media directory. You could also do this through ssh if you know the root password.

scp /local/file/path user@192.168.1.xxx:/home/user/some/path
ssh user@192.168.1.xxx
sudo mv /some/path/file /media/

You can also use a script to move the file to /media directory when you scp a file to the remote machine. You can use the following script.

#!/bin/bash

while true
do
    sleep 10
    contents=$(ls -A /home/user/directory)
    if [ $contents ]
    then
        sudo mv /home/user/directory/* /media/
    fi
done

I would recommend you to have an empty directory into which you can copy the files to. The script will move the contents of the directory to /media/ every 10 seconds. You can use different numbers after sleep depending on the frequency you want the script to run. You will still have to enter the password to move the files however, If you do not want to enter the password, see this answer.

Note: If the number is too small, It may affect your computers performance depending on the hardware


Yet another "Computer won't boot from Ubuntu Install Media" question

I would suggest disconnecting all non essential hardware. I once had a problem where I couldn't get an OS to install on a computer (The installation process would crash) just because it didn't like my card reader being connected during the install process. Alternatively you could always try putting your hard drive into another computer (since you mentioned having others), install ubuntu, and then put the hard drive back.


You can install spotify with the following commands:

sudo apt-add-repository -y "deb http://repository.spotify.com stable non-free"
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 94558F59
sudo apt-get update
sudo apt-get install spotify-client


Follow these steps:

Install the TiMidity++ midi sequencer (apt://timidity-interfaces-extra).
Make sure you have tuxguitar-alsa (apt://tuxguitar-alsa), tuxguitar-oss (apt://tuxguitar-oss), and tuxguitar-jsa (apt://tuxguitar-jsa) installed.
Launch TuxGuitar, open Tools/Settings/Sound, and under Midi Port choose Gervill or TiMidity Port [x] (128:[x]) (where x is a number in the range of the available midi ports - usually 0..3).

You're good to go!


If the package is installed through the package management system, you can show its files with the command

dpkg -L package-name


s shows the size in blocks.
r shows it in reverse order.

So this ...

  Both Are Giving Same(nearly the same) output.

I doubt is a true assessment.

Example:

rinzwind@schijfwereld:~$ ls -l
total 1964
lrwxrwxrwx 1 rinzwind rinzwind      19 mrt 13 20:39 Desktop -> /discworld/Desktop/
lrwxrwxrwx 1 rinzwind rinzwind      21 mrt 13 20:43 Documents -> /discworld/Documents/
lrwxrwxrwx 1 rinzwind rinzwind      21 mrt 13 20:42 Downloads -> /discworld/Downloads/
-rw-rw-r-- 1 rinzwind rinzwind 1966690 mei  1 21:51 Firefox_wallpaper.png
-rw-rw-r-- 1 rinzwind rinzwind   35928 jul 29 15:06 mozilla.pdf
lrwxrwxrwx 1 rinzwind rinzwind      20 mrt 13 20:42 Pictures -> /discworld/Pictures/
drwxrwxr-x 3 rinzwind rinzwind    4096 apr 27 11:28 VirtualBox VMs

rinzwind@schijfwereld:~$ ls -lsr
total 1964
   4 drwxrwxr-x 3 rinzwind rinzwind    4096 apr 27 11:28 VirtualBox VMs
   0 lrwxrwxrwx 1 rinzwind rinzwind      20 mrt 13 20:42 Pictures -> /discworld/Pictures/
  36 -rw-rw-r-- 1 rinzwind rinzwind   35928 jul 29 15:06 mozilla.pdf
1924 -rw-rw-r-- 1 rinzwind rinzwind 1966690 mei  1 21:51 Firefox_wallpaper.png
   0 lrwxrwxrwx 1 rinzwind rinzwind      21 mrt 13 20:42 Downloads -> /discworld/Downloads/
   0 lrwxrwxrwx 1 rinzwind rinzwind      21 mrt 13 20:43 Documents -> /discworld/Documents/
   0 lrwxrwxrwx 1 rinzwind rinzwind      19 mrt 13 20:39 Desktop -> /discworld/Desktop/

I see 2 distinct differences here: the ordering and the 1st column.


Check libc-dev-bin package.

Found with :

$ apt-file search sprof | grep '/usr/bin/sprof'

so :

$ sudo apt-get update; sudo apt-get install libc-dev-bin


True Type Fonts isn't being loaded any more. It seems to be an issue with the End User Agreement

Sudo apt-get clean actually deletes the package cache. So, you won't be able to reinstall it. You have to use synaptic package manager or apt-get install to install it again.


If I install a python package with `apt-get`, can I upgrade it later with `pip`?

sudo apt-get install python-django installs django in /usr/lib/python2.7/dist-packages while sudo pip install -U django installs django in /usr/local/lib/python2.7/dist-packages. This means you cannot upgrade Django installed by APT using pip and vice versa.

The latest version of django is unlikely to be provided by the official Ubuntu repositories. Therefore, I would suggest you uninstall the django that is installed using apt-get and then either use pip install --user django to install django locally or use virtual environments such as virtualenv to manage your Python dependencies. I would discourage you from using sudo pip install django because it is a security risk to use sudo to install arbitrary Python packages from PyPI which does not check for malicious packages; you can read more about this from an answer I wrote regarding this issue.


How to enable the "Other User" login in ubuntu 12.04 if the userid I want to use isn't listed on the login screen?

Add greeter-show-manual-login=true to file /etc/lightdm/lightdm.conf. For example:

[SeatDefaults]
greeter-session=unity-greeter
user-session=ubuntu
greeter-show-manual-login=true


I would remove the second entry for Windows.  That seems to be the default entry, but the first one seems to be a custom overwrite.  Just delete the second Windows Bootloader entry and give it a shot.


Squid Access Log for Particular IP at a particular time

I have got the answer.
cat /home/deployer/Downloads/squid_access_log_2_july_2016_13_00-13_59.log | awk '$4 >= "[02/Jul/2016:13:40:00" && $4 < "[02/Jul/2016:13:40:54"'| grep 192.168.1.158

It worked for Me.

Hope it will be useful for others.


Transferring Python code from Sublime Text to Visual Studio code

It's hard to answer your question without knowing the details (e.g. which third-party packages do you use, which default indentation settings). You didn't even mention how the indentation differs across editors.

However, I generally recommend using EditorConfig, which lets you define indentation rules (among others) for a project. About every major editor supports EditorConfig through plugins (including Sublime Text and Visual Studio Code). It's especially useful for teams that use a variety of different editors.

For Python, the Django .editorconfig file is a good starting point. Place it in the root of your project and now all editors with EditorConfig support will respect those rules.


How can I check what ports an app is using so I can enable them in ufw?

It seems like you are asking what ports are open on your computer. You can tell this with the nmap and ifconfig commands.

Install nmap with:

sudo apt-get install nmap

Run ifconfig and find the network interface your using (ethernet usually uses eth0 and wifi uses wlan0). Look for the inet address. This is your local address.

Now scan your computer for open ports with nmap:

sudo nmap -p 1-65535 <address>

Where <address> is the inet address you found earlier. This will scan your computer and tell you what daemons/services are listening on what ports. Your program should be there.

You'll need to allow this port through ufw with:

sudo ufw allow proto tcp from any to any port <port>

Or just:

sudo ufw allow <port>/tcp

Where <port> is the port we just found.


Virtual Terminals messed up with proprietary NVidia graphics driver

In your Grub2 options, remove vga=somenumber and add xforcevesa. In 10.10, there is a different option - nomodeset.


Network Manager ignores NICs mentioned in /etc/network/interfaces by default. So don't add anything about the other NICs in that file. From man NetworkManager.conf:

[ifupdown]
   This section contains ifupdown-specific options and thus only has effect
   when using ifupdown plugin.

   managed=false | true
          Controls  whether  interfaces  listed in the 'interfaces' file are
          managed by NetworkManager.  If set to true, then interfaces listed in
          /etc/network/interfaces are managed by NetworkManager.  If set to
          false, then any interface listed in /etc/network/interfaces will be
          ignored by NetworkManager. Remember that NetworkManager controls the
          default route, so because the interface is ignored, NetworkManager may
          assign the  default  route to some other interface. When the option is
          missing, false value is taken as default.


Couldn't access ubuntu, used boot repair, cant access windows 7!

I just ran boot repair again, this time on the real ubuntu and that fixed my problem. Nothing special, just on the same auto repair settings.


How to install Grub in an external hard drive?

This is how I installed grub unto my external hard drive (GPT) which had Ubuntu 17.04 installed. When you do this it allows you to boot your Ubuntu on any PC which supports UEFI by using the grub on the external without relying on the PC grub. It can also serve as backup grub in case the is problem with EFI of Windows.
Installing Grub to an external hard drive that has Ubuntu installed

Boot into an Ubuntu live USB and connect the external hard drive.

List partitions of all devices:
 lsblk

From the results of lsblk, identify the linux partition and also the efi partition of the external hard drive,
i.e. /dev/sdXY1 and /dev/sdXY2 respectively. Replace XY1 and XY2 with your own partition names.

Special mount the linux partition:
  sudo mount /dev/sdXY1 /mnt

Mount critical virtual filesystems:
 for i in /dev /dev/pts /proc /sys /run; do sudo mount -B $i /mnt$i; done

chroot into the Linux partition you mounted:
 sudo chroot /mnt

You are now in the external hard drive's linux filesystem.

Create the directory where grub would install its files:
 mkdir -p /boot/efi

If it already exists, then skip to step 8.

Mount the efi partition from step 3:
 mount /dev/sdXY2 /boot/efi

Install grub to the external hard drive:
 grub-install /dev/sdX

Update grub:
update-grub

Find the UUID of the efi partition (aka 'vfat') and note it down:
blkid

or
ls -l /dev/disk/by-uuid

Now we need to tell fstab to mount that efi partition on boot:
cp /etc/fstab /etc/fstab.bak
sudo nano /etc/fstab

Add the below two lines to fstab replacing xxxx-xxxx with the UUID from step 11:
#my modified fstab to mount external hard drive's esp
UUID=xxxx-xxxx   /boot/efi   vfat   umask=0077   0   1

Make sure to comment out the fstab entry of the Windows esp so it doesn't conflict.

Exit the chroot:
exit

Reboot the PC:
sudo reboot

At this point when you reboot and choose your external device from the EFI boot manager, it will boot to grub.
To make Ubuntu automatically boot when you insert the external and Windows to automatically boot when the external is not inserted you would have to create a custom boot entry for Ubuntu to point to the efi on the external drive:
Creating a custom boot entry for Ubuntu to point to efi on the external HD
From Windows EasyUEFI can add or remove boot entries.
From Linux efibootmgr can add or remove boot entries.
Alternative #1 – using EasyUEFI

In Windows download EasyUEFI, install it and run.

Choose the EFI options manager

Choose create 'new entry' with + sign

Choose Linux or other OS and give it a name in the description box

Select the FAT32 EFI partition on the external drive that contains the grub bootloader

Choose browse

Navigate to /efi/ubuntu/shimx64.efi or /efi/ubuntu/grubx64

Save

Move it to the top of the boot entries list

Restart

Alternative #2 – using efibootmgr

List boot menu entries:
 efibootmgr

Create a boot entry:
 efibootmgr -c [-L label] [-d /dev/sdX]

e.g.: efibootmgr -c -L myubuntu -d /dev/sdX
This boot entry would automatically be the first entry.
/dev/sdX is the external hard drive with the grub bootloader.

You can now reboot and without your intervention Ubuntu would automatically boot when external hard drive is plugged in. When the external hard drive is not plugged in, the PC would skip
our Ubuntu boot entry to the next entry which is probably Windows Boot Manager.


Preventing crashes when linux on external HD is accidentally unplugged

I had similar problem, that usb cable was to close to where I used my mouse. Fixed it by using a usb hub and moving cable out of the way.  Can also try to use a new cable or changing the usb port to another one.


I'm running fsck and getting "ext2fs_open2: Bad magic number in super-block"

You're doing the fsck on the wrong partition (sdb2).

sudo fdisk -l shows us that the following partitions are "Linux filesystem"...

/dev/sdb4    503808  4610047  4106240    2G Linux filesystem
/dev/sdb5   4610048 32335871 27725824 13.2G Linux filesystem

Here are the commands that you should be using...

Boot to Ubuntu Live DVD/USB in "Try Ubuntu" mode.

Open the terminal application and type:

sudo fsck -f /dev/sdb4
sudo fsck -f /dev/sdb5
reboot


How can I save images on the web with drag and drop?

This is part of the basic feature set of Chrome and Firefox:

LMB-drag: Create a .desktop launcher / Save link
CTRL+ LMB-drag: Save picture

LMB = left mouse button


Can't refresh packages in Update Manager

If you go to the URL listed you'll find there's no page there.

There's a reason for this is that Raring was the first release to have security updates for 9 months. It has reached end of life. You can read more here.

Long story short, it's time to upgrade to newer version (14.04).


Conflicts installing Tomcat by snap and by apt-get?

You can do that without any problems. Snaps come with all needed dependencies included in the snap-package and do not interfere with deb-packages managed by apt.

The icons of the applications might look same, so in the first moment after installation you'll have to find out, which icon starts which application.


Try setting the sound profile the normal way first. Click the little speaker icon at the top right of the desktop and choose 'Sound Settings...'. Click the Hardware tab in the window that comes up, and click on your audio device to configure. Then click on 'Profile:' and choose the profile you want, 5.1 in your case. You may have more than one 5.1 option, depending on your setup and motherboard outputs. Test that it works and then restart. The settings you changed should stick.


How to get the gcc compiler in ubuntu installed in windows 10

You need to run sudo apt update before the package can be installed.
Then sudo apt install gcc.


"Unable to load dynamic library " error when trying to run curl with PHP

I removed:

extension=php_curl.so

from both php.ini files and I no longer get the error.


How to restore the cpu frequency defaults or to align the frequency at will?

sudo update-rc.d ondemand defaults will make the ondemand script start on every boot.

This entry explains how to change the default frequency scaling governor.


How to excecute a .sh program with old date

Use this  preload library https://github.com/wolfcw/libfaketime ... you need to compile it from source, but everything is very well documented

It might not work with comercial software to cheat trial period etc.  You can specify time: absolute or relative... Downsides of absolute time are covered in documentation. In general it works well...


Make more storage on VirtualBox ofr Ubuntu 14.10

You could use Disk Usage Analyzer/boabab to find what is taking up the space:

You can then use dpkg -S /PATH/TO/FILE/OR/FOLDER to find what provides it and remove any unneeded packages. Careful some may be important

Note with VirtualBox you can set up shared folders that link to folders on the host machine - if you close the VM, and set up a shared folder, you can then mount it:

sudo mount -t vboxsf "name_of_shared_folder" "~/name_of_folder_on_guest/"

and use it.

Another (probably much simpler) way would be to resize the the virtual drive - you can do this by closing the VM and running:

 VBoxManage modifyhd “/PATH/TO/VIRTUAL_DRIVE.vdi” –resize SIZE_IN_MEGABYTES

you may need to run something like cd "C:\Program Files\Oracle\VirtualBox" if you are using Windows as the host machine. You may want to backup the VDI (the virtual hard disk file) beforehand.


Nautilus doesn't show ownership change after `chmod`

Your command changes the permissions of the /opt directory, but not its contents. To verify that the ownership is changed, use:

ls -ld /opt

If you forget the -d, this will list the contents of /opt, not the /opt object itself.

If you want to change the ownership not only of /opt itself but everything it contains, you need the -r (recursive) option on chown.

As to the GUI not showing the updated ownership of /opt; that could just be from it not re-reading the filesystem and relying on previously scanned information.

On Ubuntu 17.10, I can easily reproduce what I think you're running into. When I open the root directory ("Computer") in Nautilus, and right click on "opt" then view the "Properties", it's owned by root. If I change the ownership to myself in the shell, then of course this window doesn't change. If I close the Properties window and then right click on "opt" again to view the properties, it still indicates that it's owned by root.

To get Nautilus to re-read the latest meta-data and show the up-to-date permissions, hit Ctrl-R to refresh. Or else navigate to another folder and back.


php5-openssl package for Ubuntu 16.04 LTS?

You don't need openssl module, it's built-in:

$ php5.6 -r 'phpinfo();' | grep -i openssl
openssl
OpenSSL support => enabled
OpenSSL Library Version => OpenSSL 1.0.2h  3 May 2016
OpenSSL Header Version => OpenSSL 1.0.2h  3 May 2016
Openssl default config => /usr/lib/ssl/openssl.cnf
openssl.cafile => no value => no value
openssl.capath => no value => no value
Native OpenSSL support => enabled


Is there a way to increase the upload limit wtih the nginx charm?

Okay I've looked at the Nginx charm. It appears it puts the config in the default locations. These are /etc/nginx/nginx.conf for the main Nginx config and /etc/nginx/sites-enabled/default for the default site config.

There is a option in these config files called client_max_body_size. Change this to a value like 20m to allow a upload limit of 20 megabyte.


The colour setting escape sequences need to be enclosed in \[ and \] in order to tell bash readline that they don't contribute to the length of the line. This should do it:

PS1="\[\e]0;\w\a\e[1;36m\]\t-\! - \w>\[\e[m\] "


How to do BIOS/UEFI update on a Ubuntu system?

Please see the attached Pics. I have used "Disks" in Ubuntu 18.04. things may be slightly different with your Ubuntu 17.10

Assumptions: System is UEFI Capable

Download the latest BIOS from https://downloads.dell.com/FOLDER04836492M/1/XPS8920_1.0.15.exe
Keep the empty USB in the system you want to use for Updating BIOS.
Open "Disks" from your Ubuntu 17.10
Select the USB from the left panel of "Disks"
Click the settings/gear icon below the "Volumes" and "Click Format Partition"
give some name in the "Volume Name" prompt.
under the "Type", Select "For use with all systems and devices (FAT)
Click "Next" & "Format"
wait for "Disks" to finish the process and Confirm the "Partitin Type" is exactly W95 FAT32 (LBA)
Now copy the already downloaded file XPS8920_1.0.15.exe in to this USB.
Reboot the system, and press F12 at the Dell splash screen
This will bring up the One time boot menu
Select the option to BIOS Flash Update
In the popup, navigate to your USB disk and select the BIOS you downloaded
Once the update has been completed, the system will reboot automatically


Numerous hard restarts cause gradual damage to system?

In addition to the obvious data loss ( your work on the current block problem is lost ), and the less obvious possible data loss ( depending on how the miner writes to the block chain file on disk, it could corrupt the file ), the hard drive can have trouble from sudden power loss for two reasons:

If the power fails in the middle of writing a sector, it will be corrupt and reading it will result in a "bad sector".  This can be corrected by forcibly writing fresh data to the sector, but this requires manual intervention.
Sudden loss of power causes the drive to do an emergency head retract, which is more violent than a clean shutdown.  Drives are only rated to handle so many of these before they are likely to break.


Ubuntu 13.10 and Raedon HD 7700, which drivers?

Look no further than this, I've had excellent results for the first time with RadeonSI in gaming:

cd /tmp; wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v3.12-rc6-saucy/linux-headers-3.12.0-031200rc6-generic_3.12.0-031200rc6.201310191635_amd64.deb
wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v3.12-rc6-saucy/linux-headers-3.12.0-031200rc6_3.12.0-031200rc6.201310191635_all.deb
wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v3.12-rc6-saucy/linux-image-3.12.0-031200rc6-generic_3.12.0-031200rc6.201310191635_amd64.deb
sudo dpkg -i linux*.deb

Then download fglrx debs from here: https://copy.com/DctT73MTnQM2 and install them with cd ~/Downloads; sudo dpkg -i fglrx*.deb then reboot

You'll be up and running Linux kernel 3.12-rc6 which has a massive improvement with the CPU governors which was discovered to drastically improve GPU performance, along with Catalyst 13.11 which has given Radeon HD 7000+ cards some amazing performance while fixing a lot of bug issues.


linux gateway / firewall IPtables config

Suggestions on how to configure iptables:

Open a terminal,Press Ctrl+Alt+T

Run it:

sudo -i
/sbin/iptables -t nat -A POSTROUTING -o em2 -j MASQUERADE
/sbin/iptables -A INPUT -s 192.168.1.2/30 -i em1 -j ACCEPT
echo “1” >/proc/sys/net/ipv4/ip_forward


On ubuntu/debian, this file is in /etc/ssl/certs/ca-certificates.crt. You could symlink it. The /etc/pki/ path is used on Redhat.


How do I change the icon of an application in my dash / favorites area?

Is this program in your favorites?

First you need to find the .desktop file.

Enter gsettings get org.gnome.shell favorite-apps to get all the names of your favorites. For example, here are mine:

['firefox.desktop', 'org.gnome.Nautilus.desktop']

You can find the location of the file with the following command:

find ~ /usr/ -name the.name.desktop

Replace the.name.desktop with the filename you want to look for in your personal and /usr folders.

Then, you can edit the .desktop file (perhaps as root). Change the line (or add the line) Icon=.... There you can put the name of your icon or the whole path to the image you want to use.


MAAS 2.0 Update bonding driver configuration

https://bugs.launchpad.net/maas/+bug/1645319

This is available in MAAS 2.1. The documentation is off but it is available.