gedit can't recognize character encoding, but gvim can

iconv is probably what you'll want to use. iconv -l will show you the available encodings and then you can use a couple of commands to recode them all:

# all text files are in ./originals/
# new files will be written to ./newversions/

mkdir -p newversions
cd originals
for file in *.txt; do
    cat $file | iconv -f ASCII -t utf-8 > ../newversions/$file;
done

If you want to do this with files you don't the encoding of (because they're all over the place), you want to bring in a few more commands: find, file, awk and sed. The last two are just there to process the output of file.

for file in find . -type f -exec file --mime {} \; | grep "ascii" | awk '{print $1}' | sed s/.$//; do
    ...

I've no idea if this actually works so I certainly wouldn't run it from anything but the least important directory you have (make a testing folder with some known ASCII files in). The syntax of find might preclude it from being within a for loop. I'd hope that somebody else with more bash experience could jump in there and sort it out so it does the right thing.


Your power switch is a hardware switch: Simply put, you have to close the open circuit.

To do this, insert a wire at both ends of the switch base or button, then from then on you can keep your system in sleep or hibernation.  Also, see if you can go into the system settings (BIOS) and set up your Wake-on-LAN.

That will allow you to wake up your sleeping system remotely.


Every time you changing partitions you need run Ubuntu and run command update-grub (be sure you have installed os-prober, it detects other operation systems)


Cannot Disable Sticky Edges on Ubuntu 16.10

Just as a reference for someone who might have the same issue, I was not able to fix this issue until I updated to Ubuntu 17.04!


how to pass single file not list of files

What can I say? Simply run:

split -l 20000 -d "job1" "job1"

That's all.

Or:

file="job1"; split -l 20000 -d "$file" "$file"

The command read reads the entries in file.list.txt and executes split -l 20000 -d "$file" "$file" for each of them.

In your case:

split -l 20000 -d "job1" "job1"
split -l 20000 -d "job2" "job2"


How to remove the web app shortcut created by chromium?

Delete /home/user/.local/share/applications/yourapp.desktop.

(Replace user with your username and yourapp with the name of the application.)


How to mount a subdirectory of `/home` without making it appear as removable?

Rather than additionally mounting subdirectories of an already mounted drive let me suggest you mount it separately. You may then create a symlink to that directory in your HOME to make it accessible.

sudo mkdir -p /media/runtime

