Have backup script not run if image is restored

I tested this by making sure that the destination file was newer and that the older file did not overwrite it.
DOCS="/home/andy/Documents" # shell variable

Backup_Directory="/media/storagedrive/Ubuntu_Mate_18.04/"

# Copy files ONLY if they are newer
#
cd $DOCS
rsync --progress -r -u Ubuntu_Documents.tar.gz $Backup_Directory


Ubuntu installing Error ! ~ Error parsing

when you boot from USB and see grub press the E key. Add nouveau.modeset=0 to the end of the linuz line then press F10 to boot.


Remap the middle click action of Logitech T400 wireless mouse

Try imwheel.

sudo apt-get install imwheel

You can configure your buttons using imwheel and it's recommended by the Ubuntu wiki.


How do I set battery charging thresholds

Please stop messing around with kernel modules by hand and stay away from way outdated instructions for Hardy. All things needed are available as packages from either the Ubuntu repos (15.10) or the TLP PPA.

Install TLP as described here. You may omit the tp-smapi-dkms package as tp-smapi is incompatible with the X250.

Modify TLP's configuration to include your desired charge thresholds, Example here. Don't forget to remove the leading #'s from these lines.

To activate the thresholds use

sudo tlp start

Show the output of

sudo tlp-stat -s -c -b


Is there a way to search files considering content of archives as well?

You can search within each particular archive type as follows:

cd /dir/where/you/want/to/start/search
find . -iname '*.zip' -exec unzip -l {} \; | grep 'file_pattern'
find . -iname '*.tar.gz' -exec tar tvf {} \; | grep 'file_pattern'
find . -iname '*.7z' -exec 7z l {} \; | grep 'file_pattern'

You could simplify its use by always search starting in the current directory, and accepting the file matching pattern (which could include regular expressions or simply be all or part of the filename) as a command-line parameter:

Create a script (named, e.g. "arcsearch") in your executable path (e.g. /usr/local/bin), making sure you "chmod +x" it to make it executable, with this content:

find . -iname $1
find . -iname '*.zip' -exec unzip -l {} \; | grep $1
find . -iname '*.tar.gz' -exec tar tvf {} \; | grep $1
find . -iname '*.7z' -exec 7z l {} \; | grep $1

Then you can simply type:

arcfind whatever_you_want

and it'll spit out the results, both "normal" files and those within archives.


open a browser

go to http://www.solarsystemscope.com/

right click the title bar and set layer to 'always on bottom'

press F11 (firefox) to go fullscreen

open your other windows over it


Jeoge! You need to install the package timidity . You can install it by clicking on that icon or typing

sudo apt-get install timidity

in the terminal. Now you can hear music. Still have problem?
Go to OpenTTD FAQ site.


How can I find barman's configuration file /etc/barman.conf?

Your user has permissions in your ‘userspace’ only.

The file you want to open is owned by root.

You can open it with sudo -H gedit /etc/barman.conf where sudo gives you temporary elevated permissions (as root), the -H (HOME) option requests that the security policy set the HOME environment variable to the home directory of the target user (root by default) and gedit is the default text editor in any Gnome based distro.


Optimizing 4GB RAM for Android development using Android Studio 4 on Linux

You might consider using Power save mode (File -> Power Save Mode)
Do use a physical device for testing.
And finally, reduce Maximum heap size to some lesser value (Help -> Change Memory Settings)

Hope this helps.
Edit: As you have already changed memory settings, the power-saving mode can help you.


Is there a desktop application for launchpad.net?

This is commonly used for a number of command-line tools, such as those in the ubuntu-dev-tools package,

There is also a desktop client called Ground Control . which mostly focuses on bugs & branches.

Also under development is a Unity Lens which currently can search people, packages & bugs by number. This doesn't use the Launchpad credentials in the screenshot, but the anonymous access.


Partially encrypt home folder (for sake of steam games)

There is no easy way to do this. As it is now, ecryptfs encrypts all of $HOME as you can see. So you would need to install without encrypting home and then use ecryptfs to encrypt parts of home and then configure it to automatically decrypt when you log in.

See https://help.ubuntu.com/community/EncryptedPrivateDirectory for how to do this. Note the page is outdated and I can not vouch for accuracy thus I am not copying the contents here.

The other option would be to use a separate user for your steam games.

Up to you which option is best.


How do I install and switch to the Unity 2D desktop?

For 11.10, 12.04, & 12.10
Users of 11.10 and above have Unity 2D installed by default already.
To use it, logout, you will be confronted by the LightDM manager.
Then, click the little cog wheel, and select Ubuntu 2D.
Then, enter your password, hit Enter and you'll be logged into Unity 2D.

For 13.04, no need to do this - they have integrated the Unity 2D and Unity 3D environments.


There is a tool in the repositories that changes LaTeX to openoffice.org's XML format: tex4ht

TeX4ht is a highly configurable TeX-based authoring system for producing hypertext. It interacts with TeX-based applications through style files and postprocessors, leaving the processing of the source files to the native TeX compiler. Consequently, TeX4ht can handle the features of TeX-based systems in general, and of LaTeX in particular.
TeX4ht can be used both for authoring HTML using TeX/LaTeX input files, or for converting existing TeX input files (in any format) into HTML, with (usually) only minor modifications.  Other varieties of hypertext can also be produced, including XML, XHTML, MathML and the Openoffice.org format of XML.

Command line...

latex filename.tex
bibtex filename.aux
mk4ht oolatex filename.tex

Should end up with an openoffice.org/libreoffice compatible file.


Do

sudo mkdir -p /etc/X11/xorg.conf.d/
sudo vim /etc/X11/xorg.conf.d/20-intel.conf

Then paste this to the file

Section "Device"
   Identifier  "Intel Graphics"
   Driver      "intel"
   Option      "TearFree"    "true"
EndSection

Reboot

Source


Dual booting Ubuntu with Windows 10, Ubuntu is installed but cannot boot into it

I was able to solve this with a manual hardware work around.

I detached the harddisk with windows before installing Ubuntu using a live USB on the SDD.

Now the BIOS was able to detect both OS but the order was set to Windows first. So I had to reinstall GRUB so that GRUB loader is loaded first.

I think the main reason for the sector errors was because the ODD and HDD slots on the machine have different buses at different speeds. I do not have proof for this; it is just an intuition.

In case someone wants to dual boot and seem to face similar problem one possible easy solution is to remove the HDD with the OS before installing a new one in other disks. (Do not forget to back up your data).


What is the quickest way to indent a block of text with spaces for use within a web browser?

You can pipe through a short shell script:

$ xsel -b | sed 's/^/    /' | xsel -b

The first xsel -b reads the clipboard, sed adds four spaces (^ matches start-of-line), then the second xsel -b puts it back on the clipboard.  Drop the -b to use the primary selection instead (the middle-click-paste buffer).

Example:

# put two lines in the clipboard, "abc" and "123", for the example
# the \n is a newline, and echo adds another newline to the end
$ echo $'abc\n123' | xsel -b

$ xsel -b | sed 's/^/    /'  # output written to the terminal
    abc
    123
$ xsel -b | sed 's/^/    /' | xsel -b  # again, to the clipboard

You can put this in a shell script, for example named "indent4", with contents:

#!/bin/bash
xsel -b | sed 's/^/    /' | xsel -b

Then make it executable.  You can also do the chmod by right-clicking the file in Nautilus, going to properties, and changing permissions.

$ chmod +x indent4

# test it:
$ echo $'abc\n123' | xsel -b  # load clipboard
$ ./indent4                   # assuming it's in the current directory
$ xsel -b                     # show clipboard
    abc
    123

And then put the file on your desktop, or store it anywhere and make a launcher for it.  Now you can run indent4 (e.g. double-click) and the clipboard will be modified.

xsel is from a package named, not surprisingly, "xsel"; you may have to install it.  See "man xsel" for details.  The $''-style strings in the example are bash-specific.


Cannot type some letter types in Tamil keyboard layout

Please follow the link
"http://mmauran.net/blog/?p=102"
also you can try
"http://tamil99.org/"


I downloaded ubuntu-12.04.3-desktop-i386 but can't install

Please use the following method. This will solve your issue.
I tested this method on my laptop. Currently, I'm answering this question by using Ubuntu 13.10 (32bit) installation inside my Windows 8.1.

OFFLINE INSTALLATION:

DISABLE INTERNET
MOUNT 32BIT ISO IN WINDOWS VIRTUAL DRIVE (no additional software is required in the case of windows 8)
COPY THE wubi.exe TO SOME OTHER DRIVE; FOR EXMAPLE E:\WUBI-INSTALLER
OPEN COMMAND PROMPT (ADMIN)
CHANGE DIRECTORY TO E:\WUBI-INSTALLER (i.e. the location in your PC where the installer is copied)
USE THE FOLLOWING COMMAND TO TARGET TO 32BIT MOUNTED IMAGE:

   wubi.exe --force-wubi --32bit

(with this step, the installer will automatically detect and use the mounted ISO image)

7.COMPLETE THE INSTALLATION

IMPORTANT NOTES:- USE THE wubi.exe FROM THE SAME ISO PACKAGE WHICH YOU'RE USING FOR THE INSTALLATION. Using this method, you can install the 32 bit version of ubuntu inside windows using the downloaded ISO image.

Please, feel free asking any clarification further.

Have a nice day

Sunny


Error installing pynauty: “error: command 'x86_64-linux-gnu-gcc' failed with exit status 1”

The full error message tells you part of the solution: you need to compile nauty with the -fPIC flag.

Download nauty, unzip it, cd into the dir
CFLAGS=-fPIC ./configure
make
Download pynauty, unzip it, cd into the dir
ln -s ../nauty* nauty
However, the pynauty's setup.py file appears to be misconfigured: it doesn't include the correct nauty files and so will fail on import if built and installed at this point.  Modify the extra_objects argument in setup.py (line 37):

# from
extra_objects = [ nauty_dir + '/' + 'nauty.so', ],
                      nauty_dir + '/' + 'nautil.o',
                      nauty_dir + '/' + 'naugraph.o'
                    ],
# change it to
extra_objects = [nauty_dir + '/' + 'nauty.a'],