Then mount your SSD partition to `media/runtime or edit your /etc/fstab:

UUID=[uuid] /media/runtime ext4 relatime,errors=remount-ro,discard 0 2

Replace [uuid] by the UUID of your drive. To grant access to this partition create a symlink in your HOME:

ln -s /media/runtime /home/mac/


Creating bootable USB drive for Ubuntu on UEFI

You can try toggling the UEFI setting on your BIOS. Keeping in mind when you update the BIOS, you may have to change the UEFI settings again.


My laptop's inbuilt graphics card was incompatible to run 16.04, going back to 14.04.
Windows 10 runs smoother though, but it lacks the performance ubuntu gives.


error installing older version of driver

The older version of wl will not build for the 4.8 kernel.

You can look into /var/lib/dkms/bcmwl/6.30.223.141+bdcom/build/make.log to see what is the problem.

If you look into the new version, you will see that there are some patches that add support of new kernels.

You can backport these patches and rebuild the package.


I added a script to /etc/rc.local and now ubuntu doesn't start

You need to put & after the command. For example, java -jar myapp.jar &

The & detaches the program from the terminal, allowing it to run in the background.

As for recovering from it, try editing it from recovery mode. If that doesn't work, you can use a live USB drive to edit it.


Fingerprint drivers were not released for linux. There are some efforts being made in the commnunity to reverse engineer the drivers. You can find the latest progress here: https://github.com/nmikhailov/Validity90.


How do I check that a configuration file has been read?

If I am not sure if a program reads a specific config file (or in which order), I try to trace the open syscalls with strace. To do this stop the ssh daemon. Then start it manually in the terminal by:

strace -e open -ostrace.out /usr/sbin/sshd

After it has started you should have a file in your current working directory called strace.out. In my case it looked like this (output stripped down):

open("/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3
...
many libraries
...
open("/proc/filesystems", O_RDONLY)     = 3
open("/dev/null", O_RDWR)               = 3
open("/usr/lib/ssl/openssl.cnf", O_RDONLY) = 3
open("/etc/ssh/sshd_config", O_RDONLY)  = 3 <--- here sshd_config was opened
open("/dev/urandom", O_RDONLY|O_NOCTTY|O_NONBLOCK) = 3
open("/etc/gai.conf", O_RDONLY|O_CLOEXEC) = 3
open("/etc/nsswitch.conf", O_RDONLY|O_CLOEXEC) = 3
open("/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3
...
open("/etc/passwd", O_RDONLY|O_CLOEXEC) = 3
...
ssh keys
...
open("/etc/ssh/blacklist.ECDSA-256", O_RDONLY) = -1 ENOENT (No such file or directory)

With this test I can make sure sshd reads my /etc/ssh/sshd_config. In the last entry you can see that this file is not found on my system (-1).


What is the naming convention of a debian pkg (specifically, the version part)

It's easiest to explain by following a release of numpy from Upstream to Debian to Ubuntu.

Let's start with the upstream version of numpy, version 1.11.0

A Debian volunteer packaged numpy for Python3. But for some reason, the upstream code needed to be tweaked or patched. Maybe there was a bug to be fixed or a build error. The slightly-changed source code was no longer stock 1.11.0.  To tell the two versions apart, the Debian volunteer called the new version 1.11.0-1. The "-n" suffix is normal for Debian - they cannot use "1.11.1" because the numpy upstream might use that number, and intruding upon upstream's numbering would quickly get impossibly confusing.

This newer Debian version was absorbed into the Ubuntu 16.04 repositories. But again, the first build didn't work and the source code needed to be tweaked. The Ubuntu Developer called this even-newer version 1.11.0-1ubuntu1. Ubuntu can't call it 1.11.0-2 because Debian might use that number.

Once you get used to how to read the version numbers, it's like a trail of clues telling you where code changes occurred. Then you can look in the right place to find out why that change occurred.


GWT (Google Web Toolkit) Designer not working on Ubuntu 12.10

I found a solution that works (but only with Eclipse 3.7.2):

Download Eclipse Classic 3.7.2.

Install GWT Designer via Plugin-Link in Eclipse as described here.

Install the GWT SDK (and the rest) via Plugin-Link in Eclipse as described here

Execute Workaround 2 from this page.

You can find more information about this issue in this bug.


How change display resolution settings using xrandr ubuntu 14.04

just type xrandr, this will list all available monitors and possible modes/resolutions that you can use.
you will see a star (*) on the current used mode.
For instance:

>xrandr
Screen 0: minimum 320 x 200, current 2720 x 1024, maximum 8192 x 8192
VGA-0 connected 1280x1024+0+0 (normal left inverted right x axis y axis) 340mm x 270mm
   1280x1024     60.02 +  75.02*
   1024x768      75.08    70.07    60.00
   800x600       75.00    60.32
   640x480       75.00    60.00
   720x400       70.08
HDMI-0 connected primary 1440x900+1280+124 (normal left inverted right x axis y axis) 477mm x 268mm
   1920x1080     60.00 +
   1280x1024     60.02
   1440x900      59.90*
   1280x800      59.91
   1152x864      75.00
   1024x768      70.07    60.00
   800x600       60.32    56.25
   640x480       66.67    60.00
   720x400       70.08

To change it, just type:

xrandr --output HDMI-0 --mode 1920x900

this will change my second monitor (connected via HDMI port) to a new resolution.

there are more parameters you can set, like frequency, etc.
chenk more details with xrandr --help


Are you able to access the filesystem from the LiveCD?

You might need to mount the filesystem first, the LiveCD may not automatically mount it.

From a command line you can use demsg to find out the device name of the hard drive, e.g. /dev/sda1

Then simply make a mount point and mount it:

sudo mkdir /mnt/system
sudo mount /dev/sda1 /mnt/system

From there you should be able to chroot into the system

If you know what version of the kernel you had installed (/boot/grub/grub.cfg might help) then you could try downloading the .deb and unpacking it to get the files you need, e.g.:

cd /tmp
dpkg -x linux-image-3.16.0-25-generic_3.16.0-25.33_amd64.deb /tmp

You can grab the kernel .deb from here: http://packages.ubuntu.com/utopic/kernel/


To remove sample contacts: Run

manage-address-books.py delete

in a shell.

Edit /etc/[phone|tablet]-services and

remove manage-address-books.py

To remove sample video and music lenses: Run

rm /usr/share/dbus-1/services/com.canonical.Unity.Lens.MockMusic.service
rm /usr/share/dbus-1/services/com.canonical.Unity.Lens.MockVideos.service

To remove pictures from gallery: Run

rm /home/phablet/Pictures/*

To remove sample messages in messaging menu:

Edit /etc/[phone|tablet]-services and remove chewie_messaging_populate_menu

(source)


Can't uninstall 'youtube-dl'. No files were found to uninstall

These commands did the trick:

$ sudo dpkg -r youtube-dl
(Reading database ... 332796 files and directories currently installed.)
Removing youtube-dl (2015.06.04.1-1) ...
Processing triggers for man-db (2.7.4-1) ...
$ sudo rm -rf /usr/local/share/doc/youtube_dl /usr/local/lib/python2.7/dist-packages/youtube_dl* /usr/local/bin/youtube-dl
$ sudo pip install --upgrade youtube-dl
Downloading/unpacking youtube-dl
  Downloading youtube_dl-2016.02.05.1-py2.py3-none-any.whl (1.2MB): 1.2MB downloaded
Installing collected packages: youtube-dl
Successfully installed youtube-dl


Why do I have all the sudden a user called "postgres" on my login screen?

All users above user id 999 are shown on the login screen.
Set a user id below 999 for the user postgres with sudo usermod -u 999 postgres.

Or you can add the user to the ignore list with:
sudo nano /etc/lightdm/users.conf
find the line hidden-users= and add postgres to that line.


Did you try using the System Monitor to force kill the window's process? That usually gets rid of pesky windows that hang and don't want to close without crashing Ubuntu's compiz(well at least in my experience of windows not behaving properly).

Also from experience I have Cairo Dock installed and if you have it's terminal(the one that pops up that's connected to the dock when opened) on the dock I found you can still use it's terminal even at times when you cant use your desktop environment's terminal which has saved me at times when I thought my Ubuntu's installation was ruined. Anyways if you have Cairo Dock installed, you should from it's terminal run the line(without quotes):

"compiz --replace"

This restarts compiz when undesirable things occur like when it hangs or crashes.


Installing Windows or any other operating system wouldn't remove Ubuntu unless you chose the Ubuntu partition for your install, and formatted the partition.  Since you say you see Windows with GParted, then you know which partition to install Windows.  You also can see which partitions have any of your other Operating systems.

Installing Windows would most wipe out Grub.  So after you install Windows you will have to reinstall grub.  This is easily done from the LiveUSB or LiveDVD disk and running the steps provided in this answer.


As explained at here you can install SnapDrop (also on snapdrop.net) for Linux and gain similar functionality in your browser. Here's its Readme on GitHub and its FAQ.


How to enable indirect GLX contexts (+iglx) in Ubuntu 14.04 LTS with nvidia gfx-cards

I had a similar issue when running some GL applications via 'ssh -X' and solved it by adding "+iglx" to xserver-command in /usr/share/lightdm/lightdm.conf.d/50-xserver-command.conf.

[SeatDefaults]
# Dump core
xserver-command=X -core +iglx

After which you either reboot or Ctrl-Alt-F1, login, and 'sudo service lightdm restart'.

I hope this helps!


USB not getting mounted due to Read-Only

You can try restoring the USB drive to a standard format. There is a utility called mkusb. Look at this link. Add the ppa, update apt and then sudo apt install mkusb and when done, run mkusb.

Step by step instructions. Run these commands:

sudo add-apt-repository ppa:mkusb/ppa
sudo apt-get update
sudo apt-get install mkusb
mkusb

and select option d see below:

if prompted for root password, enter it. Follow the insturctions on the screen:

and then select the Restore to a Standard Storage Device option (WARNING: you will loose all your data on the USB drive):

That should do it.


Swapping Caps Lock and CTRL in i3 in Ubuntu 20.04 at startup

Here is a solution i found using .XModmap:
Put this in ~/.Xmodmap and if you have a similar problem use xev to check out your Keynames.
!
! Swap Caps_Lock and Control_L
!
remove Lock = Caps_Lock
remove Control = Control_L
remove Lock = Control_L
remove Control = Caps_Lock
keysym Control_L = Caps_Lock
keysym Caps_Lock = Control_L
add Lock = Caps_Lock
add Control = Control_L

For further reading:
https://unix.stackexchange.com/questions/107566/how-to-swap-ctrl-and-capslock-using-xmodmap
https://medium.com/@retprogramisto/how-to-make-custom-keyboard-map-with-xmodmap-1341a1552d4f


Share files between 2 computers via bluetooth from terminal

First, you need to apt install bluez-tools obexpushd.

To send and receive files, you need to set up and pair the devices first.

SETUP

from Arch Wiki - bluetooth:

Bluetoothctl

Start the bluetoothctl interactive command. There one can input help to get a list of available commands.

Turn the power to the controller on by entering power on. It is off
by default.
Enter devices to get the MAC Address of the device with
which to pair.
Enter device discovery mode with scan on command if
device is not yet on the list.
Turn the agent on with agent on.
Enter pair MAC Address to do the pairing (tab completion works).
If using a device without a PIN, one may need to manually trust the
device before it can reconnect successfully. Enter trust MAC Address
to do so.
Finally, use connect MAC_address to establish a connection.

The last two bullet points are not necessary for the send part of a file transfer, but you need the connect later for the receive part.

An example session may look this way:

# bluetoothctl
[NEW] Controller 00:10:20:30:40:50 pi [default]
[bluetooth]# agent KeyboardOnly
Agent registered
[bluetooth]# default-agent
Default agent request successful
[bluetooth]# scan on
Discovery started
[CHG] Controller 00:10:20:30:40:50 Discovering: yes
[NEW] Device 00:12:34:56:78:90 myLino
[CHG] Device 00:12:34:56:78:90 LegacyPairing: yes
[bluetooth]# pair 00:12:34:56:78:90
Attempting to pair with 00:12:34:56:78:90
[CHG] Device 00:12:34:56:78:90 Connected: yes
[CHG] Device 00:12:34:56:78:90 Connected: no
[CHG] Device 00:12:34:56:78:90 Connected: yes
Request PIN code
[agent] Enter PIN code: 1234
[CHG] Device 00:12:34:56:78:90 Paired: yes
Pairing successful
[CHG] Device 00:12:34:56:78:90 Connected: no
[bluetooth]# connect 00:12:34:56:78:90
Attempting to connect to 00:12:34:56:78:90
[CHG] Device 00:12:34:56:78:90 Connected: yes
Connection successful

To make changes permanent and in order to have the device active after a reboot, a udev rule is needed:

/etc/udev/rules.d/10-local.rules

# Set bluetooth power up
ACTION=="add", KERNEL=="hci0", RUN+="/usr/bin/hciconfig %k up"

Tip: Replace KERNEL=="hci0" with KERNEL=="hci[0-9]*" to match all BT interfaces.

After a suspend/resume-cycle, the device can be powered on automatically using a custom systemd service:

/etc/systemd/system/bluetooth-auto-power@.service

[Unit]
Description=Bluetooth auto power on
After=bluetooth.service sys-subsystem-bluetooth-devices-%i.device suspend.target

[Service]
Type=oneshot
ExecStart=/usr/bin/hciconfig %i up

[Install]
WantedBy=suspend.target

Enable an instance of the unit using your bluetooth device name, for example bluetooth-auto-power@hci0.service.

Now your devices are paired. Check that you can see the other with bt-device -l.

SEND

Next, you have to send up your systemd infrastructure for the send to work, otherwise you get the following error:

Acquiring proxy failed: Error calling StartServiceByName for org.bluez.obex: GDBus.Error:org.freedesktop.systemd1.LoadFailed: Unit dbus-org.bluez.obex.service failed to load: No such file or directory.

Make the necessary systemd changes with

systemctl --user start obex
sudo systemctl --global enable obex

This makes sure you can send files. A sudo also in the first line will fail!

You can send files now by bluetooth-sendto --device=12:34:56:78:9A:BC filename filename2. If a transfer hangs at 100%, a ctrlc finalizes it (or aborts earlier).

To know your device name (12:34:56:78:9A:BC), you can issue bt-device -l.

RECEIVE

from Raspberry Pi forum:

We want to set up a OBEX push server, this is why obexpushd was needed.

The compatibility flag on the Bluetooth daemon is needed, you have to edit /etc/systemd/system/dbus-org.bluez.service with the editor of your choice by adding the -C flag to the end of the ExecStart= line. It should look like this:

ExecStart=/usr/lib/bluetooth/bluetoothd -C

Reboot or restart the service with sudo systemctl daemon-reload after editing. Choose a specific directory where received files are placed, for example by sudo mkdir /bluetooth.

Start the server with sudo obexpushd -B -o /bluetooth -n, it should respond with:

obexpushd 0.11.2 Copyright (C) 2006-2010 Hendrik Sattler
This software comes with ABSOLUTELY NO WARRANTY.
This is free software, and you are welcome to redistribute it
under certain conditions.
Listening on bluetooth/[00:00:00:00:00:00]:9

If that's not working, and you get:

obexpushd 0.11.2 Copyright (C) 2006-2010 Hendrik Sattler
This software comes with ABSOLUTELY NO WARRANTY.
This is free software, and you are welcome to redistribute it
under certain conditions.
BtOBEX_ServerRegister: Address already in use
net_init() failed

it could be because you have another daemon or program running which occupies the rfcomm channel 9 that obexpushd uses by default. In this case, change the channel to 23 like this:

sudo obexpushd -B23 -o /bluetooth -n

to use channel 23.

Once you get obexpushd running, open a second terminal window. You can verify that the OBEX service is registered with

sudo sdptool browse local

It should list (at channel 23 in this case), among others, this:

Service Name: OBEX Object Push
Service Description: a free OBEX server
Service Provider: obexpushd
Service RecHandle: 0x10005
Service Class ID List:
  "OBEX Object Push" (0x1105)
Protocol Descriptor List:
  "L2CAP" (0x0100)
  "RFCOMM" (0x0003)
    Channel: 23
  "OBEX" (0x0008)
Profile Descriptor List:
  "OBEX Object Push" (0x1105)
    Version: 0x0100

In that window, while obexpushd is still running, use bluetoothctl to set discoverable on. Now pair from your other device. Pairing MUST be done while obexpushd is running, or the other device wont recognize the service is available. If the phone is already paired, remove it from your other device, use bluetoothctl to remove it from the Ubuntu computer, and re-pair.

After you connect (the last bullet point from the above list), you should be able to receive files. They will appear in the /bluetooth directory. Notice that they will be owned by root, so you'll need sudo to access them. Or you can do a chmod 0777 /bluetooth for a public exchange directory, since the bluetooth authentification is device-based and not user-based anyway.

In order to automate the obexpushd command, create the file /etc/systemd/system/obexpush.service

[Unit]
Description=OBEX Push service
After=bluetooth.service
Requires=bluetooth.service

[Service]
ExecStart=/usr/bin/obexpushd -B23 -o /bluetooth -n

[Install]
WantedBy=multi-user.target

Then, set that to autostart with

sudo systemctl enable obexpush

After a reboot or restart  of the service with sudo systemctl daemon-reload, you should be able to send and receive files in both directions now.

Don't forget to connect the devices when trying to receive files.


Cannot run mongodb v3.0.3 on ubuntu 14.04 32 bit

Looks like the following is a viable workaround:

Create a folder /data/db/ and provide proper write and read access
Start mongo db using mongodb --journal


This is a known issue and is solved in version 2.1.1, additionally you need to run

sudo apt-get remove phonon-backend-gstreamer

because minitube now uses phonon-backend-vlc.

source: http://flavio.tordini.org/forums/topic/videos-repeat-endlessly-ubuntu-12-04-minitube-2-1


It should be pretty straight forward:

sudo apt-get install dwm

Then just logoff, and at the welcome screen choose dwm as your window manager.


I am obliged to restart my computer savagely , when I lock the screen for a long time

I think I have the same problem. I find if I wait long enough the system will respond, but how long it takes depends upon how long it has been locked.

I suggest that you either:

turn off the screen power off option in the Brightness and Lock settings program.
Use Unity 2D rather than full Unity so you aren't using Compiz. This is selected from the pull down from where you login to your account.

I believe this is compiz bug https://bugs.launchpad.net/ubuntu/+source/compiz/+bug/969860 even though I'm not using fglrx myself. I find I can get around it by using a terminal elsewhere, confirming that compiz is using a lot of CPU, and killing compiz.


ThinkPad T450s Wireless interface not detected when installing Ubuntu 16.04 mini.iso

Your Intel 7265 uses the driver iwlwifi which also requires the module iwlmvm. The mini.iso evidently provides drivers for a limited number of common networking devices.

I downloaded and extracted the mini.iso and, unfortunately, the module iwlmvm is not included. As well, when you tried to install, you got a message:

  "failed to load module iwlmvm (error 256), is dynamic loading
  enabled?"

I know of no way, aside from a temporary ethernet connection, to get a working network interface with your Lenovo T450s.


I discovered how to add modules to the initrd in Ubuntu 14.04
I added the names of the modules to /etc/initramfs-tools/modules . This added the modules to the initrd file.  Do not forget to update the initrd file ( update-initramfs -u ) after you have made changes to /etc/initramfs-tools/modules .


Booting monolithic kernel: cannot find root fs by UUID

The IPC hardening feature of grsecurity breaks semaphores for lvm... that was the culprit. Deactivating it fixes this problem.


Weird issue with no Sound on Ubuntu 19.04 / Terminal, Files and screenshot unable to start up

After hours of searching I finally found the root of the problems. IT was chrome remote desktop all along. I uninstalled it via and was about to get my headphones working. Speaker still dont work so I am trying to see how to reset my audio setting.

sudo apt-get remove chrome-remote-desktop

Installing Google Chrome Remote Desktop messed up my box


Running timedatectl but it's not updating the system time zone

If you don't mind getting an interactive application,

$ sudo dpkg-reconfigure tzdata.

As to why the timedatectl failed, see the GUI time/date configuration option in System Settings. It is possible that some Use network time setting is blocking it.

Another alternative method is:

$ sudo ln -sf /usr/share/zoneinfo/Etc/GMT$offset /etc/localtime,
where $offset is the offset from GMT(UTC) time. Since, you want UTC,

$ sudo ln -sf /usr/share/zoneinfo/Etc/GMT /etc/localtime.


How to configure Master-Slave LDAP replication

Master slave in ldap goes by the name of provider and consumer. You don't specify what ldap server you are using so I presume we are talking about openLDAP.

In older openLDAP config was saved in conf files. Nowadays all settings are stored in the ldap server itself. So you need to create the config and inject it to the ldap server so we will start by creating these files. This instruction will replicate all entries to your slave server automatically.

Lets say your company name is acme and the domain is com.
and that your current ldap server admin is located in : cn=admin,dc=acme,dc=com

First we need to create a ldap user that is allowed to read all ldap entries to replicated it to the consumer server.

create file "create_repl_user.ldif"

dn: cn=ldaps2,dc=acme,dc=com
objectClass: simpleSecurityObject
objectClass: organizationalRole
cn: ldaps2
description: LDAP server2 replicator

Second we need to enable the provider service in the master ldap server and give the user ldaps2 read access to the entire ldap server.

create file "enable_sync_prov.ldif"

dn: olcDatabase={1}hdb,cn=config
changetype: modify
delete: olcAccess
olcAccess: {0}to attrs=userPassword,shadowLastChange
  by self write
  by anonymous auth
  by dn="cn=admin,dc=acme,dc=com write
  by * none
-
add: olcAccess
olcAccess: {0}to attrs=userPassword,shadowLastChange
  by self write
  by dn="cn=admin,dc=acme,dc=com" write
  by dn="cn=ldaps2,dc=acme,dc=com" read
  by anonymous auth
  by * none
-
add: olcDbIndex
olcDbIndex: entryUUID eq
-
add: olcDbIndex
olcDbIndex: entryCSN eq

dn: cn=module{0},cn=config
changetype: modify
add: olcModuleLoad
olcModuleLoad: {1}syncprov

dn: olcOverlay=syncprov,olcDatabase={1}hdb,cn=config
changetype: add
objectClass: olcOverlayConfig
objectClass: olcSyncProvConfig
olcOverlay: {0}syncprov
olcSpCheckpoint: 100 10
olcSpSessionlog: 100

Third: We need to enable replicating from a specified server to our ldap consumer.
create the file enable_sync_consumer.ldif replacing the line
provider="ldap://yourldapservername.com:389/" , with the ip of your master ldap server.
and
credentials=yourencryptedldap2spassword , with the password you decide on for your ldap2s user.

dn: cn=config
changetype: modify
replace: olcLogLevel
olcLogLevel: stats

dn: olcDatabase={1}hdb,cn=config
changetype: modify
delete: olcAccess
olcAccess: {0}to attrs=userPassword,shadowLastChange
  by self write
  by anonymous auth
  by dn="cn=admin,dc=acme,dc=com" write
  by * none
-
add: olcAccess
olcAccess: {0}to attrs=userPassword,shadowLastChange
  by anonymous auth
  by * none
-
delete: olcAccess
olcAccess: {2}to *
  by self write
  by dn="cn=admin,dc=acme,dc=com" write
  by * read
-
add: olcAccess
olcAccess: {2}to *
  by * read
-
replace: olcRootDN
olcRootDN: cn=manager
-
delete: olcRootPW
-
add: olcDbIndex
olcDbIndex: entryCSN eq
-
add: olcDbIndex
olcDbIndex: entryUUID eq
-
add: olcDbIndex
olcDbIndex: uid eq
-
add: olcDbIndex
olcDbIndex: cn eq
-
add: olcDbIndex
olcDbIndex: ou eq
-
add: olcDbIndex
olcDbIndex: dc eq

add: olcSyncrepl
olcSyncrepl: rid=123
  provider="ldap://yourldapservername.com:389/"
  type=refreshAndPersist
  retry="60 30 300 +"
  searchbase="dc=acme,dc=com"
  bindmethod=simple
  binddn="cn=ldaps2,dc=acme,dc=com"
  credentials=yourencryptedldap2spassword

Now that we have created the config files, we need to inject them to the provider and consumer server

in the provider server
create the replication user:

run ldapadd -x -W -D cn=admin,dc=acme,dc=com -f  create_repl_user.ldif

enable the provider service:

run ldapadd -x -W -D cn=admin,dc=acme,dc=com -f  enable_sync_prov.ldif

in the consumer server add the consumer sync settings:

run ldapadd -x -W -D cn=admin,dc=acme,dc=com -f enable_sync_consumer.ldif


Lost "Open terminal here" on upgrade from Kubuntu 14.10 to 15.04

KF5 Service Menus

This is partial copy from: https://www.kubuntuforums.net/showthread.php?25740-Service-Menus-with-Dolphin&p=367207&viewfull=1#post367207

The Kubuntu 15.04 is a hybrid system. There are KDE4 applications and there are new KF5 applications.The KDE4 parts are looking the service menus from:

~/.kde/share/kde4/services/ServiceMenus/
and
/usr/share/kde4/services/ServiceMenus/

The new KF5 service menus are at:

~/.local/share/kservices5/ServiceMenus/
and
/usr/share/kservices5/ServiceMenus/

To get the KF5 service menus to the KDE4 applications the KF5 service menu directory can be linked to the KDE4 directory.

..and there are the KF5 service menus with the Dolphin (KDE4).

More of the Dolphin: https://www.kubuntuforums.net/showthread.php?67996-Bug-275405-Dolphin-ignores-file-association-for-scripts-but-executes-them


The only occasion that TeXlive has been installed in /usr/local/texlive is when I have done
a manual install. That is, I've gone to www.tug.org, downloaded the Linux binary, etc.

If I use apt-get install texlive (or Ubuntu Software Center), TeXlive ends up in /usr/share by default.

So if you didn't do anything different from this two options, I guess that the problem
is:

You did a manual install (via www.tug.org). For this to work, the installer created
hidden files in your home directory, which you accidentally erased.
Then you installed TeXlive via apt-get or Ubuntu Software Center. Notice that
(unless you've installed the texlive-full package) you won't have installed all
the packages you might need.

So even if you have the packages you need installed in /usr/local/texlive, the installation
via apt-get only can see the packages installed in /usr/share.

My recommendation is to install texlive-full or even better:

sudo apt-get install texlive texlive-latex-extra cm-super

if you don't need "everything").
After that you might consider uninstalling the TeXlive installed manually in
/usr/local/texlive (I'm not sure right now if you can directly sudo rm -R /usr/local/texlive
or if there is an uninstaller included somewhere in /usr/local/texlive).


Just installed ubuntu and fan won't stop working!

Some motherboards don't have proper linux fan support, so it could simply be a driver issue.

Check to see that your fans are detected. Install lm-sensors:

sudo apt-get install lm-sensors

And run it from terminal with the command "sensors".
Your fan(s) should be listed as fan1, fan2, etc. If not, then the drivers aren't properly detected.

If they are properly detected, follow the instructions here: How to control fan speed?

Unfortunately, if your fan's aren't detected, you can't directly control their speed.

It could be that your cpu governor is clocking your CPU higher than needed, resulting in higher waste heat that your fans need to dissipate.
Fan control based on temperature is generally managed by the BIOS.

Install the package cpufrequtils:

sudo apt-get install cpufrequtils

Check your cpu driver with the command:

cpufreq-info

If it is acpi-cpufreq, do the following:

Change your governor to ondemand with the command

sudo cpufreq-set -g ondemand

If your cpu driver is intel-pstate, change the governor to powersave and see what happens. If the fan-speed reduces under powersave, you should disable intel-pstate and use acpi-cpufreq, as acpi-cpufreq has far more options when it comes to clocks.

To disable it:

sudo nano (or gedit) /etc/default/grub

Edit the line GRUB_CMDLINE_LINUX_DEFAULT="~"
and add "intel_pstate=disable".

Then run the command:

sudo update-grub

And reboot and edit the acpi governor settings as described above.

NOTE: There are generally 4 main CPU governors under acpi-cpufreq: Performance, Powersave, Ondemand, and Conservative. Performance clocks your CPU at its highest clock. Ondemand clocks your CPU higher or lower depending on load. Powersave keeps your CPU at as low a frequency as possible, and Conservative governor prefers the lowest clock, but will jump depending on the load.

Under intel_pstate, there are 2 governors: Performance and powersave. Intel_pstate behaves somewhat differently than acpi-cpufreq and also scales slightly faster, at the expense of customization.

Edit, thermald might also be reporting high thermals, like FrankFoo said. Check the thermald logs.


Changing audio drivers in Ubuntu 18.0.4 so Line Out doesn't flicker and fuzz!

I've found two similar problems marked as solved, that suggested adding  one of the following to /etc/modprobe.d/alsa-base.conf:

options snd-hda-intel model=6stack-dig
options snd-hda-intel model=generic

To do it, open a terminal window, run sudo nano /etc/modprobe.d/alsa-base.conf, add one of the lines to the end, hit Ctrl+o to save, Ctrl+x to close.

Info sources: 1 and 2


You will have to emulate Android on your Ubuntu PC
Then install the Amazon Audible App

See : How to install and run Anbox in Ubuntu 18.04?


Assuming this is a older machine (2011 or before for intel, not sure for AMD) , the PCI lanes used for the video card were often also used for integrated graphics. After this, the iGPU was put on the same die for most lower end machines, so this would not be an issue.

Even if you had "on die" graphics, the BIOS settings you need to change might not be visible - this would be called something like "iGPU Multi-Monitor"

My guess is that your on board video is getting disabled when you install your discrete card. Ubuntu isn't at fault - chances are its the hardware behaving as its designed to "protect" the user (windows didn't like dissimilar video cards being installed till... I think windows 7) and to save on PCIe lanes.


Check addtional driver tab for drivers, install and test. Read here - How do I install additional drivers?

Ubuntu installed via wubi is always slow.

Since the whole ubuntu content is put in packaged format and stored in the hdd, a low speed HDD contributes more slowness to the system.

For using ubuntu you don't need to remove windows. You can perfectly dual boot it, jsut like you are doing with wubi.

If the system is slow, after trying both you can look for a lighter ubuntu based distro like lubuntu or xubuntu. Read more here - How do I find out which version and derivative of Ubuntu is right for my hardware in terms of minimal system requirements?

For installing ubuntu on a separate partition and dual boot with windows. First uninstall your wubi ubuntu. Defragment your C: drive, and follow this video http://www.youtube.com/watch?v=86KHkeBpsbA

Also There are innumerable tutorial in web to dual boot ubuntu and windows. Just search. If you face any problem, you are welcome here to ask a new question :)


So do you still has direct Internet connection, or through Squid only? Apt-get needs to be configured to work through proxy, as well as any other software. In /etc/apt/apt.conf add

Acquire::http::Proxy "MYDOMAIN\MYNAME:MYPASS@MY.PROXY.COM:MYPORT"


Unity 3D won't load - Choosing "Ubuntu" during login still loads Unity 2D

In my case, it was actually a case of removing the NVIDIA drivers.

I noticed that 3D was running during install, so I had conclusive proof that my video card was capable. I had clicked "yes" for downloading updates during setup. When it rebooted to my system, it was already using the NVIDIA driver in "Proprietary drivers" and was running Unity in 2D mode.

I followed the first 4 instructions on this page. And lo and behold, 3D was running on reboot. I didn't reinstall the Nvidia driver I'd downloaded.

As a bonus, my whole system seems to be running much much faster. I think the Nvidia driver was buggy and slowing everything down and not recognizing my video card's capability.


Only some selected programs being able to access the internet, How to fix it?

this may be DNS problem. you can set /etc/resolv.conf with content

nameserver 8.8.8.8

Then try surf website again.


Tool for high picture compression with low loss of quality

If you want an easy to use tool, try Trimage, which can be found in the Software-Center of Ubuntu. I've also tested pngcrush and optipng but I have to say that Trimage had the best compression rate of these three tools, without having to mess around with the console :-)

sudo apt-get install trimage


Open the file manager, go to Edit > Preferences, and on the Behavior-tab under "Executable Text Files"-section set the option to what you need: "Run executable text files when they are opened", "View executable text files when they are opened", "Ask each time"


Windows 8.1 not appearing in Grub2 after installing ubuntu 14.04

If you have Ubuntu still installed, try creating a menu entry manually and see if it works. Create a menu entry (by gksudo gedit /etc/grub.d/40_custom) and add the following contents:

menuentry "Windows" {
    set root=(hd0,2)
    chainloader +1
}

And run sudo update-grub. The value of root here should be 2, from the contents of the Boot Repair output that you posted. To find out for sure, try rebooting, then press c to get to the command line (as given in the instructions below the GRUB menu) ad try these commands until you see files that belong to the Windows partition:

ls
ls (hd0,1)
ls (hd0,2)
...

The output of the first ls will list the partitions as GRUB recognizes them ((hd0,1) instead of sda and so on), so in the next few command you will try the partitions one by one (use the values listed by the first ls instead of (...,...).
Once you see the files of Windows, say for ls (hd0,3), then do the following:

set root=(hd0,3)
chainloader +1
boot

If it boots to Windows successfully, then replace (hd0,2) with (hd0,3) in the menu entry you created previously. (As you may guess, the menu entry lines are simply commands to GRUB.) If ls fails, you may need to load the NTFS modules:

insmod part_msdos
insmod ntfs

If so, add these lines to the menu entry before the set root line.


xrandr scaling has no effect on extternal screen, overscan

I finally fixed this: the problem was with the proprietary NVIDIA drivers. Using the nouveau driver it worked perfectly.


From the comments...

We renamed ~/.config/gedit to ~/.config/gedit.HOLD, then retry gedit and see if it works. It worked. So something is wrong with this prefs folder. It's owned by root.

You probably started gedit in the terminal using sudo gedit, and you should be using sudo -H gedit. All GUI apps should be started this way from the terminal.


i did a research of my own and i managed to solve the issue by changing my wine version to 1.9.10 and deleting gta_sa.set from GTA San ANdreas User Files.

thank you all for your efforts.

Cheers..


Can I completely remove Gnome and leave xmonad?

It's a bit of a hassle, but i would re-install the whole system without X (using the  the MinimalCD version of Ubuntu), and then perform a clean install of Xorg and XMonad:

sudo apt-get update
sudo apt-get install xorg xinit
sudo apt-get install xmonad

... plus all the other small stuff you need; mail client, web browser,

This way you will get a clean and lightweight system. Typing startx will start X
X wont start automatically during boot, you'll have to configure that.

A clean installation like this will not have some of the fancy tools included in a vanilla ubuntu workstation, like Network Manager. See it as a chance to learn Ubuntu/linux from the inside.

Use xset and xterm to configure screensaver/powersave, use xrand to set monitor resolution.


How to make Firefox stop suggesting if I meant to go a website when I search

It seems we will be able disable this new feature via about:config in Firefox 36: https://bugzilla.mozilla.org/show_bug.cgi?id=1088050

For now you can add this line:

notification[value="keyword-uri-fixup"] { display: none !important; }

to the userChrome.css inside the chrome subfolder of your Firefox profile folder. If userChrome.css doesn't exist there, create it: http://kb.mozillazine.org/UserChrome-example.css

Or, alternatively, you can use the Stylish add-on and create a new user style like this:

@namespace url(http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul);
notification[value="keyword-uri-fixup"] { display: none !important; }


Cannot find /bin directory in Android Studio working directory

TL;DR Android Studio and Android SDK, these are two completely different things. First, you install Android Studio, then the SDK Tools.

Source

Installing Android Studio

Unpack the downloaded archive file into an appropriate location for your applications.
To launch Android Studio, navigate to the android-studio/bin/ directory in a terminal and execute studio.sh.

You may want to add android-studio/bin/ to your PATH environmental variable so that you can start Android Studio from any directory.

Installing Android SDK

Click the marked button

Get the latest SDK tools

As a minimum when setting up the Android SDK, you should download the latest tools and Android platform:

Open the Tools directory and select:

Android SDK Tools
Android SDK Platform-tools
Android SDK Build-tools (highest version)

Open the first Android X.X folder (the latest version) and select:

SDK Platform
A system image for the emulator, such as
ARM EABI v7a System Image

Get the support library for additional APIs

The Android Support Library provides an extended set of APIs that are compatible with most versions of Android.

Open the Extras directory and select:

Android Support Repository
Android Support Library

Get Google Play services for even more APIs

To develop with Google APIs, you need the Google Play services package:

Open the Extras directory and select:

Google Repository
Google Play services

Install the packages

Once you've selected all the desired packages, continue to install:

Click Install X packages.
In the next window, double-click each package name on the left to accept the license agreement for each.
Click Install.


`cal -h` command: Bash substring `${string:offset:length}` error

Your problem is that cal is already highlighting the current day, and the control codes are throwing off the offsets

Look at /tmp/terminal in a hex editor.  Today (the 11th) is: 5F 08 31 5F 08 31, and not 31 31

Use cal -h to switch off the auto highlighting of today's date.


BQ M10 Music App - Creating Playlist of Folders

I used to use this shell script to create playlists based on folder back when Jolla's music indexer had a few bugs. Should work just as well on the M10

https://gist.github.com/ShaneQful/385f94786a1880260531#file-gistfile1-sh


I would recommend running a diagnostic test on your hard drive and also try a diagnostic test on your RAM. I never used Linux a lot but I think the same tasks required to troubleshoot and repair problems with Windows would also apply to Linux, just different ways of doing things.


Is there any way to underclock my CPU or disable turbo boost? Lenovo Y50

When the cpu frequency driver is intel_pstate, then turbo can be disabled with this command:

echo "1" | sudo tee /sys/devices/system/cpu/intel_pstate/no_turbo

Disabling turbo will limit the maximum CPU clock frequency to the non turbo number. For example, and for my computer that means 3.4 GHz verses the turbo enabled max of 3.8 GHz.

To check if your system is using the intel_pstate driver use this command:

cat /sys/devices/system/cpu/cpu*/cpufreq/scaling_driver

If you find you want to turn down the maximum clock frequency some more try, for example, this command:

echo "90" | sudo tee /sys/devices/system/cpu/intel_pstate/max_perf_pct

Meaning, set the maximum CPU clock frequency that can be used to 90 percent of the default maximum. Note that the exact percentage reduction will either be rounded or truncated to a nearby pstate (an integer 100 Mhz multiplier).

Normally the driver should run in powersave mode, which is not the same as powersave mode for the acpi cpufreq driver. It is actually more similar to ondemand mode. Check via:

cat /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor

and change via a script such as this, run as sudo:

#! /bin/bash
cat /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor
for file in /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor; do echo "powersave" > $file; done
cat /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor


Is it a desktop or server edition? If desktop, try the following:

open System settings and click Software & Updates;
click the "Download from" field and select "Main server";
launch Software updater (or run sudo apt-get update, then sudo apt-get upgrade)


How to display Chrome window only on active screen

As pomsky linked to as a duplicate the answer was running the below command in the terminal and it started working right away no need for reloading anything.

gsettings set org.gnome.shell.extensions.dash-to-dock isolate-monitors true


How to live stream(raw format/bytes) audio from pulseaudio sink to a local UDP server?

After tweaking around the existing command I figured it out-
parec --format=s16le -d sink_name.monitor | lame -r -a --quiet -b 18 -B 18 - | ffmpeg -re -i - -f s16le udp://localhost:20001

All three commands explained below -

First command accesses the audio from sound cards and streams to 2nd command in s16le PCM format
Second,  lame changes bit rate to 18 kbps
Third, ffmpeg streams live to udp server


Where can I find ASROCK E350M1 Integrated AMD Radeon HD 6310 graphics driver?

I think you would have to download and install AMDs proprietary driver from their website.

For 32 and 64-bit: http://support.amd.com/us/gpudownload/linux/Pages/radeon_linux.aspx?type=2.4.1&product=2.4.1.3.42&lang=English

after downloading right click on the file and mark it as executable under properties. Now open a terminal and type in

sudo sh /home/your_username/Downloads/amd-driver-installer-12-2-x86.x86_64.run

the installer will guide you through the installation.
After the installation was succesful, type into the terminal

sudo aticonfig --initial -f

and finally

sudo reboot


OK, it took me a while but I figured out a few things.
First of all, qcow2 images is not the fastest way to go. Currently, since I have several physical disks in my server, I pass through whole partitions to my VMs Add physical partition to QEMU/KVM virtual machine in virt-manager

Then I passthrough the TPM module in my VM.
This allows me to encrypt drives with bitlocker as if I had a real PC.

I hope this helps.


How to manage the icons in the top bar (14.04 & metacity)

Hold Alt while right-mouse clicking on the said icon.

A menu should then appear giving you the options to either move it or remove from panel.

If it's not worked use both of Logo+Alt. the key Logo is win logo key on your keyboard.


will 32 bit Ubuntu will work fine on 64 bit machine?

Yes, you can install Ubuntu 32bit on a 64bit system, and contrary to popular belief, it will be able to use all of your memory (not just 4GB). Just install it using the Linux PAE kernel (installed by default) and everything will run exactly the same. PAE stands for Physical Address Extension, and it is the technology that allows the software to access over 4GB of RAM.

http://en.wikipedia.org/wiki/Physical_Address_Extension


Ubuntu 12.04 Install Problems.. Installation Type screen. No options

This can be a symptom of computers with Intel Smart Response Technology / Intel Rapid Storage Technology. Basically, Intel does fancy stuff (including the solid-state-drive cache) to make the disk drive faster and more reliable. It's related to RAID ... the same file may be stored in multiple places etc.

Intel has posted a PDF saying that DMRAID (the usual linux program to deal with RAID) is old and neglected, and incapable of understanding Intel's newest flavor of RAID. The other linux RAID program is mdadm (aka "MDRAID"), and supposedly works perfectly with ISRT / IRST and is supported by Intel.

Therefore, it seems to me that the most logical solution is the one suggested by oldfred here: Open ubuntu in liveCD or live-usb mode, open a terminal and type

sudo apt-get install mdadm

After that finishes (strangely, it might install an email service in the process), immediately run the livecd's installer. With any luck it will work perfectly.

When I encountered this same problem on my Dell Inspiron 14z, this procedure fixed the problem. [One other thing was, before I did the procedure above, I turned off acceleration in the Intel Rapid Storage Technology program within Windows 7.

I don't think that step was necessary though.]


Recovering your /home should be easy with your Live USB, simply mount the partition and copy to an external HDD. As for editing GRUB, hopefully someone else can help.


Running a Flask app on startup with systemd

Not sure if this helps but this is the service file that I use to control a flask application for a personal project. I think by default, systemd will run a script with a /bin/sh shell with no personalizations. You might want to try switching to a /bin/sh shell and running your command. There may be an environment variable missing.

Unit file from link:

[Unit]
Description=Persistent Transactions API
After=syslog.target network.target electrum.service

[Service]
User=percy
Group=percy
ExecStart=/bin/bash -c "source /opt/persist_transaction/bin/activate ; /opt/persist_transaction/api.py -c /opt/persist_transaction/config.ini"
Restart=always

[Install]
WantedBy=multi-user.target


"trying to overwrite '/usr/share/accounts/services/google-im.service', which is also in package account-plugin-google 0.12+15.04.20150415.1-0ubuntu2"

Deleting the conflicting packages works around the issue, until it is properly fixed.

sudo apt-get purge -f unity-scope-gdrive account-plugin-google account-plugin-facebook


Why is ecryptfs only mounting private home directory over ssh?

My comment above is the correct answer. Apparently writing everything out and then reading over it made something click in my head. Should anyone else find this with a similar problem, check to see what happens when you mount and unmount your private folder with 'ecryptfs-mount-private' and 'ecryptfs-umount-private' respectively. Each should reflect as a change in files displayed in your home directory. As ecryptfs prompts, you need to cd to /home/my_user to see the change reflected.

In my case to "fix" the problem I need to:

Log in over SSH as normal
Copy all contents of '~' to another location
Edit '~/.profile' to add 'ecryptfs-mount-private' at the end (prompts for password to decrypt home after successful SSH login)
Use 'ecryptfs-mount-private' to mount encrypted home
Change directory to home, even if it's the current directory (cd /home/my_user)
Copy files back into home directory
Profit!


Why is it so easy to install graphic card drivers and such a pain to install printer drivers?

Printer drivers are userspace things, they don't exist in the kernel, and they're also not part of the X stack. The kernel, xorg and desktop developers have an interest in making sure video drivers work and install easily because without them, well, you can't see much. Printers are relatively rare peripherals compared to video cards. Everyone has a video adapter, not everyone has a printer.

Plus there's a much wider diversity of printers than there are video cards. People tend to keep printers for longer than they keep video cards, because printers are often useful beyond the few years that a video card is "current" for.

The other factor is the wide diversity of hardware vendors. For video cards there's really only three main players, Intel, nVidia and AMD/ATI, with a lot of smaller companies like VIA and neomagic. There's a gazillion printer manufacturers out there, and each one has a bazillion printers to make drivers for (although most are very similar). Net result is that each printer vendor has their own license terms, driver installation method and relationship with the open source community.

Some vendors 'get it', others don't. I'd recommend contacting the vendor of your printer and letting them know that "ease of driver install" is one of the factors you use when making a decision about which printer to buy in the future.


Ubuntu 16.04 LTS and Windows 10 Pro BitLocker dualboot loop

Following is the solution I've found, tested and currently using without any further problems.

As I click on "Windows" option, everything should be transferred to windows (boot sequence, POST, etc.). This concludes that the problem is before Windows bootloader and hence I edited following file to disable graphics for GRUB.

Boot into Ubuntu, open terminal and type:

sudo gedit /etc/default/grub

#Uncomment to disable graphical terminal (grub-pc only) (remove the # before GRUB_TERMINAL line)

GRUB_TERMINAL=console

Update GRUB settings using:

sudo update-grub

and you're done!

PS: My system has on-board Intel graphics processor and Nvidia GTX graphic card (i've installed drivers in both windows and Ubuntu).


Ubuntu 12.04 login screen with LDAP users, no "other..."

the required option in lightdm.conf is:

greeter-show-manual-login=true

We are using it with CentrifyDC, and it works great!


fmask and dmask are mount options for the FAT filesystem, based on fstab.

They are used to define permissions (umask sets them to both files and directories, while fmask only applies to files and dmask to directories).

The masks are NOT the permissions of the file, they are used to get the permissions you want. In addition, masks can't add any permissions, they only limit what permissions a file or a directory can have.

The umask is the default for files and folders, if you want to customize files and folders’s permissions you should use fmask and dmask same use as the umask.

The mask permissions are not like the octal permission codes passed to the chmod command, however this table is really helpful understanding how the masks permissions work :

    0   1   2   3   4   5   6   7
r   +   +   +   +   -   -   -   -
w   +   +   -   -   +   +   -   -
x   +   -   +   -   +   -   +   -

It works as the normal octal permissions but subtracted from 7, and use the absolute value. for instance if you want to set the permissions to 0777 you will need to set it 0000 in the umask (e.g. umask=0000), if you want to set it to 0755 you will set it to 0022 :

The first character represents that its an octal permissions
The second is for the owner
The third is the group
The fourth is for other, i.e any other user

(Source)

man mount gives this :

   umask=value
          Set the umask (the bitmask  of  the  permissions  that  are  not
          present).  The default is the umask of the current process.  The
          value is given in octal.

   dmask=value
          Set the umask applied to directories only.  The default  is  the
          umask of the current process.  The value is given in octal.

   fmask=value
          Set the umask applied to regular files only.  The default is the
          umask of the current process.  The value is given in octal.

You'll also find examples and technical explaination from Drenriza on Ubuntuforums and of course Wikipedia helps a lot, as usual.


WLAN: Can connect to AP but not to network

I just upgraded my router's firmware, and this seems to have solved the problem.


Ubuntu insserv rejected the script header

I deleted the file selinux located at /etc/init.d and no problems thereafter.

It was showing in the errors as in the question -

insserv: Starting selinux depends on rc.local and therefore on system facility `$all' which can not be true!


Cannot use any app, Display error, Error in graphic card defination

Problem could be with video driver /GPU. Pls mention your PC's hardware configurations. If you've Nvidia then try switching to intel's one.
Press ctrl + alt + f2 then login and then issue the following commands
Check which graphics is running:
prime-select query

if it shows Nvidia etc then Switch to intel-
sudo prime-select intel

if none of above works, then try uninstalling Nvidia-
sudo apt purge nvidia-*

Reboot
if problem persists try option1 here : askubuntu.com/a/937727/905106


Remove all your Java packages and start over.

Install openjdk-6-jre
Remove the hidden folder ~/.minecraft (folder .minecraft, located in your Home folder)
Download the minecraft.jar from http://www.minecraft.net/download
Create ~/.local/share/applications/minecraft.desktop containing (assuming that you have downloaded the file in ~/Downloads):

#!/usr/bin/env xdg-open
[Desktop Entry]
Version=1.0
Name=Minecraft
Comment=Start Minecraft
Exec=/usr/bin/java -cp ~/Downloads/minecraft.jar net.minecraft.LauncherFrame
Terminal=false
Type=Application
Icon=minecraft.png
Categories=Games;
StartupNotify=false

Find a nice icon on the Internet for Minecraft and save it as ~/.local/share/icons/minecraft.png
To start Minecraft, run desktop file that you've created. You can copy it to your desktop as well.