python setup.py build
python setup.py install (if you're installing to the system, use sudo, but preferably use a virtualenv instead)

While the package is now installed and importable, the entire test suite fails.  This is an issue that should be fixed by the library's maintainer; consider reporting the bug to them.


Often times it doesn't apply correctly after setting a theme. To fix that, you should try logging out and logging back in to see if the theme applied correctly.


Why do you need to disable EFI variables? There may be another way to accomplish your ultimate goal without messing with the EFI variables.

The noefi kernel option should indeed disable the EFI variables. If you've only tried it once, you might try it again; perhaps you mistyped it. I just tried on an Ubuntu 12.04 installation in VirtualBox, and noefi disabled the EFI variables support for me. (efibootmgr no longer worked and /sys/firmware/efi was missing.) You might also try placing it somewhere else amidst the kernel's options.

Another option is to boot using a BIOS-mode boot loader rather than an EFI-mode boot loader. If the USB device you're using is an Ubuntu installer, I believe it includes both types of boot loaders, so you should be able to use your firmware's boot option or possibly rEFInd 0.4.6 or later to select your boot mode. If you're using a custom USB flash drive, you'll need to install a BIOS version of GRUB manually.

A final option might be to remove the efivars kernel module, as in rmmod efivars, after booting. I tried to test this, but my test system uses a custom kernel with that module compiled in directly rather than as a module, so I can't guarantee that you'll be able to remove that module.


The solution I found was to edit the index.theme file in the theme directory, and increase (to 24) the value of the MinSize and Size settings for the */symbolic icons entries.


I would say:

30 GB for /
20 GB for /swap (depending really on what you are going to do; for me you have not enough RAM)
450 GB for /home (or whatever is left, I'm rounding the values so you get the idea)

You can play with the size of / depending on the amount of software you are going to install.

For me, the formula boils down to: 30 GB for /, 16 GB for /swap (I have 16 GB RAM, so /swap is rarely used, but I like to have it like that!)...the rest for /home.


How can I find and remove 6to4 from my system?

To get a grip on what is happening with your networking, ifconfig is a great tool. It shows you all the interfaces on your computer and what addresses they have.
Another good tool is ip -6 route show (IPv4 version: ip route show).

6to4 addresses always start with '2002:xxxx:xxxx:' (for example 2002:40b8:f37f:). In comparison, a teredo address will always start with '2002:0:' (or 2002:0000: which is the same). Don't confuse 6to4 with a configured HE tunnel. A HE tunnel uses 6in4 and it's address will start with '2001:470:'.

From your updated question, I can see that there is no 6to4 tunneling on your system. Your router is tunneling all IPv6 traffic that goes through it using '2002:42db:c22c:0:' addresses through a 6to4 tunnel. It is giving out addresses from its tunnel to the local network. Apparently your router supports IPv6 that much.

So, how does your computer have an IPv6 6to4 address without a 6to4 tunnel? Well, your computer is using that address it gets from the router to do native IPv6 on your home network. When it has internet bound IPv6 traffic, it sends it to your router which sends it inside the 6to4 tunnel.

So, your whole network currently has IPv6 and you have a choice. You can let your router do the IPv6 for the network, which will give you a different IPv6 address every time you IPv4 address changes. Or, you can have your Ubuntu do the IPv6 for your network and have static addresses from HE. I think it might also be possible to do both.

To ignore the IPv6 addresses advertised by the router, click on the network manager icon and click Edit connections. (Non-Unity:Right click instead to open menu). On the wired tab, double Click the the Auto eth0 connection. Go to the IPv6 tab. Select Ignore instead of Automatic.

I've written a how to for setting up HE tunnels on Ubuntu at  https://erikbandersen.com/wordpress/?p=28. I copied some of it here.

Let’s set up our IPv6 tunnel connection. Run

gksudo gedit /etc/network/interfaces

and add the following:

auto he-ipv6
iface he-ipv6 inet6 v4tunnel
     endpoint 216.218.226.238
     address  2001:470:a:d29f::2
     netmask  64
     ttl 64
     up ip -6 route add default dev he-ipv6
     down ip -6 route del default dev he-ipv6

Replace the endpoint setting (216.218.226.238) with the Server IPv4 address field from the tunnel details page and the address setting (2001:470:a:d29f::2) with Client IPv6 address field from the tunnel details page. Save the file.
Ok, now let’s start the tunnel connection: run gksudo ifup he-ipv6 .

(From here on is to advertise your tunnel addresses to the rest of the network.)

Ok, now lets set the computer to allow IPv6 through itself, instead of accepting only traffic to itself. Open /etc/sysctl.conf. Look for the lines

net.ipv6.conf.default.forwarding=0

and

net.ipv6.conf.all.forwarding=0

and change them both from 0 to 1, adding the lines (with an =1) if they don’t exist. Save the file and then run

gksudo sysctl -p

Right click on the network manager icon in the tray and click Edit Connections. Select the connection to your local network and click Edit. Go to the IPv6 Settings tab and set the Method to Manual. Click Add. For the address put the first address in your Routed 64. (In this example it would be 2001:470:b:d29f::1 .) For the prefix put in 64 . For the gateway, put in the address from the “Client IPv6 address” of the tunnel details page (in this example it would be 2001:470:a:d29f::2). Click apply.

Ok, now install the radvd package which lets other hosts automatically set up an IPv6 address from the block Hurricane Electric assigned you. Make a new text file and put in the following text, editing as directed by the comments:

interface eth0  #change this to the interface that connects to the local network
       {
              AdvSendAdvert on;
              AdvHomeAgentFlag off;
              MinRtrAdvInterval 30;
              MaxRtrAdvInterval 100;

              prefix 2001:470:b:d29f::/64  #change this to the "Routed 64" from the tunnel details page
              {
                     AdvOnLink on;
                     AdvAutonomous on;
                     #AdvRouterAddr on; #We don't have dhcpv6 on. Only uncomment this if you want clients to look for a dhcpv6 server.
               };
       };

Save the file as “/etc/radvd.conf”

If you the UFW firewall running, open /etc/default/ufw in the text editor you have open and change

IPv6=no

to

IPv6=yes

and change

DEFAULT_FORWARD_POLICY="DROP"

to

DEFAULT_FORWARD_POLICY="ACCEPT"

and then save the file.

To finish up, start the router advertising daemon by running

/etc/init.d/radvd start


How can I run this script at startup / change setting

See the post here: wiki.ubuntu - xrandr, this shows you several ways to do it.


How can I get a list of all packages in a repository section from command line?

Make sure the dctrl-tools package is installed. It provides useful commands for searching the apt and dpkg package lists. To get a full description of all packages from a particular section that are installable with apt, run

grep-aptavail -F Section hamradio

This will show the full package metadata for every package in the hamradio section. If all you want to see are the package names, run

grep-aptavail -n -F Section -s Package hamradio

If your system is set up for multiarch, the same package may show up more than once in this listing if it is built for more than one architecture. So to refine this further, use either

grep-aptavail -n -F Section -s Package hamradio | sort | uniq

or

grep-aptavail -n -F Section -s Package hamradio | sort -u

to sort the package list and remove duplicate packages with the same name.

Note that you will have to use the actual name of the section, which is different from the "human-readable" name that Synaptic shows in its GUI. For example, the searches above use the section name hamradio instead of the string "Amateur Radio" shown in Synaptic.

See the man page for grep-aptavail for a full description of all options and some examples.


Wi-Fi RT3290 device not ready on Ubuntu 16.04

Run ifconfig wlan0 up as root:

sudo su
ifconfig wlan0 up

Note: wlan0 is the logical name for my wireless card, to find yours run: sudo lshw -C network


How to get special characters on keyboard input?

It looks like you need the dead_macron symbol. An example with the English (US, international with dead keys) keyboard layout:

Typing RightAlt+Shift+3 followed by U results in the ū character.


Running a PHP script at startup AFTER other services have started

If you're not running a EOL version of Ubuntu, your init system is already systemd based, so using it is the right way to go. Some people might tell you to use Type=idle for your service unit, but please: (from the systemd man page):

  Note that using any type other than simple possibly delays the boot
  process, as the service manager needs to wait for service
  initialization to complete. It is hence recommended not to needlessly
  use any types other than simple. (Also note it is generally not
  recommended to use idle or oneshot for long-running services.)

Taking that into consideration, we should manage our service ordering by setting targets and dependencies. You have at least three important requirements for your script to work:

Your network stack needs to be functioning;
Your script should run late in the boot process, and;
Your script should run after Redis is fully started.

Having identified those requirements, let's take a look at the systemd targets so we know what we want, require and should depend or wait on:

Units that strictly requires a configured network connection should pull in network-online.target, so our unit Wants this and should only run After this target;
multi-user.target sets up a multi-user system and finishes up once everything required for that is done, so the unit probably Wants and is WantedBy it. As we really want our unit to run late into the boot process, running it After this target is what we want too;
Redis is part of the multi-user system we are configuring, and our unit can only produce its desired effects if Redis up and running so it Requires Redis to be running and we should only load After it.

With that in mind, we can write a echoweather.service file into the /etc/systemd/system/ that takes all of this into account:

[Unit]
Description=Gets regular weather updates into my Redis database
Wants=network-online.target multi-user.target
Requires=redis-server.service
After=network-online.target multi-user.target redis-server.service

[Service]
PIDFile=/var/run/echoweather.pid
ExecStart=/usr/bin/php /usr/local/bin/echoweather.php  >/dev/null 2>&1 &
Type=forking
KillMode=process

[Install]
WantedBy=multi-user.target

Once it's done, reload your daemon files, enable your service unit and run your process:

$ sudo systemctl daemon-reload
$ sudo systemctl enable echoweather.service
$ sudo systemctl start echoweather.service


Tried all the above and also tried upgrading (and downgrading) my nvidia drivers.

In the end what worked was to uninstall nvidia using

  sudo apt-get purge nvidia

and remove nvidia files from /etc/modprobe.d/ - these were stopping nouveau from loading
I also copied a backup of xorg.conf file to /etc/X11/xorg.conf
then rebooting worked.

[edit] In fact this was not a complete solution since it only worked sometimes.  In the end I also needed to create a folder /var/lib/lightdm (see https://askubuntu.com/a/692627/451489) and also fix my .Xauthority permissions https://askubuntu.com/a/223634/451489) - now lightdm, X and unity all appear to be working reliably.


How to specify Wi-Fi Access Point Order?

Network Manager will automatically try to connect to the strongest signal that you have selected to automatically connect to. You cannot change that logic.

What you can do is to prevent less-frequently-used connections from connecting automatically, which should be fairly close to what you are asking for.

On Ubuntu 13.10:

Right click on the Network Manager icon, select "Edit Connections"
Automatically-connecting wireless are prefixed with "Auto". Example:"Auto NETGEAR"
Edit any of those Auto connections
Look in the General tab
Uncheck the "Automatically Connect" option

Network Manager's layout changes from time to time, but the option is always in there somewhere.


Minimum Processor Requirements: 12.04 vs 14.04 vs 16.04

Ubuntu Desktop 12.04 desktop requirements:

  Ubuntu Desktop 11.04 and up uses Unity as the default GUI while the previous releases used GNOME Panel by default. In order to run Unity the system needs a more capable graphics adapter.

  1000 ΜHz processor (about Intel Celeron or better)
  1024 MiB RAM (system memory)
  3D Acceleration capable video card with at least 256 MB onboard memory
  5 GB of disk space
  From experience, we all know that it is recommended to have 2048 MiB RAM to properly run a day-to-day Ubuntu.

  A good start should be with minimum 1024 and recommended 2048 MiB RAM.

Ubuntu Desktop 14.04 desktop requirements:

  In order to run Unity the system needs a more capable graphics adapter.

  1000 ΜHz processor (about Intel Celeron or better)
  1024 MiB RAM (system memory)
  Graphics processor and display capable of at least 1024x768
  6 GB of disk space
  From experience, we all know that it is recommended to have 2048 MiB RAM to properly run a day-to-day Ubuntu.

  A good start should be with minimum 1024 and recommended 2048 MiB RAM.

Xubuntu 14.04 to 16.04 (there is no official system requirements, but this is gathered from many sources)

  512 MiB of system memory (RAM)
  5 GB of disk space
  Graphics card and monitor capable of 800x600 resolution
  700 MHz Processor

Lubuntu 14.04 to 16.04 (there is no official system requirements, but this is gathered from many sources)

  Pentium II
  128 MiB RAM
  PAE supported CPU
  4GB of disk space

Please comment if you want ones for other flavours.


To reinsert a passphrase with ecryptfs-add-passphrase

from man ecryptfs-add-passphrase

DESCRIPTION
       ecryptfs-add-passphrase is a utility to manually add a passphrase to the kernel keyring.

When you change the user password, the relevant adaptation of the encryption is performed automatically in the encryption system.

However, this mechanism does not apply if the administrator for another user sets a (new) password.

Create a backup

cd /home/<user_name>/.ecryptfs
cp -f wrapped-passphrase wrapped-passphrase.old

Note passphrase

ecryptfs-unwrap-passphrase wrapped-passphrase
passphrase: <old_passphrase>

Optional: Change user password

passwd

Protect passphrase with current user password

ecryptfs-wrap-passphrase wrapped-passphrase

The following prompts appear:

Passphrase to wrap:  <noted_passphrase>
Wrapping passphrase: <current_password>

Now you should log out, log back in and check the success of the above measure. If not successful, you have to log in with your username and reset your password with passwd in the console (Ctrl+Alt+F1). If the login still does not work you can copy back the wrapped-passphrase.old.

Source


Entering fullscreen in mednafen with ONE monitor?

Set these environment variables as shown, in your bash script, before running mednafen, and it will full screen only on the primary display.

export SDL_VIDEO_FULLSCREEN_DISPLAY=0
export SDL_VIDEO_FULLSCREEN_HEAD=0

You may also need to update the configuration in ~/.mednafen/mednafen.cfg to not have the very large resolution specifications set, had they been set to the large values previously.


Installing Wifi Card Driver on ubuntu 16.04

Means not supported with default kernel.

Try:

DESKTOP
 sudo apt-get install --install-recommends linux-generic-hwe-16.04 xserver-xorg-hwe-16.04

SERVER
 sudo apt-get install --install-recommends linux-generic-hwe-16.04

From: https://wiki.ubuntu.com/Kernel/LTSEnablementStack


What happens when you "Try Ubuntu without installing"?

"Try Ubuntu without installing" boots Ubuntu as a "live system". That means it runs entirely from the removable media (the installer DVD or USB drive) and not from your internal hard disk.

On a normal Ubuntu DVD or USB installer (without persistence - if you don't know what that is you have not set it up), all changes you make in the live system are only kept in RAM and therefore discarded as soon as you shut it down.

You can however manually mount other storage devices (like the internal hard disk partitions) and modify them. This doesn't happen automatically though, but as @TorstenS pointed out in his comment, it is quite easy to do this accidentally as each mountable partition and device normally gets represented by an icon on the desktop and in the Nautilus file manager. Clicking on that icon will mount the respective file system and show its contents, allowing you to modify everything. You could also still easily format or repartition your disks from a live system, effectively deleting things from your internal disk. Ubuntu won't do anything like that on its own unless you tell it to, but you still have to be careful to not accidentally do that.

About your special case of installing or removing software packages: those changes are also only kept in RAM and are not preserved across reboots (again, unless you manually create an USB installer with persistence, but you most likely didn't do that). The next time you boot from the installer medium, it will be in the exact same state as it was the last time and the times before that.


Lubuntu - Disable "Removable media is inserted" window

what you must be looking for is the option in pcmanfm to not show options when removable media is inserted:

Uncheck Show available options for removable media when they are inserted

You can get there from any file browser window, Edit>Preferences


How to rebuild kernel for wacom tablet driver?

If time is of the essence you can try building the branch of the Wacom driver which contains those updates which have not yet made it into a release:

git clone http://git.code.sf.net/p/linuxwacom/input-wacom
cd input-wacom
git checkout -b 4.6jiri remotes/origin/jiri/for-4.6
./autogen.sh
make
sudo make install
sudo modprobe -r wacom
sudo modprobe wacom

More information on the driver can be found here:

http://linuxwacom.sourceforge.net/wiki/index.php/Input-wacom


do you have multiple graphics cards in the computer? I have a dv7 using xubuntu and I've got a discrete ATI graphics cards and an intel integrated one.

fglrx-update packages will not work. this is a bug

https://bugs.launchpad.net/ubuntu/+source/jockey/+bug/870560?comments=all

read through that.

For xubuntu, I don't require the graphics of unity so the intel card works fine. Try unity in 2D. If fglrx is not installed, find out the outcome of

sudo su
cat /sys/kernel/debug/vgaswitcheroo/switch

you should see

0:IGD:+:Pwr:0000:00:02.0 --integrated graphics processor

1:DIS: :Pwr:0000:01:00.0 --discrete graphics processor

The fan on problem might be that both gpus are powered up even though only one is used.

For the fan problem, try

echo OFF > /sys/kernel/debug/vgaswitcheroo/switch

and then re-run: cat /sys/kernel/debug/vgaswitcheroo/switch

this should give

0:IGD:+:Pwr:0000:00:02.0

1:DIS: :OFF:0000:01:00.0


How to add manual new Wi-Fi connection on Ubuntu 19.10?

Use the command nm-connection-editor.

Click the + button at the bottom of the window.

Select Wi-Fi from Hardware.. and then click Create....


AMD has dropped support for the Radeon HD 4000 series, which is what you have. You might still be able to use this driver, but it probably won't be an update for what you have.


Open another terminal window with the same SSH session as original window

Perhaps this could help: screen

It is not installed by default on Ubuntu, but is provided in the repositories.

It is very useful: ssh to a remote host and type screen to enter a screen session.

Start whatever time consuming task you like, and then press Ctrl+A followed by Ctrl+C to create a new window in the screen session.

This will spawn a new shell where you can do what you want. Create even more windows using the same command.

To switch between two windows quickly, use Ctrl+A followed by Ctrl+A again. As you can see, Ctrl+A puts screen in command mode.

Ctrl+A Ctrl+D will detach from the screen session. You can then disconnect from the host and log in again later and use screen -dr to resume your session.

To go to a specific screen window, type Ctrl+A followed by a number.

Screen will exit when all active windows are closed (or the shells within have exited).

I got this from SSH and SFTP sessions.

Edit-

tmux is an alternative to screen.
http://www.sitepoint.com/tmux-a-simple-start/


All about gmain can be found on the gnome developer site. 1st bit of the description for it:

Description
The main event loop manages all the available sources of events for GLib and GTK+ applications. These events can come from any number of different types of sources such as file descriptors (plain files, pipes or sockets) and timeouts. New types of event sources can also be added using g_source_attach().

Basically it handles anything gnome event related.


I would advice you go with this script it will help ypi out a lot

The Seedbox From Scratch Script (Multi-user, quota, sabnzbd and Deluge)

http://www.torrent-invites.com/showthread.php?t=207635

You can create and delete seedbox users as you want !


How to configure DBeaver to connect with ms sql server

So, we had the same problem. I don't if this will still help you, I just found your question. And to solve my problem, I searched the web as well, but unfortunately, did not find a solution (at least in my quick search). So, what I did to solve it, I was just winging it. Hope you'll be able to reproduce this.

Step 1. Run dbeaver

Step 2. Select new connection type, in your case, MS SQL Server -> Microsoft Driver -> Next.

Step 3. When I did my config, the JDBC URL, Port, and Host were already filled out. So, what you'll be just doing here is to enter your User name and Password for SQL Server. Then, click Test Connection. You'll be prompted to download the drivers, do it.

Step 4. I did not do anything here. Just click Next

Step 5. I just clicked Finish here.

Step 6. You're done, you should see the DBeaver - General Window. You can now access your SQL Server.


You might need to reinstall Ubuntu and tick the proprietary driver checkbox. You could also try Ubuntu 18.04 or 21.04. You should install those alongside though, so you don’t lose data.


Manual install with LVM spanning multiple unpartitioned spaces

Installing Ubuntu with LVM on a single volume group that spans multiple physical partitions

Getting ready

Boot into Ubuntu from a live USB or live CD and open a terminal window (ctrl+alt+T). For convenience sake, run sudo -i to change to root. We'll be working in this terminal window to set up LVM.

LVM Setup

Just to demonstrate that my setup matches that in the question, here's what fdisk -l /dev/sda shows in my VM

Disk /dev/sda: 100 GiB, 107374182400 bytes, 209715200 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x4856d148

Device     Boot     Start       End   Sectors Size Id Type
/dev/sda1            2048  52430847  52428800  25G  0 Empty
/dev/sda2        52430848 157288447 104857600  50G  7 HPFS/NTFS/exFAT
/dev/sda3       157288448 209715199  52426752  25G  0 Empty

In answer to the question, and using the same partition structure specified, run the following commands:

pvcreate /dev/sda1 /dev/sda3 <-- Specify all partitions you want to pool for install. These need not necessarily be on the same physical disk.
vgcreate vg0 /dev/sda1 /dev/sda3 <-- Here, vg0 is an arbitrary name for the volume group
At this point we can run vgs and see that we have a 50G (reported as 49.99g) to work with. Now we need to create some logical volumes onto which we'll install Ubuntu. I'm only going to create root and swap partitions, but you could create other partitions as well if, for example, you wanted a separate home partition.

lvcreate --name swap --size 4G vg0 <-- this creates a 4G parition I'll use for swap
lvcreate --name root --extents 100%free vg0 <-- this creates a new partition that uses all of the remaining space in vg0. We'll use this as our / (root) partition.

That's it for setting up LVM. Now it's time to install Ubuntu.

Ubuntu installation

Run the installer from the live OS to begin installation. When you get to the section titled Installation type select the something else option

Then you assign mount points to the logical volumes we created so that Ubuntu can install the system.

Dual booting

As the install is finishing, grub should install, detect Windows and setup a boot menu that will allow you to boot into either OS.


install virtualbox guest addition terminal

Try to install the following packages in your VM:

sudo apt-get install virtualbox-guest-dkms virtualbox-guest-utils virtualbox-guest-x11

Restart the VM and you should avoid the black screen.


Change logging directory/file for an Upstart service

The cookbook says --logdir is a command-line option, which means it's not an option that goes into an upstart job file, but on the command-line of Upstart itself. You can verify this in the init(8) manual page, cf. http://manpages.ubuntu.com/manpages/precise/man8/init.8.html

   --logdir directory
          Write   job   output   log  files  to  a  directory  other  than
          /var/log/upstart.

In other words, it's a global option, not a per-job option.


How to remap a mouse button on HP 820 laptop to create a middle button

Building on this answer: https://askubuntu.com/a/492745

Use xinput to view the list of input devices and try to identify your laptop's builtin "mouse" device. With that ID, use xinput test with that device ID, and press each of the mouse buttons, watching the button ID that comes up for each one. If the all of the buttons have unique IDs, then you can reassign each one independently with xinput set-button-map. However, if the buttons on the top and bottom resolve to the same button ID, then you won't be able to map them independently.


You can only extend the partition if there is un-allocated disk to its side.
In your case dev/sda8 is in between your file system and un-allocated space. So if want to extend the file system first move the partition dev/sda8 to right and try extending the file system.
Be careful when you move the partition it may result in data lost.
Tell me if it works


Canon TS705 printer - Paper Source option Not Available

I cheated printer. Set different papers for trays, set appropriate paper type for tray you want and printer will use proper tray.


Wired connection periodically lost in Ubuntu 12.10 (AR8161)

I try to use

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

Seems OK. But it needs a reboot. When I try to reset it, it got stuck, but the reset button fixed that.


This is the MacBuntu Theme:

sudo add-apt-repository ppa:noobslab/macbuntu
sudo apt-get update
sudo apt-get install macbuntu-os-icons-lts-v7
sudo apt-get install macbuntu-os-ithemes-lts-v7

Then, install Unity Tweak Tool from Ubuntu Software Center.
Select the Mac Icons and Theme.

To get a launcher similar to Launchpad Launcher:

sudo add-apt-repository ppa:noobslab/macbuntu
sudo apt-get update
sudo apt-get install slingscold

Install the Plank dock:

sudo apt-get install plank

And install themes for it:

sudo add-apt-repository ppa:noobslab/macbuntu
sudo apt-get update
sudo apt-get install macbuntu-os-plank-theme-lts-v7

Use Ctrl+Right Click to access the menu and change the theme.

Install Mac Splash screen for Ubuntu:

sudo add-apt-repository ppa:noobslab/themes
sudo apt-get update
sudo apt-get install macbuntu-os-bscreen-lts-v7

Install Mac LightDM theme (install at your own risk, buggy with some graphics cards and not very reliable- can brick your login)

sudo add-apt-repository ppa:noobslab/themes
sudo apt-get update
sudo apt-get install macbuntu-os-lightdm-lts-v7

To revert:

sudo apt-get remove macbuntu-os-lightdm-lts-v7


Difference between the i386 download and the amd64?

i386 refers to the 32-bit edition and amd64 (or x86_64) refers to the 64-bit edition for Intel and AMD processors.

Wikipedia's i386 entry:

  The Intel 80386, also known as the i386, or just 386, was a 32-bit microprocessor introduced by Intel in 1985... This is termed x86, IA-32, or the i386-architecture, depending on context.

Wikipedia's x86_64 entry:

  x86-64 is an extension of the x86 instruction set. It supports vastly larger virtual and physical address spaces than are possible on x86, thereby allowing programmers to conveniently work with much larger data sets... After launching the architecture under the "x86-64" name, AMD renamed it AMD64... x86-64 is still used by many in the industry as a vendor-neutral term, while others, notably Sun Microsystems (now Oracle Corporation) and Microsoft, use x64.

Even if you have an intel CPU, you should use AMD64 to install 64-bit on your computer (it uses the same instruction sets).

I highly recommend using it. For the most part you will not notice a difference but for large workloads (such as video editing, gaming, etc), the computer will perform faster (the computer has the ability to calculate 2+2+2=6 instead of having to do 2+2=4+2=6 in an example). In the Windows world, a 32-bit OS will not let you use more than 3.5 Gigs of RAM on your computer (even if you have 8!). You'd need to use a 64-bit OS in order to fully use all RAM. For Linux, however, there's no such limit (thanks, Uri).

Regardless, the world has shifted from 32 bit and it's only there to support older machines that are incapable of running 64 bit.


Ubuntu 12.04: cannot install apache2-common

I've tried a fresh 12.04 LTS install. The key issue is I've added the ppa:ondrej/php5 repo for php 5.4. This includes apache 2.4 without development headers. As a result I have Apache 2.4.6 installed, but when I go to install development headers the package index only finds it for 2.2.

If I am to stay with 12.04, it appears I can only get results by compiling from scratch.

If I want managed packages for php 5.4 and apache 2.4, I cannot stay with 12.04 LTS.

Note that everything would be fine if I only needed normal PHP and static pages. I need to install Phusion Passenger for Rails also, so 12.04 is not an option.

I will try upgrading to 13.10 and comment here again.


You have a couple of options

1) You can use preseeding

2) You can use Kickstart

3) CloudInit

If you are familiar with Windows Answer files the first two options will be familiar to you. Option 3 is primarily used in "cloud" environments, but it is possible to generate your own "cloud" image that you just roll out and use CloudInit to configure.

I personally use Kickstart because I deal with more than just Ubuntu servers and it standardizes my installation files.


After waiting long enough the process was complete and I got wxPython 4 installed.

run

sudo apt install make gcc libgtk-3-dev libwebkitgtk-dev libwebkitgtk-3.0-dev libgstreamer-gl1.0-0 freeglut3 freeglut3-dev python-gst-1.0 python3-gst-1.0 libglib2.0-dev ubuntu-restricted-extras libgstreamer-plugins-base1.0-dev

sudo pip install wxpython or sudo pip3 install wxpython
wait for a while for it to install

after completion, you will see this message.

The directory '/home/user-ii-6/.cache/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.

The directory '/home/user-ii-6/.cache/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
Collecting wxpython
  Downloading https://files.pythonhosted.org/packages/dd/31/bd55ab40e406a026a7fda0bb5eb61f466682544ae91ac26267c750f5e618/wxPython-4.0.3.tar.gz (68.5MB)
    100% |\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588| 68.5MB 929kB/s
Requirement already satisfied: six in ./.local/lib/python2.7/site-packages (from wxpython) (1.11.0)
Requirement already satisfied: PyPubSub in ./.local/lib/python2.7/site-packages (from wxpython) (4.0.0)
Requirement already satisfied: typing in ./.local/lib/python2.7/site-packages (from PyPubSub->wxpython) (3.6.6)
Installing collected packages: wxpython
  Running setup.py install for wxpython ... done
Successfully installed wxpython-4.0.3


Determining the geometry parameters of a running terminal

wmctrl -lG

xprop -spy

Also see fred.bear's answer in Get Window size in shell .

More info is available in How to programatically manipulate application windows? .


Form the image that you included, it looks like you're running Cairo Dock, and probably have the top bar disabled.  Check your dock preferences, so you can enable the top bar.

Just right click on the bottom dock-->Cairo Dock-->Add.

Note: notice that there is no top bar.


Why I can not run PHP or JSP applications on apache2.2 ?( var/www)

Installing the CLI version of PHP does not install PHP for Apache. For that, you need to install the libapache2-mod-php5 package.


error: parsing file '/var/lib/dpkg/updates/0001' near line 0: newline in field name `#padding'

Make a backup and remove the /var/lib/dpkg/updates/0001 via

sudo mv /var/lib/dpkg/updates/0001 /var/lib/dpkg/updates/0001.X

After that

sudo dpkg --configure -a
sudo apt-get install -f


In that case, you should install it somewhere beneath /, excluding the mountpoints /home and /var.

A good candidate would be /opt/anaconda/<version>, which opens the opportunity to install different versions of anaconda.

Assuming you are talking about Python Anaconda, you then have to call python with the full path

/opt/anaconda/<version>/bin/python

or extend your PATH variable. E.g. add the line as follows in your ~/.bashrc.

export PATH=$PATH:/opt/anaconda/<version>/bin

Please not that <version> has to be replace with an actual number like `2.7' or whatever makes sense to you.


Script to close and reopen a program every hour, loop not working

Whatever is written in that loop....as long as there are no terminal errors the script should loop.

It seems though that the "done" on the last line is not executed. In that case you probably forgot to add a LF  (i.e. Enter) to the last line.


I found the solution to my question just 2 days ago.

In order to be able to switch quickly between work and home, I wanted to write a script which changes my proxy configuration for all applications at once. Most of the applications were easy, they all had some kind of configuration file, for which I just created a copy to use for work and for home.

The system proxy however, is saved in gconf. To make switching easy, I went to the network settings, changed the proxy to manual and entered all my information for the proxy (host & port).

Then if I wanted to surf without proxy, I simply had to execute the following command:

gsettings set org.gnome.system.proxy mode 'none'

In order to switch back to the proxy connection I had to use the following command:

gsettings set org.gnome.system.proxy mode 'manual'

No need to specify host & port again, since those are already saved. If, however, you have to work with several proxies and would need to switch between different hosts, you can specify the proxy data with the following commands:

gsettings set org.gnome.system.proxy.http port 8080

gsettings set org.gnome.system.proxy.http host 172.16.1.1

Changes take effect immediately.

Source


How to see history of files downloaded by uGet?

Sorry about this one. The answer is in uGet itself. It only a question of specifying historical fields enough per category


I eventually traced this problem to the cable. I swapped it with the other apple cable I had (also original from an older iPhone) and it worked.

Note that the output of fdisk and lsusb were as above, but the phone was mounted in the file manager.


Instead of using gparted you can use the command line application fdisk or cfdisk.

If the second partition really happens to be not present, I assume you need to use some recoverytools as for example foremost. I recommend to take the problematic drive out of the computer if possible and plugg it into another computer, since you will need free space as much as at least your lost data was.

edit:

One thing I noticed to what you wrote in 1.

/dev/sda and /dev/sdb are drives. Each of them can be partitioned by itself. the partitions are named /dev/sda1 /dev/sda2 or /dev/sdb1 and so on.

So you had two drives on the system.

I'm not sure what you mean with

  GParted sees both partitions

since the named paths were drives not the partitions on the drives.

sudo fdisk -l /dev/sdX (replace X for a or b) should list you the partitions on the drives.


How can I make apt upgrade skip packages with “unmet dependencies” and upgrade the rest?

Apt considers 'unmet dependencies' to be a critical and usually fatal error: The software lacks files that the packager felt it needs for minimal function. The error cannot be bypassed, muted, or ignored.

It is not related to apt's marking (hold) feature.

In MOST cases (but not this case!) a 'missing dependency' error is caused by a user's mistake with an unwise source or unfortunate package version, and is most easily corrected by simply undoing the mistake or by agreeing to apt's package-based solution. If you found this solution by searching, this probably applies to you.

Dependencies are often between packages that come from entirely different upstreams, and there is room for disagreement. If you disagree with the packager's decision and can recommend an alternative that enhances the package's usefulness, please feel free to raise a bug or contact them directly to discuss how the packaging and requirements can be refined. Most deb packagers are volunteers.

If you have the skills, you can avoid the problem entirely by installing the software using a non-deb method. This method is more complex than using packages, and is NOT recommended for beginners.


upgraded to 14.04 LTS, VLC is not working

Try purging the configuration files and install again -

sudo apt-get purge vlc*

sudo apt-get clean

sudo apt-get install vlc

In case VLC starts working after vlc --ignore-config, the config files are broken.

To reset them - vlc --reset-config


Solved it

from this link in ubuntuforums.org. In the post, Jsonwco writes:

  It appears that it's related to accessibility settings. I was able to
  fix this problem on my system by opening Universal Access, enabling
  then disabling the screen reader, then opening Synaptic again.


The error is in the log:
Fatal error: cannot allocate memory for the buffer pool

As a quick solution you have here 2 options:

add more RAM to the server, or

decrease the value of innodb-buffer-pool size in the config file:
innodb_buffer_pool_size = 10M


Default owners/permissions of files in user home directory

NO file in ~ has to be owned by root.

If a software requires that a file in your home directory be owned by another user, it is a bug and should be reported as such.

Other than that, a common case involves two security-related software that require restricted permissions on certain files, namely:

SSH
GPG

SSH

See man ssh, section FILES:

 ~/.ssh/config
     This is the per-user configuration file.  The file format and
     configuration options are described in ssh_config(5).  Because of
     the potential for abuse, this file must have strict permissions:
     read/write for the user, and not writable by others.  It may be
     group-writable provided that the group in question contains only
     the user.

 ~/.ssh/identity
 ~/.ssh/id_dsa
 ~/.ssh/id_ecdsa
 ~/.ssh/id_ed25519
 ~/.ssh/id_rsa
     Contains the private key for authentication.  These files contain
     sensitive data and should be readable by the user but not acces‐
     sible by others (read/write/execute).  ssh will simply ignore a
     private key file if it is accessible by others.  It is possible
     to specify a passphrase when generating the key which will be
     used to encrypt the sensitive part of this file using 3DES.

Other files like authorized_keys, known_hosts, etc. should be writable only by the user, but can be world-readable.

GnuPG

~/.gnupg (and contents) should be accessible only by you. With other permissions, GPG will complain about unsafe permissions.


NVIDIA driver not working on Ubuntu 18.04

As pointed out by @Marmayogi, my issue was that I was running the Wayland display server.

I had to reconfigure the Xorg display server with sudo dpkg-reconfigure xserver-xorg, rebooted and switched to it. Now the NVIDIA driver 418 works correctly.


It works if you change the shortcut for the HUD from ALT to whatever you like.

How do I modify or disable the HUD's use of the Alt key?


Unable to get sound in headset on Ubuntu 13.4

l have HP dv6 and was having the same problem. l fixed it by terminal / alsamixer.

Open a terminal. (The quickest way is the Ctrl-Alt-T shortcut.)
Enter alsamixer” and press the Enter key.
You will now see a user interface. In this user interface, you can do the following:

Select your correct sound card using F6 and select F5 to see recording controls as well
Move around with left arrow and right arrow keys.
Increase and decrease volume with up and down arrow keys.
Mute / Unmute with the M key. An MM means muted, and OO means unmuted.
Exit from alsamixer with the Esc key.

A caveat here: When you mute or unmute something, pulseaudio might pick it up and mute and unmute other controls, as well as PulseAudio’s main mute.


How do I make a live USB with a binary file?

Well make a chrome OS bootable USB, and change the booting order in bios to boot your USB first. Then on booting you will see chrome os loading. First time it will show up with set up wizard but won't install it in your hdd and  latter you will see login screen next time boot onwards. You can use this same USB in anywhere to boot chrome os.

Making USB a ChromeOS bootable

Linux : You can use dd command as follows :

Note: here in command, you need to give your correct USB device in "of=/dev/sd#"  say "of=/dev/sdb". So beware using it, if you gave wrong device like your hdd - it can overwrite it.

dd if=image.img of=/dev/sd# bs=4M

Windows : Use DiskImager like software to make a bootable USB of chrome os.


How I can I group emails by domain, combined and summarized from all files in a directory?

A python way, using itertools' groupby():

1. Write output per file (of all files in a directory) in the terminal

N.B. Mind that the terminal shows a limited number of lines

#!/usr/bin/env python3
from operator import itemgetter
from itertools import groupby
import os
import sys

dr = sys.argv[1]

for f in os.listdir(dr):
    lines = [[l.strip(), l.split("@")[-1].strip()] for l in \
             open(os.path.join(dr, f)).readlines()]
    lines.sort(key=itemgetter(1))
    for item, occurrence in groupby(lines, itemgetter(1)):
        func = [s[0] for s in list(occurrence)]; print(item+","+",".join(func))

To use

Copy the script into an empty file, save it as group_domains.py
Run it with the targeted directory as argument:

python3 /path/to/group_domains.py /directory/with/files

Output will be like:

example.com,%1%3@example.com,%1@example.com
numberland.com,%.getincontact@numberland.com
wanadoo.fr,%%%%%%@wanadoo.fr
yahoo.com,%%%%%%%%%%@yahoo.com,%%nameemail%%@yahoo.com
yahoo.comravi,%%%%raviplywoodglasscentre@yahoo.comravi

Notes

As it is, the script creates an output per file in the terminal. We could easily combine (summarize) the output(s) of the separate files, and subsequently write the grouped result into a file etc., but please mention.

Explanation

In the concept:

The file's lines are read, and split by "@" to read the domain
The created list is subsequently sorted by domain:

lines.sort(key=itemgetter(1))

and grouped by domain:

groupby(lines, itemgetter(1))

The outcome (line) is made of the item (domain) and its "members".

2. Write report per file (again of all files in a directory) into renamed files.

The script below will write the output into a renamed file, usage is the same:

#!/usr/bin/env python3
from operator import itemgetter
from itertools import groupby
import os
import sys

dr = sys.argv[1]

for f in os.listdir(dr):
    write = []
    file = os.path.join(dr, f)
    lines = [[l.strip(), l.split("@")[-1].strip()] for l in open(file).readlines()]
    lines.sort(key=itemgetter(1))
    for item, occurrence in groupby(lines, itemgetter(1)):
        func = [s[0] for s in list(occurrence)]
        write.append(item+","+",".join(func))
    open(os.path.join(dr, "grouped_"+f), "wt").write("\n".join(write))

from a file like:

some_list.txt

it will create a renamed one:

grouped_some_list.txt

To use

simply:

python3 /path/to/group_domains.py /directory/with/files

3. Write a report (summary) on the whole directory into a single file

The version below will summarize all domains inside the files in a directory. The report is saved in a file, to set as second argument.

#!/usr/bin/env python3
from operator import itemgetter
from itertools import groupby, chain
import os
import sys

dr = sys.argv[1]
outfile = sys.argv[2]

report = []

for f in os.listdir(dr):
    lines = [[l.strip(), l.split("@")[-1].strip()] for l in \
             open(os.path.join(dr, f)).readlines()]
    lines.sort(key=itemgetter(1))
    for item, occurrence in groupby(lines, itemgetter(1)):
        func = [s[0] for s in list(occurrence)]
        report.append([item, func])

report.sort(key=itemgetter(0))

with open(outfile, "wt") as out:
    for item, occurrence in groupby(report, itemgetter(0)):
        func = [item for sublist in [it[1] for it in list(occurrence)] for item in sublist]
        out.write(item+","+",".join(func)+"\n")

To use

Copy the script into an emty file
Run it:

python3 /path/to/group_domains.py /directory/with/files /path/to/outputfile.txt

(or whatever extension)

Notes

The last version will first summarize per file, as mentioned in the question, and additionally summarize all files into an output file, where similar domains from the separate files will be combined into one line per domain.


How to set up LAMP server on Ubuntu 18.04 LTS?

Open the terminal and type:

sudo apt update
sudo apt install lamp-server^
sudo apt install phpmyadmin -y


WiFi is not working in Lenovo E580 after installing Ubuntu 18.04

Thanks everybody for giving answers. When I enter the modprobe command the response is

error:could not insert '8821ce':required key not available

It seems this issue happens only on UEFI systems with enabled Secure Boot. Then disabling Secure Boot in UEFI (BIOS) settings solved the problem.

Thanks once again for giving me a clue.


Problems with updating my graphics driver to Nvidia 430

You can install Nvidia 430 driver without adding any PPA.

sudo apt install nvidia-driver-430

https://packages.ubuntu.com/search?keywords=Nvidia&searchon=names&suite=bionic-updates&section=all


Can not remove sublime text 2 because of installing package control

You might be able to simply revert to freshly installed state.

Linux: ~/.config/sublime-text-2

To revert to a freshly installed state, you can:

Exit Sublime Text 2
Delete (or move) the data folder, as listed above
Start Sublime Text 2

When restarted, a fresh data folder will be created, just as it was the first time you ran Sublime Text 2. Keep in mind that this will also remove all of your settings, and packages you may have installed.

source: http://www.sublimetext.com/docs/2/revert.html

If you want to uninstall it here's an example of how to install/uninstall

Open the terminal and use the following commands to install Sublime Text 2 Editor:

sudo add-apt-repository ppa:webupd8team/sublime-text-2

sudo apt-get update

sudo apt-get install sublime-text

How to uninstall Sublime Text 2 Editor:

sudo apt-get remove sublime-text

sudo add-apt-repository --remove ppa:webupd8team/sublime-text-2

sudo apt-get update

source: http://itsfoss.com/how-to-easily-install-sublime-text-2-editor-in-ubuntu/


Can I recover data from a corrupt partition?

Try taking a look at  how to recover partition data.

If this doesn't work there are other methods of file recovery as noted in this post.


Problem while creating the 95proxies file

Give the filename as well:

sudo -H gedit /etc/apt/apt.conf.d/95proxies

And please do not use sudo with graphical programs directly. Use gksudo, or sudo -H.


Repair Windows 8 after install ubuntu using Install alongside windows 8

Try using Boot repair from a live CD.  Use option 2 here:  https://help.ubuntu.com/community/Boot-Repair

should fix your problems.


I don't understand why, but I rebooted with the 4.10 kernel instead of the 4.13 and it fixed the issue.

I think the issue is with the latest Kernel update.


Ah, what the heck. I'll take a stab at answering it anyhow.

Short answer: remove the \n from the argument to scanf. When I do this, your code behaves as expected (well, to be persnickety, I also had to change argv[] into *argv[].)

Longer answer: you shouldn't really ever use scanf; it usually gets you into trouble.

Hmm... my longer answer was shorter than my short answer. Ah well.


What gzip -r does, gunzip -r undoes:

$ gzip foo -r
$ find foo
foo
foo/d
foo/d/1.gz
foo/a
foo/a/3.gz
$ gunzip -r foo
$ find foo
foo
foo/d
foo/d/1
foo/a
foo/a/3


In the 18.04 (Bionic) repositories there's currently a package available for installation.

Before you can install it you need to enable the Universe repository and then simply issue the command sudo apt install mono-complete


Renaming a bunch of files using Command-line

I will assume that you want to keep a proper suffix on the filenames:

c=1; for f in *.jpg ; do mv "$f" "photo$c.jpg" ; c=$(($c+1)) ; done

Notes

c=1:  This initalizes the counter.  You can set it to any number you like.
for f in *.jpg ; do:  This signifies the beginning of a shell for-loop.  While much of shell-scripting can be difficult to make work when file names can contain spaces, newlines or other difficult characters, this construction is safe against even the most hostile file names.
mv "$f" "photo$c.jpg":  This uses the counter c and does the actual renaming of files.  The file name $f is in double-quotes to protect the name from the various possible shell expansions.
c=$(($c+1)): This increments the counter for the next loop
done:  The signifies the end of the for loop.


How to run Thunderbird in the background?

I recommend (and use) FireTray, which you can get at https://addons.mozilla.org/en-us/thunderbird/addon/firetray/.

It will keep Thunderbird running in the background, and then notify you of new emails.


Gnome Desktop internal HDD position moves

Mounted drives will usually appear randomly on the desktop, you may just click and drag the icon and position it as you wish... You can also right-click desktop and disable the 'keep aligned' option.


Re-installing Ubuntu 12.04 using Windows Installer

The problem is that you damaged your bootloader after the reinstall. It needs to be repaired. First boot in your pc using a Ubuntu live cd / usb and use live boot. After Ubuntu boots up you need to install and run Boot-repair boot-repair . When that is done click Recommended Repair, reboot and done.

You can also use the terminal: Now bring up a terminal (ctrl alt t) and type:

sudo grub-install /dev/XXX

where XXX is the device of your Ubuntu install. (eg: grub-install /dev/sdb)
You can also use /dev/disk/by-label/ if the partition you installed on has a label. You can determine the /dev node for such a device by running:

ls -l /dev/disk/by-label/

You can also run Fdisk. That will give you something like:

t         End      Blocks   Id  System
/dev/sdb1   *           1$ sudo fdisk -l

Disk /dev/sda: 160.0 GB, 160041885696 bytes
255 heads, 63 sectors/track, 19457 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x0001bc54

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1       18725   150403072   83  Linux
/dev/sda2           18725       19458     5884929    5  Extended
/dev/sda5           18725       19458     5884928   82  Linux swap / Solaris

Disk /dev/sdb: 15.1 GB, 15103033344 bytes
64 heads, 32 sectors/track, 14403 cylinders
Units = cylinders of 2048 * 512 = 1048576 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00068852

   Device Boot      Star       14403    14748656    c  W95 FAT32 (LBA)


Triple boot with Ubuntu 16.04, Windows 10 and SuSE Leap, can't see partitions during installation

You can create a 16.04 Live usb on your windows 10 Partition by using a program called Rufus and an Ubuntu 16.04 iso:

Rufus Download (https://www.google.com/url?sa=t&rct=j&q=&esrc=s&source=web&cd=1&ved=0ahUKEwjQ5teN3aXNAhXJVhoKHRymCU8QFggeMAA&url=https%3A%2F%2Frufus.akeo.ie%2F&usg=AFQjCNGeuqrM--4SkP8QoxA61Q4KwAEIHQ&sig2=wnUHRR-9bNV1T_Ofi64bVw)

Ubuntu 16.04 Download (http://www.ubuntu.com/download/desktop/contribute/?version=16.04&architecture=amd64)

Steps to install:

make the live usb by following the steps on the rufus website (if you need further assistance dont hesitate to ask)
reboot your PC and boot to the flash disk

(once youre in the Ubuntu install menu:)

Install Ubuntu
Select if you want or just click continue
Click "Something Else"
Find the empty partition you allocated to Ubuntu
Define the root file system

The OS should install and appear on the grub menu. If this does not work you could try deleting the partition leaving it as "free space" and formatting it withing the live installation menu.

Hope this helps


Inserting #' to a configuration file using sed

The solution you're after is:

sed -i '33s/^/#/' /path/to/file


cifs mount fails with "mount error(112): Host is down"

You can disable the entry in /etc/fstab and issue the following command

mount -t cifs //192.168.1.1/usbdisk /media/public -o guest,vers=3.0

and at the same time play around with different options (behind -o). If you need feedback from you system, you might open a second terminal windows and type journalctl -fb to watch how the kernel reacts on your options given.

I explain all this because your real issue might be different with cifs than it was in my case.

I had the problem that the device offering SMB wants ver=1.0. While Ubuntu 17.04 didn't have any problems with the version (auto), the 17.10 and its kernel demands to indicate the number, as my Kernel logs shows:

Okt 25 09:06:08 gespc kernel: No dialect specified on mount. Default has changed to a more secure dialect, SMB3 (vers=3.0), from CIFS (SMB1). To use the less secure SMB1 dialect to access old servers which do not support SMB3 specify vers=1.0 on mount. For somewhat newer servers such as Windows 7 try vers=2.1.

My Good luck!


upgrade from ubuntu 13.04 to 13.10 causes vmware workstation 9 problems

So I found that by following these patches here

To apply:

cd /usr/lib/vmware/modules/source
tar -xf vmnet.tar
tar -xf vmblock.tar
cd vmnet-only
patch -p1 < ~/Downloads/procfs.patch
cd ../vmblock-only
patch -p1 < ~/Downloads/vmblock.3.10.patch
patch -p1 < ~/Downloads/vmblock.3.11.patch
cd ..
tar -cf vmblock.tar vmblock-only
tar -cf vmnet.tar vmnet-only
vmware-modconfig --console --install-all

You can download the patches here

I am able to start mine just fine as myself.  I hope that this helps anyone else who is having VMWare Workstation 9 issues on Saucy.


Ubuntu 12.04 - I can ssh into the server but sshd is an unrecognized service

The SSH server service in Ubuntu is named "ssh". Just run sudo service ssh restart to restart it.


Any way to get a fresh ubuntu desktop without re-installing?

I do this occasionally, using aptitude. Aptitude is a console ("old-skool") tool that's powerful but a little tricky to get to use. It's like vim or emacs, when Ubuntu Software Center is like Gedit or AbiWord :-) Nevertheless, there's a good way to achieve your goal in aptitude, so if you're willing to give it a try, this might work for you.

First install aptitude:

sudo apt-get install aptitude

You might want to read the docs for aptitude. If you don't, you'll be following my directions below blind, and could fly into a mountainside that leaves your system unbootable, in which case you'll need to try one of the "careful reinstall" options where you do a fresh install trying to preserve your personal data along the way. The docs for aptitude are at:

zless /usr/share/doc/aptitude/README

Now, go into aptitude. I'll tell you a series of keys to press. The case (upper or lower) is significant: U is different to u.

sudo aptitude

u
    (this updates the package database. press enter  to clear any warnings that popup afterwards)

arrow down to the section called "Installed packages"

M
    (this marks every package as automatically installed, so it schedules all of them for removal. don't quit now or you'll be in trouble)

/
    (this opens a search dialog)

ubuntu-desktop [ENTER]

+(this tells aptitude you want to install ubuntu-desktop and all dependencies)

[ENTER] (goes into the details for the ubuntu-desktop package)

arrow down to the "Recommends" line

+ (tells aptitude to install all the recommended packages too)

g ("go" - will tell you what it wants to do)

g (confirms that you want to do it, and gets going)

That should leave you fully up to date, with a relatively clean, minimal desktop system.

If you get stuck, hit ? for help in aptitude. You may need to use a or z to scroll up and down in various places. I did say it was old-skool :-) But once you know how to use it, you can get a lot of detailed package management done quickly.


Snap "strict" applications under Ubuntu 20.04 can't access mounted folders under /home/user/?

It is up to the snap package to configure the permissions and have access either to the home folder, or to mounted devices. If you are a creator of a snap package, you can either enable permissions yourself, or you need to ask explicitly at the Snapcraft Forum to have it enabled it for you, for the specific package that you are creating.
These permissions are known as interfaces and you can find the full list at https://snapcraft.io/docs/supported-interfaces Those in the list that are auto-connect, it means that the packager can configure them themselves without asking for permission. But those that are not auto-connect, they have to visit https://forum.snapcraft.io/ and start a new thread asking to have it enabled for their package.
The two interfaces that you are asking, are personal-files and removable-media. Neither of these are auto-connect.
Here are the interfaces for the LibreOffice snap package:
$ snap interfaces libreoffice
Interface                 Plug                                Slot                             Notes
audio-playback            libreoffice:audio-playback          :audio-playback                  -
bluez                     libreoffice:bluez                   -                                -
content[gnome-3-28-1804]  libreoffice:gnome-3-28-1804         gnome-3-28-1804:gnome-3-28-1804  -
content[gtk-3-themes]     libreoffice:gtk-3-themes            gtk-common-themes:gtk-3-themes   -
content[icon-themes]      libreoffice:icon-themes             gtk-common-themes:icon-themes    -
content[sound-themes]     libreoffice:sound-themes            gtk-common-themes:sound-themes   -
cups-control              libreoffice:cups-control            :cups-control                    -
desktop                   libreoffice:desktop                 :desktop                         -
desktop-legacy            libreoffice:desktop-legacy          :desktop-legacy                  -
gsettings                 libreoffice:gsettings               :gsettings                       -
home                      libreoffice:home                    :home                            -
network                   libreoffice:network                 :network                         -
network-bind              libreoffice:network-bind            :network-bind                    -
opengl                    libreoffice:opengl                  :opengl                          -
pulseaudio                libreoffice:pulseaudio              :pulseaudio                      -
removable-media           libreoffice:removable-media         :removable-media                 -
screen-inhibit-control    libreoffice:screen-inhibit-control  :screen-inhibit-control          -
unity7                    libreoffice:unity7                  :unity7                          -
wayland                   libreoffice:wayland                 :wayland                         -
x11                       libreoffice:x11                     :x11                             -

removable-media is in the list, and they asked for permission in this thread.
Therefore, if a snap package cannot open removable media, it is an issue of the packager not asking for permission for removable-media, or they  may have asked but it was declined.
Having said all that, you can bypass the snap package security by using the --devmode parameter. This gives you full access, as if you have installed a deb package. Note that you need to have some assurances that the snap package is OK, because anyone can create snap packages on the Snap Store and you will be disabling all security protection for this package.
Here is how to do that:
sudo snap install somesnappackage --devmode


can you try that?

$ sudo dpkg --configure -a

If this useless, you can try to remove /etc/dpkg/dpkg.cfg.d/multiarch (or better backup), then issue

$ sudo dpkg --add-architecture foreign-architecture


I have had the same but this was when gnome-flashback has been installed once removed everything seemed to go back to normal. Try doing an update, upgrade and distribution upgrade. As this was broken by a gtk update.


Ubuntu 18.04: Cinnamon is currently running without video hardware acceleration

I solved the issue.

I went onto recovery mode, and used fix broken packages options and apt-get clean.

It then reboot without a graphics driver, then I reinstalled them, and it all works again!


"Access denied for user 'root'@'localhost'" when updating vendors in a symfony app while deploying on a remote server

You need to change your database password in app/config/parameters.yml file, to match the actual database password for your application. It appears that current parameters are the default ones (user "root" with empty password)


Try changing the primary hdd back to the 20 GB SSD,

Plug the stick in your EEE, press ESC during the ASUS boot-screen to get the boot select list. Select your USB-stick as the boot device. And Xubuntu should start now and you can install it on your internal SSD-disk (or continue to use the stick as a Linux Live OS).


Maybe hibernation is state you can use. In hibernation mode all OS copies all RAM contents to HDD and totally power off itself. But on boot it copies all contents back to RAM and that process is not so fast (in case you have slow HDD and alot of RAM). You can read more here


'X Error of failed request: BadRequest (invalid request code or no such operation)' after installing the AMD binary driver on 12.10

Currently there is no AMD driver available that installs and is able to run Unity successfully. For more information and follow up on the bug please check out this post

Unity does not start after installing the fglrx drivers

Remove the proprietary driver and use the open-source one for now.


Ubuntu 16.04 cannot detect second monitor

With your Intel Skylake processor others have reported freezing when an external monitor was connected. Some found upgrading to kernel 4.4.25 solved that problem. However since this kernel version is outdated the current version 4.4.33 would be a better.

To install 4.4.33, use:

cd /tmp
wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v4.4.33/linux-headers-4.4.33-040433_4.4.33-040433.201611180742_all.deb
wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v4.4.33/linux-headers-4.4.33-040433-generic_4.4.33-040433.201611180742_amd64.deb
wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v4.4.33/linux-image-4.4.33-040433-generic_4.4.33-040433.201611180742_amd64.deb
sudo dpkg -i *.deb
sudo reboot

To improve your question you can list your Nvidia card model number, ie GTX 1060 and Nvidia driver in use, ie 367.57. Also where you obtained the driver, ie System Settings -> Software & Upgrades -> Additional Drivers or Nvidia ppa, etc.

The more information you provide, the better chances of success.

Edit 1 - Try Intel only settings

Isolate if it's a Nvidia problem or Intel system problem by turning off Nvidia and using Intel graphcis. Run Nvidia's X Server Settings from Dash or the terminal by typing nvidia-settings.

Change your settings like so:

Save, Quit and reboot.

If the external monitor doesn't work on reboot we need to focus on Intel microcode, driver configuration, etc. If the external monitor works on reboot we need to focus on Nvidia Driver 375, X-Org serttings, etc.


As I was reading the first paragraph, I was thinking about fail2ban.

The biggest issue here is detecting a bad user. If you do that manually, skip fail2ban and use sudo ufw deny from 1.2.3.4. That will be a permanent block but there you go.

fail2ban works best when your system (any service, including a dynamic website) sends things to the logs (syslog or service specific). fail2ban then has a stack of things to look for and then what to do if it finds things.

For example, I'm currently employing a fail2ban plugin for Wordpress that sends events to syslog. fail2ban detects three incorrect tries and then blocks the IP for five minutes. It's genius stuff that has pretty much entirely blocked brute force attacks. I mention that plugin as it's a good example of a simple custom-written ruleset. It's easy to see how it works and adapt it for your own needs.

Email notification is pretty simple but you can go further and email nmap scans back. Thinking about it, it might be worth running the IP through a whois, extracting the abuse email and automatically sending an abuse report when you ban a user (explaining why).


What worked for me was installing compizconfig-settings-manager, checking off "enable Unity plugin" and setting the Hide Launcher mode--Unity ran fine before this, just didn't dock.

!


You can use xinetd for that.

In this example I'll show how to redirect incoming connections to IPv6 address 2001:db8::1 port 1234 to IPv4 address 192.0.2.1 port 1234. I'll call the configuration/service 'demo':

Put the following configuration in a configuration file called /etc/xinetd.d/demo:

service demo
{
    type            = UNLISTED
    port            = 1234
    bind            = 2001:db8::1
    socket_type     = stream
    wait            = no
    user            = nobody
    redirect        = 192.0.2.1 1234
}

It also lets you control who can access the service in both the service definition and the /etc/hosts.allow and /etc/hosts.deny files.

service demo
{
    ...
    only_from       = 2001:db8::/32
    no_access       = 2001:db8:ffff::/48
    ...
}

Other potentially useful option:

service demo
{
    ...
    access_times    = 09:45-16:15
    log_on_success  = HOST DURATION
    log_on_failure  = HOST ATTEMPT
    ...
}


Short answer:

bad : It shows Systemd Unit files enablement status
you will see this sort of message on systems which use systemd
you can check the enablement status using command:

sudo systemctl is-enabled <unit-name>

if that unit file is a native systemd service then it will give output enabled, disabled, etc. If it is not a native systemd service then it will give report a message like.

sudo systemctl is-enabled apache2
apache2.service is not a native service, redirecting to systemd-sysv-install
Executing /lib/systemd/systemd-sysv-install is-enabled apache2
enabled

but with command :

systemctl status apache2
or
service apache2 status

it gives status bad. (maybe it is because it is not able to print a complete message or developer decided to print bad)

Long Answer:

what are system unit files ?

Units are the objects that systemd knows how to manage. These are basically a standardized representation of system resources that can be managed by the suite of daemons and manipulated by the provided utilities. It can be used to abstract services, network resources, devices, filesystem mounts, and isolated resource pools.
You can read in detail about systemd units here and here

example:

systemctl status apache2
* apache2.service - LSB: Apache2 web server
   Loaded: loaded (/etc/init.d/apache2; bad; vendor preset: enabled)
  Drop-In: /lib/systemd/system/apache2.service.d
           `-apache2-systemd.conf
   Active: active (running) since Wed 2016-10-12 14:29:42 UTC; 17s ago
     Docs: man:systemd-sysv-generator(8)
  Process: 1027 ExecStart=/etc/init.d/apache2 start (code=exited, status=0/SUCCESS)

systemctl will check if apache2 is a native unit or not. If not, then it
will ask systemd-sysv-generator to generate a file in unit format that provides support similar to native units. In the above example, the generated file is kept at
/lib/systemd/system/apache2.service.d/apache2-systemd.conf

Drop-In: /lib/systemd/system/apache2.service.d
               `-apache2-systemd.conf

Note: you can find the generator at /lib/systemd/system-generators/systemd-sysv-generator and you can read more about that

man systemd-sysv-generator

Main point:

is-enabled NAME...
       Checks whether any of the specified unit files are enabled (as with
       enable). Returns an exit code of 0 if at least one is enabled,
       non-zero otherwise. Prints the current enable status (see table).
       To suppress this output, use --quiet.

       Table 1.  is-enabled output
       +------------------+-------------------------+-----------+
       |Name              | Description             | Exit Code |
       +------------------+-------------------------+-----------+
       |"enabled"         | Enabled via             |           |
       +------------------+ .wants/, .requires/     |           |
       |"enabled-runtime" | or alias symlinks       |           |
       |                  | (permanently in         | 0         |
       |                  | /etc/systemd/system/,   |           |
       |                  | or transiently in       |           |
       |                  | /run/systemd/system/).  |           |
       +------------------+-------------------------+-----------+
       |"linked"          | Made available through  |           |
       +------------------+ one or more symlinks    |           |
       |"linked-runtime"  | to the unit file        |           |
       |                  | (permanently in         |           |
       |                  | /etc/systemd/system/    |           |
       |                  | or transiently in       | > 0       |
       |                  | /run/systemd/system/),  |           |
       |                  | even though the unit    |           |
       |                  | file might reside       |           |
       |                  | outside of the unit     |           |
       |                  | file search path.       |           |
       +------------------+-------------------------+-----------+
       |"masked"          | Completely disabled,    |           |
       +------------------+ so that any start       |           |
       |"masked-runtime"  | operation on it fails   |           |
       |                  | (permanently in         | > 0       |
       |                  | /etc/systemd/system/    |           |
       |                  | or transiently in       |           |
       |                  | /run/systemd/systemd/). |           |
       +------------------+-------------------------+-----------+
       |"static"          | The unit file is not    | 0         |
       |                  | enabled, and has no     |           |
       |                  | provisions for enabling |           |
       |                  | in the "[Install]"      |           |
       |                  | section.                |           |
       +------------------+-------------------------+-----------+
       |"indirect"        | The unit file itself is | 0         |
       |                  | not enabled, but it has |           |
       |                  | a non-empty Also=       |           |
       |                  | setting in the          |           |
       |                  | "[Install]" section,    |           |
       |                  | listing other unit      |           |
       |                  | files that might be     |           |
       |                  | enabled.                |           |
       +------------------+-------------------------+-----------+
       |"disabled"        | Unit file is not        | > 0       |
       |                  | enabled, but contains   |           |
       |                  | an "[Install]" section  |           |
       |                  | with installation       |           |
       |                  | instructions.           |           |
       +------------------+-------------------------+-----------+
       |"bad"             | Unit file is invalid or | > 0       |
       |                  | another error occurred. |           |
       |                  | Note that is-enabled    |           |
       |                  | will not actually       |           |
       |                  | return this state, but  |           |
       |                  | print an error message  |           |
       |                  | instead. However the    |           |
       |                  | unit file listing       |           |
       |                  | printed by              |           |
       |                  | list-unit-files might   |           |
       |                  | show it.                |           |
       +------------------+-------------------------+-----------+

if we run the command :

sudo systemctl is-enabled ssh
enabled

sudo systemctl is-enabled docker
enabled

sudo systemctl is-enabled apache2
apache2.service is not a native service, redirecting to systemd-sysv-install
Executing /lib/systemd/systemd-sysv-install is-enabled apache2
enabled

you can see if units are native to systemd like ssh and docker, in the above output it will show only enabled, and for units that are not native like apache2 but still enabled it gives messages with that rather than printing bad here because of this condition:

       +------------------+-------------------------+-----------+
       |"bad"             | Unit file is invalid or | > 0       |
       |                  | another error occurred. |           |
       |                  | Note that is-enabled    |           |
       |                  | will not actually       |           |
       |                  | return this state, but  |           |
       |                  | print an error message  |           |
       |                  | instead. However the    |           |
       |                  | unit file listing       |           |
       |                  | printed by              |           |
       |                  | list-unit-files might   |           |
       |                  | show it.                |           |
       +------------------+-------------------------+-----------+

Solution:

status bad will not create problem (i am not sure it depends) but it will not provide all functionality of systemctl.
you can wait for next release of that package that will natively support systemd. or you can write unit file for your service or any other resource using given references.

You can read in detail about systemd , systemctl and units using below References :

Systemctl
Systemd units and Here
Systemd


Yes, IMHO it can be that KDE is too heavy for your PC. I would recommend to move to XFCE (apt install xubuntu-desktop). It is lightweight and so mature that it is by far not only recommended for slow PCs.


How to install Adblock Plus on Firefox in Ubuntu 14.04

Simply install the Adblock Plus addon for Firefox.

Open this URL in your Firefox and click Add to Firefox


League of Legends client continuous patch using Playonlinux?

Sometimes my PoL install of League will appear to start to patch and get caught at 33%.  But if I close and reopen the launcher I can log in.  Not sure if that's the same problem, but hopefully it helps someone!


Trouble Installing ubuntu..USB.. Picture below

It should be nomodeset not nomodestep
but...
you could also try:

nomodeset xforcevesa

or

nomodeset GRUB_GFXMODE=1280x1024x32

However, these are work-arounds, and the end result is not optimal... i.e. the screen is not crisp and clear.


How to erase Ubuntu and reinstall windows 10 on a single-booted system

Installing Windows 10 without USB using Ubuntu GRUB

Backup the Target drive.

Create a 6GB NTFS partition on the hard drive and extract the Windows ISO to it.

Create a 20GB, or larger, NTFS partition on the hard drive for the Windows Installation.

Open Disks, (Gnome-Disks), and note Device, (/dev/sdx), and UUID of the Windows ISO extract partition.

For msdos partition table, copy the following menuentry to /etc/grub.d/40-custom/*:

menuentry 'Windows Recovery Environment (on /dev/sda4)' --class windows --class os $menuentry_id_option 'osprober-chain-592C85254E2CD0B7' {
    insmod part_msdos
    insmod ntfs
    set root='hd0,msdos4'
    if [ x$feature_platform_search_hint = xy ]; then
      search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos4 --hint-efi=hd0,msdos4 --hint-baremetal=ahci0,msdos4  592C85254E2CD0B7
    else
      search --no-floppy --fs-uuid --set=root 592C85254E2CD0B7
    fi
    parttool ${root} hidden-
    drivemap -s (hd0) ${root}
    chainloader +1
    ntldr /bootmgr
}

Edit menuentry, changing sda4 to sdax, msdos4 to msdosx (4 places), and 592C85254E2CD0B7 to UUID, (3 places), to suit step 4 above.

Run sudo update grub confirm that ntldr /bootmgr appears in grub.cfg.

Boot the computer into the newly created Windows menuentry and install Windows into it's new partition.

Reinstall Ubuntu if desired, the GRUB bootloader will have been replaced with the Windows bootloader.

*For gpt partition table, copy the following menuentry to /etc/grub.d/40-custom/:
menuentry 'Windows Recovery Environment (on /dev/sdc1)' --class windows --class os $menuentry_id_option 'osprober-chain-5642BC722509341F' {
    insmod part_gpt
    insmod ntfs
    set root='hd0,gpt1'
    if [ x$feature_platform_search_hint = xy ]; then
      search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt1 --hint-efi=hd0,gpt1 --hint-baremetal=ahci0,gpt1  5642BC722509341F
    else
      search --no-floppy --fs-uuid --set=root 5642BC722509341F
    fi
    drivemap -s (hd0) ${root}
    chainloader +1
    ntldr /bootmgr
}

Boot selecting Windows from the GRUB menu and follow the instructions.
Limitations
Windows 10 has limitations with respect to partition tables and boot modes.
I was able to install Legacy mode Windows to a drive with a MSDOS partition table.
I was able to install UEFI mode Windows to a drive with a GPT partition table.
I was not able to install Legacy mode Windows to a drive with a GPT partition table.
I was not able to install UEFI mode Windows to a drive with a GPT partition table and Legacy mode Ubuntu.
There may be workarounds that are outside the scope of this answer.


It is recommended for old computers to use lite user interface such as XFCE.

I recommend Xubuntu and I would go for that version 14.04 as it is a Long Term Support version till 2019.

You will need to install  " Xubuntu restricted extras " in order to be able to run flash and MPs on your laptop and some other media files.


How to disable global menu and have always visible menu bars

Yes, you should remove some packages. Use:

sudo apt-get remove --purge appmenu-gtk appmenu-gtk3 appmenu-qt firefox-globalmenu thunderbird-globalmenu indicator-appmenu

This will restore application menus in right place.

UPD: there might be a few packages I missed. To find them, open Synaptic and in the search field enter "appmenu", check the found packages for removal, then search for "globalmenu" and remove them too.

Restart/relogin into your X session to finish changes.

Also check this article.


If the logs are not at all important to you, then yes, you can delete the contents of /var/log/journal as well as logs in /var/log ending in a number and/or .gz.
If you would like to limit the size of the journal directory, edit your /etc/systemd/journald.conf file and set the SystemMaxUse option to a value you can tolerate. For example:
SystemMaxUse=250M

If you would like to clear out the /journal directory to a specific size right now, you can do it like this:
sudo journalctl --vacuum-size=250M

This will reduce the journal logs to 250M … give or take.


GNU Grub problem with boot into Windows 10 winload.exe

I don't know what actually happened to your PC, but it may help because when I got GNU grub error I used to use filling commands. May it may help you. I think you have windows 10 installed on you PC and you are using legacy mode, then follow these steps
1.Insert your bootable media of Windows 10(if Windows 10 installed else other)  and boot from it.
2.When you will see the choose language box then press shift +F10 keys and you will see the command prompt opened.
3.Then use these commands

bootrec /fixmbr
bootrec /fixboot

If both commands made succefully then type exit and close everything. Remove your bootable MEDIA.And start your PC normally, and you will be happy. Hope this will work. Reply if worked or not.


DBus error when accessing FTP from Nautilus

I found this ?
https://bugs.launchpad.net/ubuntu/+source/nautilus/+bug/699840


Synaptic can't find firmware-b43-installer

In more recent Ununtu versions, the package is known as linux-firmware-nonfree. You may also need to rebuild the package index. Please try:

sudo apt-get update
sudo apt-get install linux-firmware-nonfree

Detach the ethernet, reboot and you should be all set.


How to install for use on another computer?

Just install Ubuntu as you normally would and install all updates, but stay away from proprietary software!  That way, it'll just boot when you move the HDs as contrarily to Windows, there are no drivers just modules and these are are built into the kernel, so all hardware supported by the kernel will just work out of the box!

Once the hard drive is in the new PC, install the proprietary software like graphics modules and ubuntu-restricted-addons...


Install Realtek 8152 or 8153 drivers on Ubuntu 16.10

Here's what I did to get the driver working on Debian Stretch:

1) Download official driver from realtek: https://www.realtek.com/en/component/zoo/category/network-interface-controllers-10-100-1000m-gigabit-ethernet-usb-3-0-software

2) untar it: # tar xvf ./r8152.53.56-2.12.0.tar

3) make sure you have current kernel headers installed sudo apt install linux-headers-$(uname -r)

4) compile the driver cd r8152_2.12.0 && make

5) install the compiled driver sudo make install


Setting up an automated email forwarding system for a large set of email accounts

Postfix supports a lot of lookup tables and you can use database lookup tables (mysql,pgsql or sqlite)to store such large lists and you need not reload postfix when using them. Say you have a table forwards in your postgres database with columns emailaddress and forwards.

emailaddress         forwards
john@myserver.net    john.doe@someothermail.com
mary@myserver.net    poppins@yetanothermail.com
vlad@myserver.net    vlad@anotheranothermail.com

and you can configure your postfix to use it.

#/etc/postfix/main.cf
#... other main.cf contents omitted
virtual_alias_domains = myserver.net
virtual_alias_maps = pgsql:/etc/postfix/pgsql_forwards.cf
#...

and the content of /etc/postfix/pgsql_forwards.cf should be something like

#/etc/postfix/pgsql_forwards.cf
dbname = emaildb
hosts = db.example.net
user = emailuser
password = somerandompass
query = SELECT forwards FROM forwards where emailaddress='%s';

But first ensure what all lookup tables are compiled with your postfix by running postconf -m. I have seen many using mysql.
And to enable your users to setup forwards themselves, you will have to give them some webapp that will update the database table used by postfix.

Hope that helps.


Installed Ubuntu 11.10 and the system cant boot

I have ended up downloading and installing 10.04. which is running without any problems. all further attempts to fix 11.10 ended with the same problem. thank you all for your help, but i'm not too worried about it at the moment because my laptop works now.


How to write a 'hotcorners' script in Python?

The python-xlib  module will allow you to get the current mouse position. Here's a quick example:

>>> from Xlib import display
>>> d = display.Display().screen().root.query_pointer()._data
>>> print d["root_x"], d["root_y"]

Though, you're in luck. There is already a python script that does exactly what you want from the Crunchbang Linux distro. Take a look at the cb-hotcorners script in the CrunchBang window manager hacks GitHub repo.


store doesn't find non-installed applications

It looks like all the store needed was the machine to reboot. Its working now, although slow.


What is the easiest way to strip a desktop edition to a server edition?

It's possible to do it the other way around, but I've never seen anyone who was able to do this simply by installing a metapackage or something.

Your best bet is either:

a clean install
manually removing unneeded packages and installing the server components you need


Not every device in /dev corresponds to a physical device. The devices in /dev also include pseudo-devices allocated by the kernel which allows the kernel to interact with these abstractions using standard IO as if they were ordinary files. Here is the device list as it appeared in the 2.6 kernel which also provides some details for each (pseudo)device.


network manager v1.2.6 breaks openvpn connection

This is a known issue in 1.2.6.

The ticket is open here and has a high priority for it to be fixed.
https://bugs.launchpad.net/ubuntu/+source/network-manager/+bug/1671606


How to mount a shared folder in OSX to Ubuntu 14.04

How to mount SSH locations using SSHFS.

Step 1:

"On your Mac, open Sharing preferences if it isn’t already open, then select Remote Login.
Selecting Remote Login also enables the secure FTP (sftp) service."

Step 2:

From Ubuntu, install SSHFS sudo apt-get install sshfs.
Make a mount point. #mkdir /mnt/macMount
Mount the SSH Folder #sshfs YOUR_MAC_USERNAME@YOUR.MAC.IP:/ /mnt/macMount/
Then check to see it worked. cd /mnt/macMount and ls to confirm things are where they should be


Greek acute accent only works in Dash in Ubuntu 16.04.5 LTS

It works for me in Ubuntu 16.04.1 LTS and 16.04.5 LTS (both live). I

started onboard
switched keyboard to Greek with setxkbmap gr
used the onboard on-screen keyboard in order to find the keys, particularly the acute accent.
pressed the acute accent key ´
after that pressed the ε key and got έ

It works for me in the command line window and in gedit. See the screenshot,