swap file full while memory is half empty

You have a small amount of RAM, and rather small swap.

That means that if you have a lot of programs open, or even a single browser with 5-6 tabs it will fill up the RAM. This leads to pressure to swap out stuff that is not in active use.

To make more sense of it, you should check which programs are hiding behind the PIDs you list. This can be checked with ps aux -q pidno which will additionally show you total memory useage by that process, user, and so forth.

When things are swapped out, there's no reason to read it in again before it's needed. Some software that is nominally running on your computer, may in reality be totally unused. Swapping such software makes sense.

On my laptop, right now, I have 8GiB of RAM, 4GiB available, and 1.5GiB of swap in use. Mysql is one of the things that is swapped out for me, which makes sense; I use it for development once a week, not every day.

In your case, you have a low amount of memory, and a low amount of swap. I would increase swap to the same amount as memory, at least, in your situation. This allows for better memory management by the kernel.

Some software, such as browsers, require large amounts of RAM. Chrome, with ten Ask Ubuntu tabs, and facebook open consumes close to 3GiB on my laptop.

To add more swap, you can simply use the following commands:

sudo dd if=/dev/zero of=/swapfile bs=1M count=2048
sudo chmod 600 /swapfile
sudo mkswap /swapfile
echo "/swapfile    none    swap    sw    0   0" | sudo tee -a /etc/fstab
sudo swapon -a

swapon -s should now show your new swapfile. bs=1M count=2048 will create a 2048MiB file. Modify to suit your needs.


change the default starting directory of nautilus from unity bar

Boot system in classic

If you are opening nautilus from Applications->System Tools->File Browser just right click on the Applications menu select "Edit Menus" select System Tools in the configuration window then right click on File Browser select properties remove the %U from the command line and replace with a new start location ie: / ( then close all the windows (this sounds more complicated than it is sorry) if you are starting nautilus from some other launcher just do the last bit.

May be this will help

Have a look at the answer to How to add my favorite places as a quicklist in my home's icon in Unity?

You can change the first Exec line to read Exec=nautilus Documents and it will open your Documents folder.


You may want to switch to postfix and then you can "relay" your email via your gmail SMTP.  (make sure you setup the less-secure apps setting(s) inside of google as well so it will allow the SMTP connection from your machine)

apt-get update && apt-get install postfix mailutils

vi /etc/postfix/sasl_passwd

add this line:

[smtp.gmail.com]:587 username@gmail.com:password

chmod 600 /etc/postfix/sasl_passwd

vi /etc/postfix/main.cf

relayhost = [smtp.gmail.com]:587
smtp_use_tls = yes
smtp_sasl_auth_enable = yes
smtp_sasl_security_options =
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
smtp_tls_CAfile = /etc/ssl/certs/ca-certificates.crt

then encode your password

postmap /etc/postfix/sasl_passwd

then kick postfix

systemctl restart postfix.service


You have to modify your boot order in the BIOS settings. Unfortunately I can't tell you exact steps because each machine kind of has its own bios interface. If you provide a picture of it maybe I can help better.

Go into your settings and search for something like "boot order" or "boot options", probably under "advanced options". You should see the windows partition (or maybe hard disk) listed above Ubuntu's. Move Ubuntu to be the first option, save and exit and it should be fine.

Sometimes it doesn't say which partition has what OS so you have to find a way to know. Try identifying by the sizes of your partitions.

comment if anything seems unclear...


How to switch APT mirror from the commandline?

Some solution (tested on my Ubuntu 18.04.1 LTS): https://github.com/jblakeman/apt-select.git

Install:

pip install apt-select

or:

pip3 install apt-select

Adding script to PATH to run it from everywhere (make it permanent):

export PATH=$PATH:~/.local/bin/apt-select

Examples usage:

Get the top mirror from the United States to generate a new sources.list::

apt-select --country US

Choose from the top 3 mirrors, including those last updated a week ago::

apt-select -c -t 3 -m one-week-behind

Select from 5 US mirrors with the lowest latency to your machine:

$ apt-select --country US -t 5 --choose


How to convert h5 file to image?? h5topng not working?

h5topng is a stand-alone program and you should be executing that command from the shell prompt, not from within meep (the meep> prompt). (At the meep prompt it is expecting Scheme code.)


At this moment you can still use Chromium with parameters:
chromium --disable-namespace-sandbox


can you set the screensaver to go on less than 1 minute?

If you just want the monitor to turn off (without immediately activating the screensaver), you could execute this command once you logged in:

xset dpms 10

This will make the monitor enter suspend in 10 seconds. You can read more about this in the manual page of xset.

The screensaver still needs to be activated in a different way, but a minute should not be problematic if all you want is to save power.


Setting wifi network priorities to avoid xfinity wifi

Make a complete connection to the xfinity wireless network (including password). Then reconnect to your desired wireless network. Then go to the network icon in the top panel and select Edit Connections.... Select the xfinity wireless profile and click the Edit button. In the General tab, uncheck the Automatically connect to this network when it is available. Then click the Save button. Done.


-bash: no such file or directory for ALL commands

Try reinstalling the packages

sudo dpkg --add-architecture i386
sudo apt-get update
sudo apt-get install libc6:i386 libncurses5:i386 libstdc++6:i386

Hope this helps!


how to correctly install apache2, php5, mysql and phpmyadmin

From a command line:

sudo apt-get install tasksel
sudo tasksel install lamp-server

https://help.ubuntu.com/community/ApacheMySQLPHP


Is the Ubuntu "Restore Test" program legitimate?

That sounds like you are on Ubuntu 12.10 and are using encrypted automatic backups.  Every two months, the backup system performs a Restore Test which will prompt for your password (see below for why).  You should have also seen in that same dialog a checkbox to disable such tests.

However, you should have seen a success or failure dialog at the end of the test (which may take some time).  It would have been a dialog that asked for attention in the launcher bar on the left, but would not have popped above your current window.  Maybe you didn't notice the dialog before logging out?  Else maybe there is a real bug.

(The restore test is done without using any saved passwords.  That is why it asks you.  This is done in part to confirm that the user has not forgotten the password and would able to restore on a fresh system.)


Disk changes device path during copy, from /dev/sdc to /dev/sdd

This is due to not having enough power for the usb storage device and can be fixed by providing more power either by mains or by a dual usb cable.


You should try to find a script version of the driver installer (a .run file for example) if it exists, and then execute it on your computer.

You can also find the source and build them on your system with make and configure.


Ok, after a sleepless night of googling and trying things out (like reinstalling unity and the x drivers), I decided to try out Intel's approach. Apparently they officially support linux and they have a graphics driver installer (link below). After downloading and installing everything started working again.

I'm in Ubuntu heaven again.

Enjoy!

https://01.org/linuxgraphics/downloads/2014/intelr-graphics-installer-linux-1.0.7


I dual-booted Ubuntu and Windows, and now I want to switch to another distro

Just install the new distro on top of the old Linux install.  You just need to know how large the partition is, so that you can see which it is during install.  Just make sure to format that partition and that partition ONLY during install.


How do I make a bootable usb drive for ubuntu?

I use Linux Live USB Creator, never had a problem

Link

You can even setup persistence and use the drive as a portable Ubuntu (but think need legacy mode enabled on new pcs for it to see the persistence option)

Obviously, you can also choose to install with it as well.

Also with Win7 I think you can just right click iso and it gives option to write to USB (if drive plugged in)

**Edit **

If your not familiar with persistence, it basically a place that saved files and packages will go to. Without persistence anything you do on a live CD will be gone on next boot.

So you can not only use the drive to install Ubuntu, but you can also take it around with you and boot from USB if you want access to Ubuntu on a PC that don't have it installed.

**Edit2 **

If this gets you going please mark as accepted so we both get some credit and more importantly, so the next person knows it's an accepted answer for the issue.


Is libsnappy.so and its variants needed?

snapd and snappy are two different things.

snappy is compression used by hadoop

Wikipedia Snappy compression

  Snappy (previously known as Zippy) is a fast data compression and
  decompression library written in C++ by Google based on ideas from
  LZ77 and open-sourced in 2011.2 It does not aim for maximum
  compression, or compatibility with any other compression library;
  instead, it aims for very high speeds and reasonable compression.
  Compression speed is 250 MB/s and decompression speed is 500 MB/s
  using a single core of a Core i7[which?] processor running in 64-bit
  mode. The compression ratio is 20–100% lower than gzip.

snapd - what is snap

  is a squashFS filesystem containing your app code and a snap.yaml file containing specific metadata. It has a read-only file-system and,
  once installed, a writable area.
  is self-contained. It bundles most of the libraries and runtimes it needs and can be updated and reverted without affecting the rest of
  the system.
  is confined from the OS and other apps through security mechanisms, but can exchange content and functions with other snaps according to
  fine-grained policies controlled by the user and the OS defaults.


How to install ubuntu c++ runtimes libraries

You can do:

sudo apt-get install libstdc++6:i386

in a terminal.


Ubuntu 16.04 rsync via ssh prompts me for password, how to make it a cron job?

This should do it:

sudo rsync -e 'ssh -i /path/to/pi's/id_rsa' -aAXv / --delete --ignore-errors --exclude={"/dev/*","/proc/*","/sys/*","/tmp/*","/run/*","/mnt/*","/media/*","/lost+found"} pi@prime:/mnt/solar


Install the Ubuntu sound application in Lubuntu


((expression))
              The  expression  is  evaluated  according to the rules described
              below under ARITHMETIC EVALUATION.  If the value of the  expres‐
              sion  is  non-zero, the return status is 0; otherwise the return
              status is 1.  This is exactly equivalent to let "expression".

       [[ expression ]]
              Return a status of 0 or 1 depending on  the  evaluation  of  the
              conditional  expression expression.  Expressions are composed of
              the primaries described  below  under  CONDITIONAL  EXPRESSIONS.
              Word  splitting  and pathname expansion are not performed on the
              words between the [[ and  ]];  tilde  expansion,  parameter  and
              variable  expansion, arithmetic expansion, command substitution,
              process substitution, and quote removal are  performed.   Condi‐
              tional operators such as -f must be unquoted to be recognized as
              primaries.

This covers the basics regarding bash expression types and is from the bash man page. For more an Arithmetic expressions see this.

Sources:

man bash

http://www.softpanorama.org/Scripting/Shellorama/arithmetic_expressions.shtml


As you have an "older Inspiron" I would recommend using the wubi installer. I used it myself and it worked just fine.

wubi installer: --> Wubi

And if you decide to continue your installation here's the guide: Ubuntu Installation


add repository to ubuntu from terminal with pgp key

This command will get the public key for the repo :

gpg --keyserver pgpkeys.mit.edu --recv-key C90F9CB90E1FAD0C && gpg --export --armor C90F9CB90E1FAD0C | sudo apt-key add -

It works for any repository, you just have to replace the public key number in the command with the one from the error message.


The recommended way is run command

sudo do-release-upgrade


Had the same problem on my Dell D630; it's a Lubuntu thing.

Open Menu>Prefrences>Setup Hot Keys
Click the 'Programs' tab and locate the command "amixer -q sset Master toggle"
Double-click the command and modify to this: "amixer -D pulse -q sset Master toggle".

This will make the mute button toggle properly. If you want the volume keys to unmute as well, the command "-D pulse" can be inserted into those commands in the same fashion (e.g.: "amixer -D pulse -q sset Master 3%+ unmute")

Hope this helps!


Bash script to dynamically find and construct the url and download

What about this?

#! /bin/bash

re='^[0-9.]+$'  #regex to match digits and dots

VERSION_1=$(  # variable for the CentOS version
lynx --dump http://centos.bio.lmu.de/ |grep "/$" | \
while read i
do
  TMP_VERSION=`echo $i |awk -F "/" '{print $(NF-1)}'`
  if [[ $TMP_VERSION =~ $re ]] ; then
     echo $TMP_VERSION
  fi
done | sort -t . |tail -1)

VERSION_2=$(  #Variable for the ISO name
lynx --dump http://centos.bio.lmu.de/$VERSION_1/isos/x86_64/ |grep DVD| grep "\.iso$" |awk -F "/" '{print $NF}'| \
while read i
do
  echo $i
done |tail -1
)

wget http://centos.bio.lmu.de/$VERSION_1/isos/x86_64/$VERSION_2


can't update drivers through software & updates

What kind of computer do you have? If its a dell you either have to search up Network connections on your computer and get the wi-fi through that way. If it doesn't work try hooking up your computer to your motum and the typing the password to your wi-fi when your hooked up to it. I have had to do this with dell computers. Hope this helps.


Why doesn't pstree command show init in Ubuntu 16.04 LTS?

Since 15.04, init on Ubuntu is systemd. It is possible to use Upstart, but the default is systemd. For example, /sbin/init will be a link to /lib/systemd/systemd. /sbin/{shutdown,reboot,telinit,halt,runlevel,poweroff} are links to /sbin/systemctl. Even in 16.04, Upstart was used as a session init, so you might see Upstart as the parent process or an ancestor process in your graphical login (though it seems to have changed in 16.10).

The other processes you see are systemd components; they're developed and distributed along with systemd but many are not essential to running systemd as init. Many components can be replaced or disabled. To quote the systemd homepage:

  systemd is a suite of basic building blocks for a Linux system. It
  provides a system and service manager that runs as PID 1 and starts
  the rest of the system. ...  Other parts include a logging daemon,
  utilities to control basic system configuration like the hostname,
  date, locale, maintain a list of logged-in users and running
  containers and virtual machines, system accounts, runtime directories
  and settings, and daemons to manage simple network configuration,
  network time synchronization, log forwarding, and name resolution.

And this blog post from one of the creators of systemd (Lennart Poettering):

  Myth: systemd doesn't allow your to replace its components.

  Not true, you can turn off and replace pretty much any part of
  systemd, with very few exceptions. And those exceptions (such as
  journald) generally allow you to run an alternative side by side to
  it, while cooperating nicely with it.


What does CN mean in aria2 downloading info?

man aria2c has this way down starting on line 2480:

MISC
Console Readout
While  downloading files, aria2 prints the console readout to tell the progress of the downloads. The console readout is like this:
[#2089b0 400.0KiB/33.2MiB(1%) CN:1 DL:115.7KiB ETA:4m51s]

This section describes what these numbers and strings mean.
  #NNNNNN
         The first 6 characters of GID in hex string. GID is an unique ID for each download.

  X/Y(Z%)
         Completed length, the total file length and its ratio. If --select-file is used, this  is  the  sum  of  selected file.

  SEED   Share  ratio.  The  client  is now seeding. After BitTorrent download finished, size information is replaced with this.

  CN     The number of connections the client has established.

  SD     The number of seeders the client is now connecting to.

  DL     Download speed (bytes per second).

So, CN is "The number of connections the client has established.


It can be as simple as

iconv --from-code $enc input-file |
    sed 's/é/\\'\''e/;s/ü/\\"e/;s/ã/\\~a/' |
    iconv -to-code $enc >converted-input-file

where variable enc contain the encoding of the input file, one of the strings obtained from iconv -l.


The most likely situation is that the display output that is not working is directly wired to the discrete graphics card. The solution to this hasn't been fully implemented in Linux at the time of this writing (2013-03-19), but it is underway: it's called reverse-PRIME.


Ok, a few things here.
1st try F12 when starting up - this typically goes directly into boot mode.
If that doesn't work...
2nd try this method - granted it's for a DVD player, but this may help you enable the Legacy Bios Mode or the UEFI (CSM) Compatibility Support Module which should help realize the USB drive.
https://superuser.com/questions/524598/asus-uefi-bios-options-how-to-boot-from-dvd
If that doesn't work....
3rd try this method - remove the USB device get into BIOS settings and try the above (2nd method) then reboot with USB device installed so that it may recognize the USB drive.
If that doesn't work...
4th try this method - When in the BIOS area his "CTRL + F1" this should give you all options available.
If that doesn't work...
5th try this method - Open up your computer (be very careful not to short anything use a grounding strap) and find your CMOS Jumper and reset your BIOS - this will be specifically called out in your motherboard's manufacturer's manual for clarification.
Hope this helps.


Just boot to Ubuntu, and run update-grub so it can detect your windows installation:

sudo update-grub

It should list all the systems it finds in the plugged hard drives. When you reboot, there will be an option for each one in grub.


Ubuntu 16.04: Using the 'memory' GSettings backend while trying run python application

According to this Stack Overflow Q&A the following command should fix your error message

export GIO_EXTRA_MODULES=/usr/lib/x86_64-linux-gnu/gio/modules/

but that is not the only reason why your code doesn't work.

According to OpenCV documentation, imshow works only with a waitKey call.

The following will work now because the program will wait for user input before closing the image window.

import cv2
import numpy as np

img = cv2.imread('kura.jpg',0)
cv2.imshow('image', img)
cv2.waitKey(0)


Gparted - "Unable to satisfy all constraints on the partition"

When I come across this error, I try again, but make sure that that the option "Align to" is set to "none" (it seems to use MiB by default). This usually works for me, although sometimes I have to try it two or three times before it works. This might not be the best solution, but it might work for you.


Why isn't my external HDD and SD card found anywhere in Ubuntu 12.04 (though lsusb detects it)?

From discussion with you in chat the problem is clear. I guess, you have unknowingly messed up your previous OS, a bit. But even when you upgraded, the issue did not solve(i.e your HDD did not get detected in Nautilus or Disks utility though lsusb detected it) as the mess you made was carried on as cache into your new OS(thats my guess). Also you seem to tell that you kind of messed up a formatting process of your HDD before. So even if you clear the cache(and make Disks Utility detect your HDD) your HDD won't be detected(by Nautilus). Now this makes the solution clear and it is presented below:-

Step 1 - Clear Cache :-

Firstly we must clear cache. For this we can use Ubuntu tweak's "Janitor" feature as explained below:-

To install Ubuntu tweak run the following commands(one by one) in your terminal(which can be opened with Ctrl+Alt+t):-

sudo add-apt-repository ppa:tualatrix/ppa
sudo apt-get update
sudo apt-get install ubuntu-tweak

Now open Ubuntu tweak from the dash. You can do the same with the terminal too by typing the command:-

ubuntu-tweak

In Ubuntu tweak, select Start Janitor and then select all the cache to be cleared(including old kernel, package configurations and the like). Now select Clean. This might take a while.
After this reboot your PC.

Step 2 - Formatting your HDD :-

You must now be able to see your external Hard Disk Drive in the Disks utility(which can be found in the dash as Disks) but not Nautilus. For your HDD to work normally, in Nautilus, you must reformat it and then mount it. I will explain how to do this below:

Select your HDD.
In disks utility you will see three icons as shown below :-

Now press the first button. This will unmount the HDD. (Note that you may not want to do this because already it may be unmounted in your case)
Then press the gear like icon(the third one) and select Format as shown below :-

This should format your HDD. Now mount it again by pressing the first icon.

This should detect your HDD normally and you must able to work with it normally too!

As with the SD card you must connect and check it now and it should work.(And from your chat discussion it actually did get detected!)

PS :- Here is the link to the chat room in which the issue was discussed.


You cannot open a .exe file in ubuntu this is a windows specific file format.
Open office an its pendant libre office can  be downloaded as a seperate ubuntu/linux version. You can identify the selfextracting packages unter ubuntu by the ending .deb.
Here's the download site with open office for all available platforms. Be sure to select the suitable platform (64-bit versions are usually marked as x86-versions)

So in short words: exe = windows; deb = linux

There are of course ways to execute an .exe file on linux, further information you can get googling for wineHQ, but for open office this is not necessary


No dual-boot available after installation of Ubuntu 14.10 alongside Windows

Use gparted to make sure you haven't deleted your Windows partition and installation If you haven't overwritten it, I suggest reading this. It should help you on your way to restoring your option to dual-bootFYI: I obtained this link rather easily by doing a simple search. I can only imagine this question has been answer 1000000 times


PHP file not loading from apache's subdirectory

As mentioned in the comments, this is a permission error. We have to make sure all those .php files are executable. In your case -rw-r--r-- means the owner of the file has read+write permission, while others in and outside of the group can only read the file. As a result, we have to change this by running:
chmod a+x /var/www/html/subd/*.php

This allows everyone to execute any php files in subd.
Also, please make sure to change the folder's permission as well:
chmod a+x /var/www/html/subd

More information about permission can be found here.
Hope this helps :)


20.10: Getting notifications despite Do Not Disturb

Same here.
Ubuntu 21.04, 20.10 Gnome's "Do not disturb" does not work.
But I found something.
When "Do not disturb" enabled, notify-sned "message" is disabled.
But other applications' notifications are not disabled.
So I had to disable all applications' notifications when I want "DnD".
For disabling all applications' notification, I made the following script.
Run the script at GNOME startup, after that whenever Gnome Shell "Do Not Disturb" status changed, the script enable/disable all applications' notification.
#!/bin/bash
function change_app_notification() {
    APPS=( $(dconf list "/org/gnome/desktop/notifications/application/") )
    declare -p APPS

    local enable=$1

    for app in "${APPS[@]}"
    do
        echo "$app 'enable' to -> $enable"
        dconf write "/org/gnome/desktop/notifications/application/${app}enable" $enable
        # show-banners has no effect
        # dconf write "/org/gnome/desktop/notifications/application/${app}show-banners" $enable
    done

}

# first sync current state
change_app_notification $(gsettings get org.gnome.desktop.notifications show-banners)

# monitoring show-banners value
while read line
do
    show_banners=$(echo $line | cut -d' ' -f2)
    echo "current gnome notifications show-banners : $show_banners"
    change_app_notification $show_banners
done < <(gsettings monitor org.gnome.desktop.notifications show-banners)


Gwoffice 0.97 has a dependency issue and won't install

Check the thread at eidete: Depends: libgranite1 but it is not installable, it says you need stuff from elementary-os in your sources.list

 # sudo nano /etc/apt/sources.list

Add the two lines for 12.10

 deb http://ppa.launchpad.net/elementary-os/daily/ubuntu quantal main
 deb-src http://ppa.launchpad.net/elementary-os/daily/ubuntu quantal main

or for 12.04 as in my case

 deb http://ppa.launchpad.net/elementary-os/daily/ubuntu precise main
 deb-src http://ppa.launchpad.net/elementary-os/daily/ubuntu precise main

# sudo apt-get update

For the public key error

 # sudo gpg --keyserver pgpkeys.mit.edu --recv-key BF36996C4E1F8A59
 # sudo gpg -a --export BF36996C4E1F8A59 | sudo apt-key add -

 # sudo apt-get update

And then further update should work as usual


Ubuntu 16.04 will not resume from Suspend

This suggestion comes from an answer to another post on AskUbuntu. Credit to @ArnovanderWeijden:

Please keep in mind that rebooting requires you to hold the power button when it hangs. (alt+prtscn/sysrq+reisub doesn't work)

step 1: reinstall you system without swap (if you encrypt your home
directory that is)
step 2: boot into your new installation but don't log in. go to tty1
(ctrlaltf1)
step 3: upgrade your kernel to 4.7.6
step 4: reboot (and hold the power button when it hangs to kill it)
and log into tty1
step 5: install the Nvidia drivers and prime

sudo add-apt-repository ppa:graphics-drivers/ppa

sudo apt update

sudo apt install nvidia-367 nvidia-prime

choose lightdm when prompted

step 6: reboot and log into gnome.
step 7: open a terminal and execute

sudo prime-select intel

and reboot.

When grub shows up press 'e' and at the end of the line that starts with 'linux' add 'nomodeset'.

Press F10 to boot into your system

step 8: log in (that's possible thanks to lightdm and nomodeset)

Download this and install it. (your firefox will probably not work at this point. to get it to work execute sudo chown -R $USER:$USER ~/.cache)

sudo dpkg -i intel-grapics-update-tool_2.0.2_amd64.deb
sudo apt -f install
wget -q0 - https://download.01.org/gfx/RPM-GPG-KEY-ilg-r | sudo apt-key add -

step 9: run the program (its the only program that starts with
'intel' in your dash. After it's finished execute a reboot (this is
the last reboot that requires you to kill your system).
step 10: (after entering nomodeset) boot the system and log in.
Install all the updates and reboot.
step 11: enter nomodeset and log in. install gksu (sudo apt install
gksu) and run gksudo gedit /etc/default/grub and add nomodeset
after quiet splash. (you can run sudo dpkg-reconfigure gdm3 at
this point to get the gdm3 login screen back)
step 12: run 'gksudo gedit /etc/grub.d/40_custom' and copy your
ubuntu menuentry from /boot/grub/grub.cfg into it. remember to remove
the nomodeset from 40_custom. name it 'ubuntu nvidia'
step 13: create /usr/local/bin/intel (and nvidia) with the following
code

#!/bin/bash

prime-select intel

grub-reboot 0

and

#!/bin/bash

prime-select nvidia
grub-reboot 7
reboot

make them executable (and perhaps add them to visudo) and you are done!!
if steam doesn't work on intel see Edit ∞².

ooh and if sudo update-initramfs -u -k all gives you errors you can find the missing firmware here. Read the readme file to find out how to install them (some need --install operator while others just work)


Problems setting up internet connection ubuntu server 14.04: no eth0

Revert to the old eth*/wlan* names on 14.04:

Solution 1:

sudo apt-get remove biosdevname
sudo update-initramfs -u
reboot

Solution 2:

Edit /etc/default/grub and add biosdevname=0 to the following variables:

GRUB_CMDLINE_LINUX_DEFAULT="biosdevname=0"
GRUB_CMDLINE_LINUX="biosdevname=0"

Then run:

sudo update-grub
reboot

Solution 3:

Edit /etc/udev/rules.d/70-persistent-net.rules and name the cards as you wish, then reboot.

Revert to the old eth*/wlan* names on 15.10:

Solution 1:

Edit /etc/default/grub and add net.ifnames=0 biosdevname=0 to the following variables:

GRUB_CMDLINE_LINUX_DEFAULT="net.ifnames=0 biosdevname=0"
GRUB_CMDLINE_LINUX="net.ifnames=0 biosdevname=0"

Then run:

sudo update-grub
reboot


Remove white blinking cursor for only one terminal - bash Script

In gnome-terminal, you should be able to set cvvis (cursor visible) and civis (cursor invisible).
$ tput civis ## turn cursor off
$ tput cvvis ## turn curson on


You could remove the date and time using an exact expression if the format is consistent, then you will be left with the filename part no matter what characters it has.
rename -n 's/^\d{8}\.\d{2}\.\d{2}\.\d{2}\.//' *

remove -n after testing to actually rename the files.
Notes:

\d{8} exactly 8 digits
\. literal .

Thanks to @terdon for pointing out that in rename we can use \d to represent any digit instead of [0-9]


Internet wired connection holds only few seconds/few requests before needing to call dhclient again

Since it was an ssd that was not the main hard drive of my computer, I've put back the main hardrive, the connection was then working, so when I came back to the ssd it was working again !


Icon missing when application is launched

What will most probably solve your problem is to do the following:

Open the application
When it is running, open a terminal and type:

xprop WM_CLASS

Then click on the open application window.
The output will look like (example gedit):

WM_CLASS(STRING) = "gedit", "Gedit"

Use the first part (in this case would be gedit), to compose a line in your .desktop file:

StartupWMClass=<string>

(replace <string> with the actual (first part of the) output of xprop WM_CLASS, e.g. StartupWMClass=gedit)

Now try again (you might have to log out / in), most likely the application will appear in the launcher under its own icon.

Explanation

When an application starts up correctly from a launcher (.desktop file), but another icon appears with only a generic icon (question mark), it is most likely that the application window and the launcher do not connect for some reason, and the launcher does not recognize the application's window as "his". This is often the case when a script or a non- standard application (-command) is used. In those cases the StartupWMClass= line is often the solution.


There is a section about this error in the FAQs for the atom-runner package here that may help you.

It would seem that the python command is not in your path. Check where python is in your system with

which python

and check that the path (or at least part of it) is in your PATH:

echo $PATH

If not, adding the path to python to your PATH should solve the problem. To do so, add the following line to your .bashrc file:

export PATH=$PATH:[your path to python here]

replace the square bracket with the output from which python


Regarding the main question:

This is most likely realized with conky.

About conky

Conky is a system monitor for X originally based on the torsmo code.

Install

You can install conky from default repositories via:

sudo apt install conky-all

First steps

After having installed you can choose by manually creating a config file, search one from in the internet or use some third party app like Conky Manager (http://www.teejeetech.in/p/conky-manager.html) to get started.

Assuming you have a first config file named conkyrc in ~/.config/conkyrc.

You could start conky with this particular config like this from a terminal

conky -c ~/.config/conkyrc

Detailed instructions about setting conky up can be found in the Ubuntu Community Wiki.

Getting ideas / inspiration

There are tons of pages discussing conky configurations and use cases, one possible starting point to get inspired and more ideas on what is possible can be found on reddit.


Any screenshot application that supports HiDPI?


Gedit clears contents of clipboard on exit - how to keep it?

The Ubuntu wiki on Clipboard Persistence suggests that what I'm seeing is a bug but at the same time the intended behaviour. I am now using Parcellite to make things work for me. Thank you for your suggestion.


How do I change screen resolution automatically when computer starts up?

You can use a GUI frontend to Xrandr, for example ARandR.

ARandR is designed to provide a simple visual front end for XRandR. Relative monitor positions are shown graphically and can be changed in a drag-and-drop way.

To install it in Ubuntu:

sudo apt-get install arandr

Now your configuration will be stored and loaded within the startup


Testdisk or gpart for recovering lost partitions?

I know gparted now includes a way to recover partitions. I have tried it on one of my drives and yes it works. My test was simple. Deleted the partitioned and then tried to recover it with gparted. It worked.

Now, that was the only test I did with gparted. I have used recovery tools like testdisk (And photorec), foremost and scalpel. With testdisk I can actually say that even after formatting a partition 3 times, installing stuff on top of it and well, doing a lot of stuff on it, I could still recover a very old partition, almost entirely. I even tested a Windows XP partition that after recovering, booted up and everything was working. Windows did not know the difference.

So from experience and much trust put into testdisk, I would first go with this one. I know is not GUI like, but it has a very intuitive terminal menu that tells you step by step what to do or what it has found.


Well, I've found out what the problem was, and I'll describe it here in case someone else gets here having similar issues.

Something was preventing unity-settings-daemon (hereinafter usd) from operating properly. In my case this something was indicator-keyboard (hereinafter indkbd) which failed to load because of some reason I still don't quite understand, but it has something to do with me adding a new keyboard layout (why it caused it to crash – and without as little as an error message too! – is beyond me). And apparently, indkbd crashing caused usd to crash as well (again, without an explanation of the cause).

I don't know which process runs usd, but it seems it kept launching it again and again. This was responsible for much of the weird behaviour I was witnessing (like the constant fluctuation between two themes and the constant disappearing and reappearing of the mouse cursor). Also, anything that usd takes care of after indkbd was not taken care of, which explains why some other things were not working.

I managed to find where the problem was by running dmesg and examining the segfault's: they were from uncountable usd processes, plus a couple of indkbd's – which made me suspect indkbd was not loading properly, which was indeed solved after restoring my keyboard layout list (/usr/share/X11/xkb/rules/evdev.xml).

The titular usd-locate-pointer seems to be responsible for attracting visual attention to the mouse cursor upon hitting Ctrl. It probably has nothing to do with the problem I had, it's just that more and more instances of it were launched by usd as the latter was constantly relaunched (which burdened my system even more).


Ubuntu partition doesn't boot, GRUB recovery ends in "initramfs"

It's a very bad idea to run Ubuntu on a non-native file system.  It'll work for a while and then give you problems (which is what's happening now).

Therefore:

Boot Windows and run a CHKDSK X: /F /R where X: is the drive letter of the partition currently failing.
Back-up all your files from this partition
Read How to efficiently partition a single Windows-Ubuntu dual boot disk to avoid problems in the future and take this answer how you should do it.
Re-install Ubuntu using your new knowledge...

And especially: don't use the link in your question as it is a solution using ext3 and ext4.  (Which is what I'm trying to make you use from now on)


Your currently running Linux kernel has a configuration (config) file in /boot/. The filename looks like /boot/config-*. Run the following to find the exact name.

ls -l /boot/config-`uname -r`

In there you can find whether those configuration parameters have been enabled or not.


Can no longer send mail. Suspecting /etc/resolv.conf shenanigans

It looks like you're using the wrong smtp server. It's not gmail.com. It's probably something like smtp.gmail.com or imap.gmail.com. Check your Thunderbird, or whatever, app settings.

Update #1:

In /etc/postfix/main.cf set:

relayhost = smtp.gmail.com:587
relay_domains = gmail.com

then reload/restart postfix.

And probably some modification of this...

# See /usr/share/doc/postfix/TLS_README.gz in the postfix-doc package for
# information on enabling SSL in the smtp client.
#
# TLS
#
smtp_use_tls=yes
smtpd_tls_cert_file=/etc/ssl/certs/ssl-cert-snakeoil.pem
smtpd_tls_key_file=/etc/ssl/private/ssl-cert-snakeoil.key
#smtpd_tls_cert_file = /etc/postfix/newcert.pem
#smtpd_tls_key_file = /etc/postfix/newreq.pem
smtpd_tls_CAfile = /etc/postfix/cacert.pem
#
# SASL
#
smtp_sasl_auth_enable = yes
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
smtp_sasl_security_options =


Go to 'Computer' instead. You may find it there. If not, check any drives that are in that folder. If any drives have 'Intel' or 'Documents and settings' (Or something like that) then that might be your C drive. First,  write down the drive's name, then write down some of those folders in that drive. Then go to Windows 7 and check if the folders match. If they do, go to Ubuntu and rename the drive to 'C drive' (Or something like that). If not, I can not help you.


Installing/Cloning from Ubuntu Installed and Running on USB to HD

Clonezilla is useful for that task related to "cloning"  (tested by me). The "Install" Procedure should be better if you run it from the installation disk and start from scratch.

With Clonezilla, you can clone your USB's system into a hard disk drive, after which you will have a hard disk drive with the partitions as in your USB with extra unused disk space. (It would be cool if you provide us with the current partitioning sizes of your USB in order to give you a more comprehensive scenery).

You may wish to use all the hard disk drive capacity for the system. If so, you will simply need to start again from your USB, (the current one you use for booting or a live CD), then use gParted, erase your current swap file system in order to preserve your boot partition in one piece, and write a new swap at the very end of the partitions.

The procedure itself will delay a while depending on your hard disk drive capacity but it is easy indeed.

This procedure is how I cloned my 4GB USB system into a 8GB SD Card and some other cases with hard disk drive.

If you need further details please provide a screenshot of your current partitions in gparted, let us know how much memory does your computer have and the size of the hard disk drive where you wish to clone your system.

Cloning your system will preserve all your software, documents, configurations, etc.

Good luck!


What's the definition of a linux distro?

From Wikipedia:

  A Linux distribution (often called a distro for short) is an operating system made as a software collection based on the Linux kernel and, often, on a package management system.

So basically, a Linux distribution is a set of packages that creator selects for you.

  ...but now I have 7 desktop environments. Am I still using Ubuntu?

Yes! Because even you have modified with desktop environments, the remaining set of softwares are still the safe.

The fun thing to note is, even if you modify all the softwares to match other distro, the name of Ubuntu will still be connected somewhere deep in the source code. ;)


It looks like the program is looking for fonts from the Freefont suite of fonts, which are available in the Ubuntu repositories. Try:
sudo apt-get install ttf-freefont


sudo /usr/lib/lightdm/lightdm-set-defaults -s ubuntu

sets Unity 3d as default.


This is probably because apt-get is being used already. Close the Ubuntu software center, and if you are using dpkg or apt-get on a different tab, wait for it to finish.

If that doesn't work try rebooting.

If you don't want to reboot, try:

sudo rm /var/lib/dpkg/lock

Note that this could break your system and it should only be used if everything else doesn't work.


Is there a good alternative hex editor instead of HxD editor?

You might look at GHex. I don't know if it'll meet your specs, but I think it's worth a look.

In terminal...

sudo apt-get update

sudo apt-get install ghex

Or you can probably find it in the Software app.


"You are not the owner" after upgrade Ubuntu 18.04 BIOS to 20.04 UEFI

Thanks all, the solution was to re-mount the disk specifying uid=1000 in /etc/fstab.


fix the partition indexes OR fix ubuntu EFI

I've never heard of any Linux or OS X repair tool that automatically deletes the EFI System Partition (ESP). More information on this is welcome, and filing a bug report is in order if it's a bug in a Linux tool. (Contact the software's publisher if it was a bug in OS X software that caused the problem.)

As to re-indexing partition numbers, the GPT fdisk (gdisk) program can do this. It's in the gdisk package in Ubuntu, or you can install the OS X version if you prefer. Use the s option on the main menu, then type w to save your changes. (You may also want to use p to view the partition table both before and after sorting the entries.) If the order was not sorted before or if it had gaps, you can use the t option on the experts' menu to transpose any two partitions (including empty entries), thus enabling you to create any ordering you like.

I'm not sure what you mean by your last sentence; please clarify.