Why does CPU usage spikes to 90% and more after wake from suspend on Ubuntu 13.04?

I had the same problem:

sudo stop acpid
sudo bash
echo 'manual' > /etc/init/acpid.override

To undo, if needed:

sudo rm /etc/init/acpid.override
sudo start acpid


There is probably no one that know exactly where the keyboard configuration is kept. It depends if you have ibus set (by default yes), which xkb settings you have, and from the registry-under-another-name which has become the gsettings database.

Try to use dconf-editor and compare bits of configuration under the schema desktop.ibus and/or  org.gnome.input-sources --- a screenshot of the latter follows.

PD yes, I'm quite sad about the situation. International keyboard is mostly broken on Ubuntu since 13.04, plenty of bug reports around, and still not solved.


Removable Drive keeps getting dropped/ unmounted

It sounds like your drive is damaged:

[  372.444424] end_request: I/O error, dev sdb, sector 250589039

Here are some things to try:

Attach the drive to a Windows machine and run a checkdisk there. NTFS checks are probably better under Windows (this is an assumption).
Run ntfsck. On Debian systems, /sbin/fsck.ntfs is a symlink to /bin/ntfsfix but this does not seem to be the case on Ubuntu. So, you need to run ntfsck manually. This should already be installed but if not, install it with sudo apt-get install ntfs-3g. Then run

sudo ntfsfix /dev/sdb1

Use smartctl to show the S.M.A.R.T. status of your drive:

sudo smartctl /dev/sdb

This won't solve anything but might help debug the problem.


This is possible:

Go to system settings and then:

Window Management --> Task switcher --> Tick only one window per application


Immediately lock screen when I close laptop lid under Gnome 3 (14.04)

There may be other simple method available for what you want but you can  lock you screen using this script upon closing your lid. I found it on help.ubuntu.com. I am trying to keep it short. For detail explanation you can visit the link.

Make the environment variables available for root.

gedit ~/export_x_info

and paste the following contets

# Export the dbus session address on startup so it can be used by any other environment
sleep 5
touch $HOME/.Xdbus
chmod 600 $HOME/.Xdbus
env | grep DBUS_SESSION_BUS_ADDRESS > $HOME/.Xdbus
echo 'export DBUS_SESSION_BUS_ADDRESS' >> $HOME/.Xdbus
# Export XAUTHORITY value on startup so it can be used by cron
env | grep XAUTHORITY >> $HOME/.Xdbus
echo 'export XAUTHORITY' >> $HOME/.Xdbus

Make it eecutable using

chmod 700 ~/export_x_info
You need to run it on startup. So add it to Startup Applications. Select Startup Programs from Gnome Menu, and click Add.

Name:<Any name you want>
Command:/home/your_user/export_x_info

Now you need to edit your /etc/acpi/lid.sh file which catch lid open and close event. Change user_name with your user name

gksudo gedit /etc/acpi/lid.sh and  paste

/home/your_user/lid_event just after #!/bin/bash. Save and close.
Now you need to create a script for close event so that you can lock your screen.

gedit ~/lid_event and paste the following.

#!/bin/bash
grep closed /proc/acpi/button/lid/LID0/state
 if [ $? = 0 ]
 then
 source /home/user_name/.Xdbus
 DISPLAY=:0.0 su user_name -c "gnome-screensaver-command -l"
 fi

Also check for /proc/acpi/button/lid/LID0/state file  because LID0 may be LID.
Now restart your ACPI using

sudo /etc/init.d/acpid restart
Make sure that the Power Management option for laptop lid closed is set to do nothing


Automation tool for configuration, installation and editing tasks

You are looking for ansible or alternative like saltstack, puppet or chef.
Ansible works with playbooks that you run. Those will ssh to the hosts you want and become with sudo use installation commands. Ansible uses python and Ansible modules that execute tasks that you defined in your YAML. There is a file edit module that can replace or add lines.
https://www.digitalocean.com/community/tutorials/how-to-use-ansible-to-install-and-set-up-lamp-on-ubuntu-18-04


Unable to Install GRUB in /dev/sda on raid drives

As I seem you should have used guided partition skim, when you are going to install grub it doesn't see that, so  you should make a small (1MB) partition on each disk and RAID them together and set it as a GRUB boot partition. Set up your other RAID partitions (e.g. swap and /) and then the GRUB installer should find the boot area just fine.


Ubuntu software that can edit .mov files created in Adobe after effects

I think the best answer to your question could be Kdenlive, that's the only what I can suggest for Ubuntu/Linux.

Kdenlive is an intuitive and powerful multi-track video editor, including most recent video technologies.

And there are two ways you can install it from:

sudo apt-get update
sudo apt-get install kdenlive

This will install the latest release that is in Ubuntu repos and it's 0.9.6, but if you wish to install the latest official release 0.9.10 from Kdenlive official source releases:

sudo add-apt-repository ppa:sunab/kdenlive-release
sudo apt-get update
sudo apt-get install kdenlive


how to register an IRC user on freenode?

You put these commands in the chat section, where you chat. Empathy doesn't support nickname registration

Here's a tutorial.


The sequence of commands you've used results in a new image file with the original, un-resized content, and some new content is appended but entirely inaccessible.

In order to resize a QCOW2 disk image, you should use qemu-img resize instead. For example:

qemu-img resize vm.qcow2 +100G

There's no need to cat anything.

Keep in mind that this only changes the size of the virtual disk; you still need to use partitioning and filesystem tools to resize the virtual disk partitions and the filesystems contained on the virtual disk.


How can I install the Social-Engineering Toolkit (SET)?

As the install instructions on the page you linked to say:

First:

be sure to install subversion before installing the selected tools

Then as root:

svn co http://svn.secmaniac.com/social_engineering_toolkit set/


How to ask a web page to show desktop website using Ubuntu Web Browser?

Generally that's not a feature of the browser. Most websites offer the option to show their Desktop version, mostly at the bottom of the page.


Source: Stack Exchange
Ubuntu and its bundled FFmpeg

Well, you've run into the problem that FFmpeg doesn't ship with Ubuntu anymore but you've tried to install it through apt-get.

This program is not developed anymore and is only provided for compatibility

This is simply a lie. FFmpeg is actively developed, but the Ubuntu packages are outdated and they switched to libav. See here for the bug report that discusses the wording of the message.
Installing from source or using a static build

If you're not into compiling yourself, you can simply grab a static build either from Burek or Relaxed. Extract the folder and use the ffmpeg binary that's in there.

If you want to stay up to date and configure the tool yourself you'll need to compile it from source. Check the Ubuntu compilation guide for a detailed howto on installation. Following these steps, you'll end up with the newest version of both FFmpeg (the encoding tool) and x264 (a certain video encoder).
What do I need to reduce the size?

You ask …

which file formats and compression methods are recommended these days

In fact, there's only one compression method ("codec") everyone would recommend. It's the h.264 or MPEG-4 Part 10 / AVC standard, which specifies a compression method for low bandwidth video. h.264 also achieves great results for higher bandwidths. A very common encoder for it is called "x264", the one we've installed above.

It supersedes MPEG-4 Part 2, the video codec standard that made the "DivX" and "XviD" encoders famous. These are good too, but they need more bandwidth to preserve the same quality.

The actual file format does not matter. h.264 video can reside in almost any container, from AVI to MP4, MOV and MKV. It's important to know the difference between a video codec per se, and the container that simply encapsulates it. See here for more: What is a Codec (e.g. DivX?), and how does it differ from a File Format (e.g. MPG)? I would choose MP4 or MKV as output container these days. AVI is just too old and doesn't allow you to do much with the video, and for the aforementioned containers there are better tools for remultiplexing available.

When you want to reduce the size, you want to reduce the average bitrate of the video. In the simplest case this would mean forcing the encoder to, let's say, 1.5 MBit/s constant bit rate. This works, but it has a few drawbacks. Instead of encoding with a fixed bit rate, let the encoder choose how much it wants to spend. This results in an average bitrate, adapted to the contents of the video. Do this by using the Constant Rate Factor option.

For x264, this means setting a value somewhere between 18 and 26 for this CRF. The default is 23, and higher values will give you worse quality, and vice-versa. You don't need to know exactly what it does, but if you're interested see this CRF guide.
How do you perform the conversion?

Once you have FFmpeg up and running, you can simply convert a video to x264 / MP4 with AAC audio at 192 kBit/s fixed bitrate:

ffmpeg -i input.avi -c:v libx264 -crf 23 -c:a libfaac -b:a 192k output.mp4

That's it. You can vary the output size and quality by adjusting the CRF value. Lower means better quality and larger size. Higher means worse quality and lower size. As I said, sane values are anywhere between 18 and 26, maybe more. If you really want to reduce the size of the input video, choose the CRF value that still delivers acceptable video quality with a reduction of file size.

To test how your video would look, you can press Q any time during the conversion. It'll leave a truncated file which should still be playable though. You could also supply the -t  option, where  specifies how long you want to encode (e.g. the first 30 seconds only).
Batch processing

If you have a batch of AVI files that you want to convert, you could do something like that:

while IFS= read -d '' -r file; do
  ffmpeg -i "$file" -c:v libx264 -crf 23 -c:a libfaac -b:a 192k ${file%%.avi}-converted.mp4
done < <(find . -iname "*.avi" -print0)

You can change the .avi suffix in this command and let it run again for other files.

Note that video encoding is a time consuming task and it takes a while to find the perfect settings for your source files.


How can I determine why apt-get will install a package?

What you really seem to be asking is "How do I diagram dependencies?" so you can see which packages pull in which dependencies.

You get both text and diagrammed dependencies from the apt-cache command (included in the apt package, part of the default install).

Here's an example of apt-cache for listing dependencies of the 'hello' package in text format. Text output will always be only one level.

$ apt-cache depends hello
hello
  Depends: libc6
 |Depends: dpkg
  Depends: install-info

You can read the diagram using any dotfile viewer, such as dotty (included in the graphviz package, also part of the default install)

Here's an example of getting the full dependency tree in graphical format, then displaying it. Graphical output will always be the full tree.

$ apt-cache dotty hello > dotfile
$ dotty dotfile

Looking it over, you can see that the 'hello' package pulls in a ton of Perl packages...and which dependency does it.


Your pattern is basically "make first column equal to value - 100". AWK is appropriate for that

$ awk -F';' 'BEGIN{OFS=";"}{$1=$1-100;print }' personList.txt
1; John Bauer;      811-7780831;
2; Anthony Higgins; 844-4317627;
2; Anthony Higgins; 844-4317627;
3; Arnold Sipes;    866-4343123;
4; Donald Quinn;    877-2828732;
5; Roy Jaeger;      551-2323001;
5; Roy Jaeger;      551-2323001;
5; Roy Jaeger;      551-2323001;

There's no inplace editing, so redirect the output to a new file.

$ awk -F';' 'BEGIN{OFS=";"}{$1=$1-100;print }' personList.txt  | tee newFile.txt
1; John Bauer;      811-7780831;
2; Anthony Higgins; 844-4317627;
2; Anthony Higgins; 844-4317627;
3; Arnold Sipes;    866-4343123;
4; Donald Quinn;    877-2828732;
5; Roy Jaeger;      551-2323001;
5; Roy Jaeger;      551-2323001;
5; Roy Jaeger;      551-2323001;

To address what you asked in the comments (making field #4 "Not Available" if it's empty), you could test for 4 characters of class digit using if statement and regex

$ awk -F';' 'BEGIN{OFS=";"}{$1=$1-100; if ($4 !~ /[[:digit:]]{4}/) $4=" N/A"  ;print }' personList.txt

1; John Bauer;      811-7780831; 1001;
2; Anthony Higgins; 844-4317627; N/A;
2; Anthony Higgins; 844-4317627; N/A;
3; Arnold Sipes;    866-4343123; N/A;
4; Donald Quinn;    877-2828732; N/A;
5; Roy Jaeger;      551-2323001; 1267;
5; Roy Jaeger;      551-2323001; 1273;
5; Roy Jaeger;      551-2323001; 1204;

Alternatively you could do something like this with if statement

if ( $4 !~ /.*[0-9].*/ )


You don’t need to touch /etc/hosts on the server. The contained records serve to connect other servers by name, similarly to DNS.

As you are indicating, the problem is likely caused by separate modem and router. You need to set port forwarding on all network devices1) sharing the same public IP address2) in the path to your server.

1) I mean all devices operating on network layer which is the layer of IP (including IP addresses). Hubs, switches etc. are not affected.

2) Public IP address is the address you get when accessing sites like http://whatismyipaddress.com/ from your LAN. Private IP addresses are used inside a LAN and usually begin with 10., 172. or 192.168. A LAN usually shares one public IPv4 address. This technique is called NAT.


When you run pip3 using the sudo command, the file that is installed is owned by root instead of your current user mue. The purpose of running pip or pip3 with --user is so that you don't have to use sudo when you install stuff.

First, you can run the following command to restore ownership to your current user:

sudo chown $USER:$USER $HOME/.local/bin/youtube-dl

Next, you can run the following command to properly update youtube-dl

pip3 install --user -U youtube-dl

Finally, if you do not get a warning about your path, you are done.

However, if you still get a warning that youtube-dl is not in your path, you can run the following commands to add the directory to your path:

cp ~/.profile ~/.profilebackup
echo 'export PATH=$HOME/.local/bin:$PATH' | tee -a ~/.profile
source ~/.profile


Is there a tool that will tell me why my hard drive is spinning up?

You can use find to find out which files have been accessed. E.g. find /hdd/mount/path -cmin -15 will show you the files accessed in the last 15 minutes. Of course you have to enter the right path where your HDD is mounted. Otherwise it will look for files in the whole system. Maybe this gives you a hint. If you have no idea what process accessed the files, you can also find out exactly.

Another tool that could be usefull is iotop. You have to install it first:

sudo apt-get install iotop

Then you can run

sudo iotop -m /hdd/mount/path

to see which processes are accessing a specific mount path or

sudo iotop -f /path/to/file

to see which processes are accessing a specific file. The downside is that you have to watch it and wait for the access to happen.


In gedit there is no bash or script highlighting mode.  The closest that they have is the sh highlight mode.

Plaintext mode:

View -> Highlight Mode -> sh then select:

sh highlight mode selected:


Change 2 or more LibreOffice documents to have the exact same styling/formatting

Use Libreoffice tools instead of CLI
When all you have are command line tools everything looks like a command line problem. I've decided to write this answer using LibreOffice macros:

Use a command line loop to process every Writer document in a "headless" environment.
Run macro to change .rtf (Rich Text Format) Writer document file.
Macro saves file and exit
Loop back to 1.

Create test data
Create two or more files containing:

Create script ~/Downloads/copy-rtf.sh containing:
cp ~/Documents/*.rtf ~/Downloads

Mark as executable using
chmod a+x ~/Downloads/copy-rtf.sh

During development and testing, the macros modifying *.rtf files will run against ~/Downloads directory.
Before each test type cd ~/Downloads and run ./copy-rtf.sh
After output is perfect, they are copied back into live directory.

The Downloads directory is used because:

everyone has a ~/Downloads
it gets added to regularly and manually emptied periodically
it is more permanent than /tmp/ directory which may not persist across reboots.

Run macro in headless environment
Using this Stack Exchange answer invoke Libreoffice Writer from the command line and pass it a global macro name to execute:
soffice -headless -invisible "vnd.sun.star.script:Standard.Module1.MySubroutine? language=Basic&location=application"

The above answer may not work so another method can be tried:
soffice "macro:///Standard.SaveCSV.Main" $1

Install Java Runtime Environment
To run macros you need Java Runtime Environment (JRE) installed. The developer's web page has instructions for downloading and installing manually.
However this AU Q&A: https://askubuntu.com/a/728153/307523 suggests it is as simple as:
sudo apt-add-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java8-installer oracle-java8-set-default

I tried the AU Q&A method and after the first step of adding the PPA a splash screen appears with additional information. The most helpful is a link to setting up JRE 8 on Debian systems.
The third step of installing JRE 8 requires you to use Tab and Enter to accept the License Agreement. Your machine will pause for a few minutes during the heaviest part of the installation routine.
Now open LibreOffice and select Tools -> Options -> LibreOffice -> Advanced and setup this screen:

Click the options for:

Use a Java runtime environment
Oracle Corporation 1.8.0_161
Enable macro recording (experimental)
Click OK
You will be asked to restart, click "Restart Now".

LibreOffice Writer Macro
The macro will read through the entire document and:

change font name to Ubuntu.
If heading 1 set font size to 28
else if font size is 18 set to 22
else set font size to 12

The macro will save document and exit Libreoffice Writer.
Turn off Dialog
Do a file save and this dialog comes up:

Turn this message off as show in the screen. The macro may not run properly if this option is on.
Macro contents
I spent a few days attempting to record a macro using "Tools" -> "Macros" -> "Record Macro" -> "Basic". At first it seemed promising but the recorded macro had inconsistent behavior and had to be abandoned for a hand written basic macro. A found help in Stack Overflow for an expert there to help me with the basic basic coding. Here is the result:
Sub ChangeAllFonts
    rem - Change all font names to Ubuntu.
    rem - If heading 1 set font size to 28
    rem - else if font size is 18 set to 22
    rem - else set font size to 12
    rem - The macro will save document and exit LibreOffice Writer.
    Dim oDoc As Object
    Dim oParEnum As Object, oPar As Object, oSecEnum As Object, oSec As Object
    Dim oFamilies As Object, oParaStyles As Object, oStyle As Object
    oDoc = ThisComponent
    oParEnum = oDoc.Text.createEnumeration()
    Do While oParEnum.hasMoreElements()
      oPar = oParEnum.nextElement()
      If oPar.supportsService("com.sun.star.text.Paragraph") Then
        oSecEnum = oPar.createEnumeration()
        Do While oSecEnum.hasMoreElements()
          oSec = oSecEnum.nextElement()
          If oSec.TextPortionType = "Text" Then
            If oSec.ParaStyleName = "Heading 1" Then
                rem ignore for now
            ElseIf oSec.CharHeight = 18 Then
                oSec.CharHeight = 22.0
            Else
                oSec.CharHeight = 12.0
            End If
          End If
        Loop
      End If
    Loop
    oFamilies = oDoc.getStyleFamilies()
    oParaStyles = oFamilies.getByName("ParagraphStyles")
    oStyle = oParaStyles.getByName("Heading 1")
    oStyle.setPropertyValue("CharHeight", 28.0)
    FileSave
    StarDesktop.terminate()
End Sub

rem Above subroutine is missing call to UbuntuFontName ()
rem also it is calling oStyle.setPropertyValue("CharHeight", 28.0)
rem which may cause problems. Will test. Also StarDesktop.terminate ()
rem is known to cause problems and will likely be reworked with a
rem a dialog box telling operator the program is finished and maybe
rem to press <Alt>+<F4>.

rem ========= Original code below for possible recycling ===========

Sub AllFonts
rem - change all font names to Ubuntu.
rem - If heading 1 set font size to 28
rem - else if font size is 18 set to 22
rem - else set font size to 12

rem The macro will save document and exit Libreoffice Writer.

Dim CharHeight As Long, oSel as Object, oTC as Object
Dim CharStyleName As String
Dim oParEnum as Object, oPar as Object, oSecEnum as Object, oSec as Object
Dim oVC as Object, oText As Object
Dim oParSection        'Current Section

oText = ThisComponent.Text
oSel = ThisComponent.CurrentSelection.getByIndex(0) 'get the current selection
oTC = oText.createTextCursorByRange(oSel)           ' and span it with a cursor

rem Scan the cursor range for chunks of given text size.
rem (Doesn't work - affects the whole document)

oParEnum = oTC.Text.createEnumeration()
Do While oParEnum.hasMoreElements()
  oPar = oParEnum.nextElement()
  If oPar.supportsService("com.sun.star.text.Paragraph") Then
    oSecEnum = oPar.createEnumeration()
    oParSection = oSecEnum.nextElement()
    Do While oSecEnum.hasMoreElements()
      oSec = oSecEnum.nextElement()
      If oSec.TextPortionType = "Text" Then
        CharStyleName = oParSection.CharStyleName
        CharHeight = oSec.CharHeight
        if CharStyleName = "Heading 1" Then
            oSec.CharHeight = 28
        elseif CharHeight = 18 Then
            oSec.CharHeight = 22
        else
            oSec.CharHeight = 12
        End If
      End If
    Loop
  End If

Loop

FileSave
stardesktop.terminate()

End Sub

Sub UbuntuFontName
rem ----------------------------------------------------------------------
rem define variables
dim document   as object
dim dispatcher as object
rem ----------------------------------------------------------------------
rem get access to the document
document   = ThisComponent.CurrentController.Frame
dispatcher = createUnoService("com.sun.star.frame.DispatchHelper")

rem ----------- Select all text ------------------------------------------
dispatcher.executeDispatch(document, ".uno:SelectAll", "", 0, Array())

rem ----------- Change all fonts to Ubuntu -------------------------------
dim args5(4) as new com.sun.star.beans.PropertyValue
args5(0).Name = "CharFontName.StyleName"
args5(0).Value = ""
args5(1).Name = "CharFontName.Pitch"
args5(1).Value = 2
args5(2).Name = "CharFontName.CharSet"
args5(2).Value = -1
args5(3).Name = "CharFontName.Family"
args5(3).Value = 0
args5(4).Name = "CharFontName.FamilyName"
args5(4).Value = "Ubuntu"

dispatcher.executeDispatch(document, ".uno:CharFontName", "", 0, args5())

end sub

sub FileSave
rem ----------------------------------------------------------------------
rem define variables
dim document   as object
dim dispatcher as object
rem ----------------------------------------------------------------------
rem get access to the document
document   = ThisComponent.CurrentController.Frame
dispatcher = createUnoService("com.sun.star.frame.DispatchHelper")

rem ----------------------------------------------------------------------
dispatcher.executeDispatch(document, ".uno:Save", "", 0, Array())

end sub


How to allow only ssh and internet access with iptables?

Let's start

Delete curent rules and chains

sudo iptables --flush
sudo iptables --delete-chain

allow loopback

sudo iptables -A INPUT -i lo -j ACCEPT
sudo iptables -A OUTPUT -o lo -j ACCEPT

drop ICMP

sudo iptables -A INPUT -p icmp --icmp-type any -j DROP
sudo iptables -A OUTPUT -p icmp -j DROP

allow established connections

sudo iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT

allow SSH

sudo iptables -A INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT

default policies

sudo iptables -P INPUT DROP
sudo iptables -P OUTPUT ACCEPT

Save

sudo iptables-save

This is it. I think :)


Swap partition get damaged when encrypted

I doubt it was damaged. Encrypted swap shows up as of type Unknown in tools like GParted, because the partition is filled with random data and such tools have no way of knowing that it really is an encrypted swap partition.


I believe you have installed the wrong driver. Let's fix it. With a working internet connection by ethernet, tethering or whatever means possible, open a terminal and do:

sudo apt-get purge bcmwl-kernel source
wget https://media-cdn.ubuntu-de.org/forum/attachments/04/32/2480236-Broadcom_Firmware.tar.gz
sudo tar xvf 2480236-Broadcom_Firmware.tar.gz -C /lib/firmware/

Reboot. If the wireless is not working as expected, please run:

rfkill list all

Is the hard block fixed?

EDIT: HP laptops use a module hp-wmi to translate key presses into action; in your case, turn off the hard block and turn on the wireless.

Let’s troubleshoot your problem.

First, and most obvious, look around your laptop and find the wireless switch and switch it. On some laptops, it may be called ’Airplane Mode.’ After you switch it, check again:

rfkill list all

Is there any change?

If not, check to see if the module hp-wmi is loaded.

lsmod | grep hp

If so, remove it:

sudo modprobe -r hp-wmi
sudo rfkill unblock all
rfkill list all

Any improvement?


Power management in Ubuntu is far from being perfect, but a battery life of a few hours only and a warm but idle phone are sure not normal. Open Terminal and enter top. It shows a list of processes sorted by CPU usage. You probably have to put the phone to landscape orientation to see full process names. An idle phone should have no processes taking more than 10% CPU time. If you see any process taking significantly more CPU time, check for bugs at https://launchpad.net or file a new one.

Unfortunately, it's quite difficult to find the right project belonging to the process in question. If in doubt, ask the mailing list for assistance.


What are Ubuntu One conflicts and how do I resolve them?

The conflicts occur when you start with a version X of a file on more than one computer, lets call them machine a and machine b. Then machine a edits the file making it X+a (the original version of the file plus the changes made on machine a). It takes some time for machine a to send the version X+a to the server, and some time for the server to send version X+a to machine b. So there's a window of time when machine b still has the version X (the original without the changes made on machine a). If machine b edits the file on that precise moment, it will send to the server a version X+b instead of X+a+b. In this case, the server has no way to tell which is the right version, as it is subjective depending on what the user is doing, so it will keep both versions adding a ".conflict" extension to one of them.

The Ubuntu One FAQ has information about how to resolve the conflicts here.

If your transfer rate to and from the server is slower than your edit rate on some files synchronized with U1 on more than one machine, then U1 files doesn't sound like the right tool for you. You should look for tools with conflict handling, like u1db, bzr or git.

If that's not the case but you are still getting a lot of conflicts, then you might be hitting a bug and you should report it on launchpad.

The size of that window of time when a conflict can arise depends on many things, like your bandwidth, the load of the server, and the load of the links between your internet provider and the server.


Why ~/.bash_profile is not getting sourced when opening a terminal?

~/.bash_profile is only sourced by bash when started in login mode. That is typically when you log in at the console (Ctrl+Alt+F1..F6), connect via ssh, or use sudo -i or su - to run commands as another user.
When you log in graphically, ~/.profile will be specifically sourced by the script that launches gnome-session (or whichever desktop environment you're using). So ~/.bash_profile is not sourced at all when you log in graphically.
When you open a terminal, the terminal starts bash in (non-login) interactive mode, which means it will source ~/.bashrc.
The right place for you to put these environment variables is in ~/.profile, and the effect should be apparent next time you log in.
Sourcing ~/.bash_profile from ~/.bashrc is the wrong solution. It's supposed to be the other way around; ~/.bash_profile should source ~/.bashrc.
See DotFiles for a more thorough explanation, including some history of why it is like it is.
(On a side note, when installing openjdk via apt, symlinks should be set up by the package, so that you don't really need to set JAVA_HOME or change PATH)


You should just take some time to actually read the message since it is not an error.
Try this instead:

sudo service mysql start

Any change in output?

The reason for this is that the traditional sysvinit have been replaced by Upstart / Services as of Ubuntu 6.10. However, a great load of packages still use the old sysvinit way, which have been left in place for backwards compability. The biggest difference, apart from having to use another command, is that upstart is event driven, on the contrary of sysvinit which is a sequencial service manager.


Interruped Gparted NTFS resize. Still have access to drive but GParted cannot read contents

Hopefully, the NTFS partition's list of locations on the disk where the data for each file lies is correct. The fix under that condition is fairly easy if you can copy the files to a different drive. Here's how:

Remount the drive read-only

The first thing to do is to stop all writing to the drive. Remount it read-only by opening a terminal (press Ctrl+Alt+T), and run the following:

mount | fgrep media

It should tell you the external drives you have. For example, mine looks like this:

/dev/sdb1 on /media/username/EC-FLASH type vfat (rw,nosuid,nodev,relatime,uid=1000,gid=1000,fmask=0022,dmask=0022,codepage=437,iocharset=iso8859-1,shortname=mixed,showexec,utf8,flush,errors=remount-ro,uhelper=udisks2)

Make sure the mount point (the /media/username/EC-FLASH part in the example) is correct for your external drive. If it is, take the very first part (the /dev/sdb1 part in the example), and run the following, replacing /dev/sdb1 with what showed up for your drive:

sudo mount -o remount,ro /dev/sdb1

Preserve the files

Check all the files that you care about. Take your time on this. Do they open? Are the contents correct?
If anything is messed up, STOP. Don't continue with this guide, as it won't be able to fix messed up files.
Copy the files to a different drive.

Fix the external drive

In GParted, delete all partitions on the problematic external drive.
Create whatever partitions you want, making sure they get formatted.
Copy the files back to the NTFS partition.


customize top panel clock in Ubuntu 18.04

Once you installed the gnome-shell extension clock-override Open the extension preferences and change the values as shown below..

When you click the link "What do all these %x codes mean?" at the bottom right side of Extension preferences dialogue..

this link GNOME Developer site opens, from which you can understand and adjust the format/formats according to your wish..

%F: equivalent to %Y-%m-%d (the ISO 8601 date format)
%A: the full weekday name according to the current locale
%T: the time in 24-hour notation with seconds (%H:%M:%S)

Another Customization example:


Running the corresponding command will often not work because the binary is not in the PATH: you need to run it with an indication of the complete path, and also to run it as root:

sudo /usr/lib/x86_64-linux-gnu/gdk-pixbuf-2.0/gdk-pixbuf-query-loaders | sudo tee /usr/lib/x86_64-linux-gnu/gdk-pixbuf-2.0/2.10.0/loaders.cache

(may need to be adapted for your install)

More information in this Debian bug report.


How to add icons on the KDE Menu Editor icon source?

This is something which has frustrated me for a long time.

You should be able to right click on any icon and get the path to it, but that hasn't been implemented.

Since you haven't received a good answer, I'll give you a few clues.

Here are some places icons live:

/usr/share/app-install/icons
/usr/share/icons
/usr/local/share/icons
/usr/share/pixmaps

You can browse through them in Dolphin with Show Previews of Files and Folders turned on. Then, you'll see how they render.

You could, theoretically, add your new icons in these locations, but they might get deleted when you do software updates and upgrades. They will certainly be gone sooner or later when you do a clean install.

What I do instead is to save all my favorite icons (including some from the above locations) separately - especially because several that I really liked went away in newer releases. Now I put them in my own directory.

/home/my-user/icons

That way I can keep them no matter what I or the developers decide to do.

Then, when I want to use one from the icon dialog, I select Other Icons and Browse and go to the directory where I have them saved.


Changed GRUB settings now can't load Ubuntu

Download Boot repair tool from the following link:http://sourceforge.net/projects/boot-repair-cd/files/
Then burn it on CD or put it on USB key via Unetbootin.
Insert the Boot-Repair-Disk and reboot the PC.
Select Advanced option. There you can find boot menu timer option. Change as you like and apply.
Shut down your computer and remove boot cd and start again.


Find out which packages own (are responsible for the creation of) each directory: dpkg -S /etc/dhcp;dpkg -S /etc/dhcp3. I would guess that, if the /etc/dhcp3/dhclient.conf file does not exist, you cannot edit it. Edit the one you have.


How do I downgrade Firefox v. 57 to v. 56?

Get supported Firefox ESR 60.x (LEGACY ADDONS do not work here)

If you need supported Firefox ESR then you can add one of the PPAs. Two options here:

Get Firefox ESR 60.x as snap:

snap install --channel=esr/stable firefox

Get Firefox ESR 60.x from Mozilla Team's PPA ppa:mozillateam/ppa (the first versions were published here at 2017-10-11 as the result of discussion on the ubuntu-desktop maillist):

sudo add-apt-repository ppa:mozillateam/ppa
sudo apt-get update
sudo apt-get install firefox-esr

Get Firefox ESR 60.x from Jonathon F's PPA ppa:jonathonf/firefox-esr.

sudo add-apt-repository ppa:jonathonf/firefox-esr
sudo apt-get update
sudo apt-get install firefox-esr

For your information:

This new version does not support LEGACY ADDONS.
The current status of porting LEGACY extensions to WebExtension are located in Google Spreadsheet. The percentage of WebExtensions is not too high.

Get unsupported Firefox ESR 52.x (LEGACY ADDONS work here)

Please note that ESR 52 version is not supported anymore. Proceed on your own risk.

You can get Firefox ESR 52.9.0 from Jonathon F's PPA ppa:jonathonf/firefox-esr-52 with the following commands:

sudo add-apt-repository ppa:jonathonf/firefox-esr-52
sudo apt-get update
sudo apt-get install firefox-esr

With such version I can continue to use my add-ons such as SiteDelta, TableTools2, Show Parent Folder, Manage Folders, Wired Marker and others.

Notes: if you have already added ppa:jonathonf/firefox-esr PPA before and do not want Firefox to be upgraded to version 60, then you can pin this version  with the following command (16.04 LTS as an example):

cat <<EOF | sudo tee /etc/apt/preferences.d/pin-firefox
Package: firefox-esr
Pin: version 52.9.0esr-1~16.04.york0
Pin-Priority: 1337
EOF

If you have added any of PPAs (ppa:mozillateam/ppa or ppa:jonathonf/firefox-esr) and Firefox was upgraded from 52 to 60 then remove any PPA with version 60 and enable special one (ppa:jonathonf/firefox-esr-52) with the commands below:

sudo ppa-purge ppa:mozillateam/ppa
sudo ppa-purge ppa:jonathonf/firefox-esr
sudo add-apt-repository ppa:jonathonf/firefox-esr-52
sudo apt-get update
sudo apt-get install firefox-esr

but please note that you will not get security updates as this version is obsolete.

Update 2019-07-09: the Firefox ESR 52.9.0 version suffers from addon-problem with expired certificate. Even local XPI installation ends with "This add-on could not be installed because it appears to be corrupt." message. To fix the problem we need:

Download updated PEM certificate from pastebin (or copy from this superuser answer and save as mozilla2019.pem.
Navigate Firefox to about:preferences#advanced
Click on "View Certificates" button, click "Import" and install  mozilla2019.pem certificate.


"Device not found or ignored" when creating physical volume with bcache

I had a similar problem. The answer I found over here was useful:

http://comments.gmane.org/gmane.linux.kernel.bcache.devel/235

In short, edit your lvm.conf to add the line:

types = [ "bcache", 16 ]

This will allow LVM to recognise bcache as an "acceptable" block device. See the manpage on lvm.conf for more information:

http://manpages.ubuntu.com/manpages/trusty/man5/lvm.conf.5.html


How does one get an Epson Stylus SX425W to work with ubuntu 12.04

I had this working with an older version of ubuntu, by installing this driver, which can be found on the web:

epson-inkjet-printer-nx420_1.0.0-1lsb3.2_i386.deb

My notes tell me that these drivers don't work:

Stylus SX420W and Stylus TX420W,

and that the one that did work was called:

TX420 NX420

However, when I try installing this now, it says it's already installed that driver, and it won't let me choose a different printer type.

So some level of messing about may help here.

Aha! Go to printer properties, and change the make and model to Epson Stylus TX420W Series - epson-inkjet-printer 1.0.0-1lsb3.2 (Seiko Epson Corporation LSB 3.2).

Then it seems to work fine!


Where are the keyrings folder located in Ubuntu 12.10?

On 12.10 those are located on ~/.local/share/keyrings


Automatically Remember current Running Applications

Ubuntu dropped session saving long ago because it never worked well. Gnome Shell, the desktop environment that Ubuntu 18.04 uses, apparently does not support it as such.

Sleep (computer stays on in very low power use mode) and hibernate (computer fully shuts down after saving memory to the hard disk, and reloads the memory content on the next startup) to turn off your computer functionally allow the same, i.e. continue later where you left off. Unfortunately, sleep and hibernate may not work well on your hardware. Sleep works in many cases, but hibernate represents issues on many hardware, to the extent that on Ubuntu, the possibility to hibernate is not enabled by default.
Alternatively, you may try the well maintained Gnome Shell extension Window Session Manager.


Finally I found the right way of doing this combining the parts I found in /etc/acpi/sleep.sh (that seems left unused there), and Scaine pointed in /usr/lib/pm-utils...

So the final script that works for me is:
/usr/lib/pm-utils/sleep.d/00xscreensaver

#!/bin/sh

# Lock xscreensaver on resume from a suspend.

# getXuser gets the X user belonging to the display in $displaynum.
# If you want the foreground X user, use getXconsole!
getXuser() {
        user=`pinky -fw | awk '{ if ($2 == ":'$displaynum'" || $(NF) == ":'$displaynum'" ) { print $1; exit; } }'`
        if [ x"$user" = x"" ]; then
                startx=`pgrep -n startx`
                if [ x"$startx" != x"" ]; then
                        user=`ps -o user --no-headers $startx`
                fi
        fi
        if [ x"$user" != x"" ]; then
                userhome=`getent passwd $user | cut -d: -f6`
                export XAUTHORITY=$userhome/.Xauthority
        else
                export XAUTHORITY=""
        fi
        export XUSER=$user
}

if pidof xscreensaver > /dev/null; then
    for x in /tmp/.X11-unix/*; do
        displaynum=`echo $x | sed s#/tmp/.X11-unix/X##`
        getXuser;
        if [ x"$XAUTHORITY" != x"" ]; then
            export DISPLAY=":$displaynum"
            case "$1" in
                resume|thaw)
                    sudo -u $XUSER xscreensaver-command -unthrottle
                ;;
                suspend|hibernate)
                    sudo -u $XUSER xscreensaver-command -throttle
                    sudo -u $XUSER xscreensaver-command -lock
                ;;
            esac
        fi
    done
fi

The actual xscreensaver commands can also invoked trough su (instead of sudo) like

su $XUSER -c "(xscreensaver-command -lock)"

but that won't works for me because I use pam_mount to mount my encrypted home during login, and pam asks for my password for pam_mount in the script when I use su...


How to I will add jpg or gif or png (logo or emblem) in Terminal

Right-click -> Profile -> Profile Preferences -> Background:

UPDATE:

Apparently the question is about how to add a greeting message to the Terminal:

Usually this is done by adding a message to /etc/issue, /etc/banner or /etc/motd, depending on what conditions you want the message to be displayed.
/etc/bash.bashrc might work as well:

echo "  I'M THE GREAT CORNHOLIO!!!  "
echo "       ________________       "
echo "      /                \      "
echo "     / /          \ \   \     "
echo "     |                  |     "
echo "    /                  /      "
echo "   |      ___\ \| | / /       "
echo "   |      /           |       "
echo "   |      |     __    |       "
echo "  /       |       \   |       "
echo "  |       |        \  |       "
echo "  |       |       __  |       "
echo "  |      __\     (_o) |       "
echo "  |     |             |       "
echo "   \    ||             \      "
echo "    |   |__             \     "
echo "    |   |           (*___\    "
echo "    |   |       _     |       "
echo "    |   |    //_______|       "
echo "    |  /       |_|_|_|___/\   "
echo "     \|       \ -         |   "
echo "      |       _----_______/   "
echo "      |      /                "
echo "      |_____/                 "


lz4 command outputs to stdout unexpectedly

The behaviour appears to be a feature - not a bug. I can't find it documented anywhere except in the source code:
/* No output filename ==> try to select one automatically (when possible) */
while ((!output_filename) && (multiple_inputs==0)) {
    if (!IS_CONSOLE(stdout)) {
        /* Default to stdout whenever stdout is not the console.
         * Note : this policy may change in the future, therefore don't rely on it !
         * To ensure `stdout` is explicitly selected, use `-c` command flag.
         * Conversely, to ensure output will not become `stdout`, use `-m` command flag */
        DISPLAYLEVEL(1, "Warning : using stdout as default output. Do not rely on this behavior: use explicit `-c` instead ! \n");
        output_filename=stdoutmark;
        break;
        .
        .
}

On Linux, IS_CONSOLE uses isatty to determine whether file desscriptors are connected to a terminal.
As suggested in the comment, you can use the -m option to force generation of an output file in cases where there is no tty:
t=$(lz4 -9 -k -m filename)


problem with unwanted Klipper (or other) keyboard shortcut

Thanks to @xiota, I found the "offending" setting:
Input Method Configuration > Addon > Clipboard (Fcitx Clipboard access) > Configure > Trigger key for clipboard history list > click and hit "Esc" to clear the setting.

screenshot of settings to change


PATH, removing old versions from usr/bin

If you want to remove installed programs on /root folder I recommend you just to delete any subfolder related to those apps. For example, if you have a program called 'biolis' installed in /root/biolis, just do:

sudo rm -r /root/biolis

I just checked my own Ubuntu installation and in the /usr/local/bin folder I only have manually install programs, so you can use the same step above.

sudo rm -r /usr/local/bin/biolis2

I hope this works for you.


When I try to install Nvidia driver 440 using repo/ppa , driver 440 is not present after adding that repo

If you look at the PPA you can see that 440 is not available for 16.04
sudo apt install nvidia-graphics-drivers-430

This is the latest version on 16.04 on the PPA, to get 440 you need to upgrade to a newer release, 18.04 or 20.04 both have a package for 440 and are LTS releases.
You can get a 440 binary from Nvidia and try to install that using this guide but it is not ideal as there are no automatic updates and you would need to install it for every update.


Blank screen after grub when booting from live CD

Of course, right after I ask a question, I find the answer by accident.

I decided to see if the command line could help at all, so I tried running the help command, and got an error saying that secure boot prevented access to the command. So I tried again, opened up BIOS settings, and disabled secure boot - then everything worked fine. I guess secure boot was preventing grub from loading anything off of the disk.


Monitor not being correctly detected, restricting screen resolution

Richard, xrandr prompted the same to me after upgrading to 12.10. I could solve this issue through removing my previously installed proprietary graphics driver ...

sudo apt-get remove --purge fglrx fglrx_* fglrx-amdcccle* fglrx-dev* xorg-driver-fglrx

... and using the default open-source driver.

sudo apt-get remove --purge xserver-xorg-video-ati xserver-xorg-video-radeon
sudo apt-get install xserver-xorg-video-ati
sudo apt-get install --reinstall libgl1-mesa-glx libgl1-mesa-dri xserver-xorg-core
sudo mv /etc/X11/xorg.conf /etc/X11/xorg.conf.bak

(source: http://wiki.cchtml.com/index.php/Ubuntu_Lucid_Installation_Guide#Removing_the_Driver)

Wish you great success, too.


How do I prevent Unity from displaying my photos from Facebook and Google+?

Go to System Settings...->Online Accounts and disable/remove the accounts for Facebook and/or Google+. This way they cannot be accessed anymore and the photos wont appear.


Cannot go to black screen (Manual login, Ctrl+Alt+F2) and cannot stop light dm

You should boot to the console.
At boot up, press shift. A grub should appear. Choose to boot with recovery mode then choose root shell.


Since I've downloaded Ubuntu one my Ubuntu Software Centre icon is gone

Please Open your terminal (CTRL+Alt+T) and type software-center and hit the ENTER key. At your launcher right click the icon and select 'Keep in Launcher'.


You can solve this by modifying the default route. Every route in Linux has the option to specify the default source address. If you specify the xxxx::3 address in your route then that one will be used by default:

/sbin/ip -6 route del default
/sbin/ip -6 route add default via xxxx::1 src xxxx::3

If you show the routing table you will see the result:

/sbin/ip -6 route
default via xxxx::1 dev eth0  src xxxx::222  metric 1024

One thing to watch out for is that IPv6 addresses are in a tentative state until duplicate address detection has been performed. Linux will refuse to use a tentative address as the default source address. This means that you might need to add a short sleep before adding this route so that the address has time to come out of the tentative state and become usable.


The Maildir is actually very simple. It's just a directory with three subdirs: new, cur, and tmp. You can create them all with a single command:

mkdir -p Maildir/{cur,new,tmp}


Cannot upgrade from 18.04.4 LTS to 20.04 LTS...or 18.10, 19.04, 19.10: Failed to connect to https://changelogs.ubuntu.com/meta-release

You may benefit from updating the OS certificates:
sudo update-ca-certificates --fresh
export SSL_CERT_DIR=/etc/ssl/certs


Why did my Gparted operation fail during the file system check?

Chances are you need to repair the Windows 7 disk from within Windows. There are no tools in Ubuntu that can do this job. (The ntfsfix program does only the most basic checks and then flags the partition as needing repair in Windows.) Also, be sure you shut down the computer in Windows; do not perform a suspend-to-disk operation. The latter leaves the filesystem in an inconsistent state, which will prevent GParted from resizing it.

Finally, you might consider resizing the NTFS partition from Windows; that's likely to be safer than using GParted. NTFS is proprietary, and Linux tools to manipulate NTFS are all reverse-engineered. That doesn't guarantee that Microsoft's tools will be superior, but if I had to place money on it, I'd bet that the Windows NTFS-resizing tools are safer than GParted. Also, GParted is known to be unable to adjust pointers used by Windows boot loaders. If the resize operation happens to change the start point, using GParted will render Windows unbootable. Doing the same with the Windows tools should cause no such problems. Note that the start point might change even if you don't tell the program to make that change. This can happen if your alignment policies don't match those in use when the partition was created.

Oh, and back up. Resizing and moving partitions are inherently dangerous procedures. They work fine most of the time, but a power failure at an inopportune time, a bug, filesystem corruption, or other problems can all result in catastrophic data loss. ("Catastrophic," in this case means "many hours wasted trying to recover your data, with Murphy's Law guaranteeing that your most important files will end up lost forever.")

One more point: Instead of expanding your existing Windows partition, you might consider creating a new one for data files. This will be safer than creating a new partition, and will have the advantage that you can use it as a shared-data partition, thus eliminating the need to access the main Windows partition from Ubuntu. Such non-Windows access is inherently dangerous and so should be avoided if possible.


Touchpad Problem - shortly after login, it stops working

There is another command that works, and is perhaps more direct:

sudo modprobe -r psmouse && sudo modprobe psmouse

The problem is that it is not a permanent solution. I already tried adding psmouse to the /etc/modules file, but the problem is not about the driver not loading, but crashing or something.

Does the unity replacement command work as a "permanent solution"?


How to calculate mean of particular column month wise with years?

Another – very flexible – Python solution based on itertools.groupby: https://github.com/davidfoerster/group-aggregate

Installation

wget https://github.com/davidfoerster/group-aggregate/raw/master/group-aggregate.py
chmod +x group-aggregate.py

Usage

./group-aggregate.py [--skip N] [options...] groups aggregators...

groups – A list of field indexes or column ranges used to group records (zero-based, comma-separated).
aggregators – A field index (zero-based) or column range, the name of an aggregation function, and optionally a format string, all colon-separated.
--skip N - Skip N lines at the beginning of the input (e. g. header lines).

See the output of python3 -O group-aggregate.py --help for more.

Examples

Example 1

The grouping and aggregation program can't handle partial fields; let’s reformat your data set with other tools to work around it:

awk '{ gsub(/\//, OFS, $5); print; }'  | ...

Now the grouping field, the year, has the index 6 and the aggregated field, the temperatures, has the index 7 of which you'd like to take the average:

... | ./group-aggregate.py --skip 1 6 7:favg < data.csv

You can also format the temperature averages, in this example to show exactly one decimal place:

... | ./group-aggregate.py --skip 1 6 7:favg:.1f

Example 2

Instead of fields separators you can also specify column ranges which works well with your data format:

./group-aggregate.py --skip 1 54-58 60-:favg:.1f < data.csv

Now you don't even need to pre-format the data like in example 1.

Output

The output of both example commands is the same:

2012    32.2
2013    34.3


My WiFi gets deauthenticated every few minutes or seconds (Reason: 7)

I had this problem with Maverick so I installed the package linux-backports-modules-wireless-maverick-generic and I got a very stable system. (This packaged provided more recent wireless kernel modules than the default kernel.)

For Natty there is no package linux-backports-modules-wireless-natty-generic. - But you can try to install linux-backports-modules-cw-2.6.39-natty-generic and maybe your disconnects will go away. :)


Installing latest nVidia Driver on Ubuntu 17.10

You can install the Nvidia drivers from the Ubuntu preinstalled program called Additional Drivers. Search into dash or whatever your DE search has and open it. Then spot the list of available drivers for your graphics card and select the driver you want. After that click apply, type your password and maybe you need a reboot or a logout-login before you use the drivers.


You need to add that repository in your repository list.

You can do that by opening Terminal (or press Ctrl+Alt+T) then copy theese lines:

sudo add-apt-repository ppa:stebbins/handbrake-releases

You should now press Enter when terminal asks you if you want to add it.
Then if you wanted to install Handbreak type in next lines:

sudo apt-get install handbrake-gtk


Regular audio corruption when listening to music

Reference:- http://forum.notebookreview.com/hp-compaq/331172-hp-dv7-sound-fix-ubuntu.html

A fix was found for the sound problems with DV7 notebooks when running ubuntu.

Open the Terminal.
In the terminal: type sudo gedit /etc/modprobe.d/alsa-base.conf
This will open that file in gedit. Scroll to the bottom of the
file and add a new line: options snd-hda-intel enable_msi=1
Save the file and close gedit (you can now also stop the terminal).
Reboot the computer.

After rebooting, the sound should work properly.


Dell E6520 wont boot ubuntu unless plugged in on AC power

I had the same issue on a Lenovo G50-45, the fix for this was so simple it made it complicated.

Go to 'System Settings' in Ubuntu, go to 'power' and change the option below "On Battery Power" so they are the same as the options below "When plugged in".

Let me know how you get on! :)


Unable to extend my dual-boot Ubuntu partition

We could shrink a partition either form left or the right, but if we are to merge that unallocated space to another partition, unallocated space need to be on the right side.

As you use MBR partition scheme, you can't have more than 4 primary
partitions.
As /dev/sda4 is the right most primary partition, there
isn't much you could do. (LVM addresses such matters though)

That's why it is recommended to have a separate /home partition in case you want to reinstall.

Note:

You should not use Window's Disk Management tool to shrink/create
partitions, as it could convert it to a dynamic disk.


English grammar checkers for gedit or LibreOffice Writer?

LanguageTool: An Open Source style and grammar checker for English, French, German, Polish, Dutch, Romanian, and other languages. You can think of LanguageTool as a software to detect errors that a simple spell checker cannot detect, e.g. mixing up there/their, no/now etc. It can also detect some grammar mistakes. It does not include spell checking.

LanguageTool will only find errors for which a rule is defined in its XML configuration files. Rules for more complicated errors can be written in Java.

LanguageTool requires an external link to Java 5.0 or later. The current version only works with OpenOffice.org 3.0.1 or later and LibreOffice and you need to restart OpenOffice.org/LibreOffice after installation of this extension.

Installation and Usage

In OpenOffice.org/LibreOffice: Double click LanguageTool-1.3.1.oxt to install it. If that doesn't work, call Tools -> Extension Manager -> Add... to install it. Close OpenOffice.org and re-start it. Type some text with an error (e.g. "This is an test." – make sure the text language is set to English) and you should see a blue underline.

Also see Usage for using LanguageTool outside of OpenOffice.org.


Domains resolving to public IP instead of local IP with BIND

Ok, the solution is simple (Ubuntu 18.04) :

1) Edit /etc/dhcp/dhclient.conf and uncomment or add this line :

prepend domain-name-servers 127.0.0.1;

2) reload dhclient :

sudo dhclient

=> It does however only work the first time I ping my domain (just after executing sudo dhclient). The second time I ping, it's again my public IP


I'm not sure what "click add in printers" means, but I've always had luck with installing printers by pointing my browser at http://localhost:631 and using the CUPS interface to add the printer, select the printer model, etc. "Drivers" as such, have not been a problem.

Just in case it helps, whenever something asks you for a hostname for a locally connected device, "localhost" is a good answer, or the IP address 127.0.0.1. They both mean "this node, right here, the one you're running on".


Accidentally removed /usr/local/ directory. Now what?

If you've just removed /usr/local, it is not critical. That directory is intended for local installations (i.e. packages installed outside the package management system, APT). You do not need to recreate it, programs that need it are supposed to install it themselves.


Missing OpenJDK Java8 in "Open with" in Ubuntu 15.04 when trying to run .jar file

There is no desktop file in the openjdk-8 packages.
Therefore you have to create your own desktop file:

Create a new desktop file

nano ~/.local/share/applications/openjdk8.desktop

Add the definitions below

[Desktop Entry]
Encoding=UTF-8
Name=Open JDK 8 Runtime
Comment=Open JDK 8 Runtime
Exec=/usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java -jar %f
Terminal=false
Type=Application
Icon=java
MimeType=application/x-java-archive;application/java-archive;application/x-jar;
NoDisplay=true

Restart nautilus

nautilus -q


Can't make new partitions on my dual booted hard disk

You have to create an "extended partition" as the fourth partition. This partition may span about the whole remaining of your disk. Inside this extended partition you can then create many logical partitions. (The extended partition itselft cannot be used for filesystems, it is just a container for further partitions.)


Network sharing from Xubuntu 18.04 to Windows 10 fails, (system-config-samba crashes)

[1] If you kept your Win10 machine up-to-date it will never be able to "discover" any Linux samba server using NetBIOS because Win10 effectively turns it off by disabling client side SMB1.

[2] I would suggest not trying to get system-config-samba to work. It's been removed from the repositories in later releases.

[3] I would start simple - In this example I will use my name as yours so make appropriate adjustments:

Create a guest accessible share to your Public folder by editing /etc/samba/smb.conf and at the bottom of the file add this:

[Public]
path = /home/morbius/Public
read only = No
guest ok = yes
force user = morbius

Then restart smbd: sudo service smbd restart

[4] Now find the hostname of your linux machine by running this command: hostname

[5] Now go to your Win10 machine, open File Explorer, and in the path bar enter: \\hostname.local

Change "hostname" to the name you found in step [4] and don't forget to add the .local at the end.

It should show you a print share which you can't do anything with and your Public share.

You can "pin" the \hostname.local location to your Start menu or to your "Quick Access" list so you don't have to go through this again.


Ubuntu not starting after clicking restart button as the installation process completes

It started after I added nomodeset at the start.


Ubuntu experiences an internal error every time I log in (Going on for a few months now, not sure why)

I had the same problem ("internal error ExecutablePath: /usr/bin/nautilus
ProblemType: Crash") switching Skype off at startup applications did the trick. 2 seconds effort. (restart of course if you want to verify, or else wait till the next start up). Start up skype manually if needed. If you dont need it, best don't have it running.

any inexplicable error in any OS, it pays to check whether you got Skype running at startup. Skype is responsible for many seemingly unrelated technical issues.


Why do I have to reboot to be connect to the wifi?

I found the problem (or at least a part of the problem). I was connected to a vpn (with openvpn) that appears not to work correctly. When I stopped the vpn connection (sudo service openvpn stop) all went well again.

I also restarted my vpn service on the server and I uncommented the line AUTOSTART="none" in /etc/default/openvpn on my computer.

However I still don't know why my computer connected to the vpn after suspending but not after reboot...


Problem with DNS after vpn connection on Ubuntu 18.04

There was problem with my wi-fi router configuration, i just add static dns 8.8.8.8 and 8.8.4.4


get list of all commands run in past with sudo apt-get install in terminal

Not quite as particular as what you're asking but it's clean and should do the job:

grep install ~/.bash_history

By default the bash history is only 500 lines long so if you use the terminal as much as me, that's probably not going to show you that much.

A second chance is offered to us via the auth logs.

zgrep -Eo 'apt-get install.*' /var/log/auth*

Of course, this only works for apt-get. If you're using pip as root, you could also use it for that but in my experience, that's less common (you should be working in a virtualenv).


How to remove indicator from gnome-shell panel

You can use Icon Hider gnome-shell extension to hide icons from gnome-shell pannel.

Install it from here. Once installed disable keyboard in it.


Boot Error with LVM: No such file or directory

In my case, that was due to a misconfiguration into /etc/fstab
I previously installed Ubuntu with an encrypted HDD (LVM2) that i decided to remove (I removed the encryption and the initial partitions, not the HDD).

I had exactly the same problem (slow boot and same message).
I just removed entries from /etc/fstab about my previous partitions (that was also using mapper). And that rules.

Boot is as quick as intended now. And I modified /etc/fstab to consider my new "normal" partitions.

I bet your message and the slowness is due to a misconfiguration into /etc/fstab trying to load wrong partition.

Hope that helped.


You need to add

Require all granted

to your new Directory container to grant access to this directory. That replaces the old

Order allow,deny
Allow from all

See the Apache documentation for more about this.


In my /etc/environment file I had proxy variables.

http_proxy=http://user:password@192.168.1.1:6000
https_proxy=https://user:password@192.168.1.1:6000

this was causing the apt-get install to fail
changing it to:

http_proxy="http://user:password@192.168.1.1:6000"
https_proxy="https://user:password@192.168.1.1:6000"

fixes that


How to switch language spellingcheck on the fly when changing keyboard with alt-shift?

Don't know about Libreoffice (it should be almost the same as OO) but I can suggest you a tool for global language autospelling. It is called Xneur - the same as PuntoSwitcher for windows.


Toggle Keyboard Navigation (aka Mouse Navigation) using keyboard

Mousekeys functionality is provided by the xkeyboard driver. You can use xkbset to activate and deactivate mousekeys from the terminal, scripts, or hotkey.
sudo apt install xkbset
xkbset mousekeys   # enable mousekeys
xkbset -mousekeys  # disable mousekeys


Tested Ubuntu 14.04 LTS

Try to stop everpad-provider with killall everpad-provider
, run it from terminal with everpad-provider --verbose, then try to sync. What is your terminal output?

Output is  Segmentation fault?

This should fix your segfault:
Open file /usr/share/pyshared/everpad/provider/daemon.py file in editor with sudo and near the file end after line dbus.mainloop.glib.DBusGMainLoop(set_as_default=True) add the following line:
dbus.mainloop.glib.threads_init()
Be careful with the indentation. You should get something like this:

...
    try:
        fcntl.lockf(fp, fcntl.LOCK_EX | fcntl.LOCK_NB)
        dbus.mainloop.glib.DBusGMainLoop(set_as_default=True)
        dbus.mainloop.glib.threads_init()
        app = ProviderApp(args.verbose, sys.argv)
        app.exec_()
    except IOError:
...

After changes try run everpad-provider again.


I haven't used gnome for a while, but I used to do that with gconf-editor.

Open "desktop >> gnome >> session >> required_components", then double-click the "panel" option, then remove the "gnome-panel" value and close it, then just:

killall gnome-panel

Last time I used this method was with Karmic tho.


It is a flavour that used KDE as a desktop. It is a totally different experience than Unity (what Ubuntu uses) or gnome.
well it IS a personal choice.

  Do I need a boot partition, home, etc. And how big?

No. You do not need it. You can mount it all with just a /, you can opt to mount an extra /home/, extra partitions for /opt/, /usr/, /var/ (the old "server setup") if you feel like it. Like said before: it is a personal choice.

If you want a partition scheme though ...

25 Gb for / is more than enough and leaves plenty of room for installation of software and kernels. Don't bother with a /boot partition.
create a data partition to store all your personal data. Change ~./config/user-dirs.dirs to change the location of your home dirs to that partition.
Advantage: when re-installing you can format / (and /home) without the need to worry about where your files are. During install you mount your data partition and are good to go. All you need to do is edit ~./config/user-dirs.dirs. And a backup is basically making a copy of your data partition. Or if you like it you could set up a synch service with google drive (or something similar).

  Is there any additional setting to make t1o take full advantage of SSD system, any special configuration to add?

A few things come to mind:

fstrim is used to clean up your ssd.
change your fstab to put some of your partitions on "tmpfs". Have a look at https://wiki.debian.org/SSDOptimization and https://superuser.com/questions/1042215/how-to-use-tmpfs-and-ssd-for-smart-cache/1042222 for some good pointers.


Wrmsr command writes value but rdmsr shows the value has not changed

In the paper Compiler Transformations Meet CPU Clock
Modulation and Power Capping 2016, it was mentioned on their slides that you should write a specific value to IA32 CLOCK MODULATION (0x19a)
MSR, so the correct register to change the frequency is 0x19a.

When I write a value like this:

sudo wrmsr 0x19a 0x12

the original value is not returned and the register is adjusted as sudo rdmsr 0x19a gives the output:

  12


you may need to use the acpi_osi='!Windows 2012' boot parameter

sudo sed -i "s/quiet splash/quiet splash acpi_osi=\'\!Windows 2012\'/" /etc/default/grub;sudo update-grub;echo 'Reboot to apply'

here is the command to undo that, if it makes it worse or does not do anything

sudo sed -i "s/ acpi_osi=\'\!Windows 2012\'//" /etc/default/grub;sudo update-grub;echo 'Reboot to apply'


Ubuntu 20.04 freezes before login screen, no dual boot

I have installed Ubuntu 20.04 and faced same problem. The system were hanging in boot screen with connected HDMI cable. Although it was running well without the connected HDMI cable.
I am using following hardware:

ASRock B460 board with LGA-1200
Intel Core 10th gen. with UHD 630 integrated graphic.

My solution consists of following steps:

sudo apt-get update | sudo apt-get upgrade -y
Restart the system (disconnect HDMI before Ubuntu starts)
sudo nano /etc/default/grub
Set: GRUB_CMDLINE_LINUX_DEFAULT="" just leave it empty
sudo grub-mkconfig -o /boot/grub/grub.cfg
Restart the system

The system does not have now this nice Ubuntu boot screen but instead prints everything on console, then login screen appears.


IIRC on Ubuntu virbr0 with 192.168.122.1/24 is automatically created when you install qemu packages. Run:

dpkg -l | grep -i qemu

to see is that the case.


I had to add the clear and add lines to make changes to the modifier keys.

This is what I'm using now:

clear control
clear mod4

keycode 37 = Super_L NoSymbol Super_L
keycode 133 = Control_L NoSymbol Control_L

add control = Control_L Control_R
add mod4 = Super_L Super_R

Just put those lines in a file called .Xmodmap and in your .xinitrc:

xmodmap $HOME/.Xmodmap

If you don't have a .xinitrc in your home dir, just create one.

Source: this answer on StackOverflow


How do I copy and paste from a Windows 7 host machine to a Ubuntu 12.04 terminal VirtualBox?

You say you're running Ubuntu Server, which usually means you aren't using any graphical frontend. But Copy&Pasting in Ubunu is managed by the Window Manager or Display Manager. So you can't really copy/paste there.

However, you could try enabling an SSH Server on the Ubuntu VM and then access it from the Windows console:

In VirtualBox's config: Select VM, then Settings → Network → Enable Adapter 1, attach to NAT.

In Ubuntu server:

Install the OpenSSH server package: sudo apt-get install openssh-server
Configure the server according to the OpenSSH server guide

In Windows:

Download and install PuTTY
(Re-) Boot the VM
Use PuTTY to connect to Ubuntu Server (you can get the IP from ifconfig in Ubuntu's terminal). Use your Ubuntu username and password.

There you go. You should now have a Ubuntu Server terminal session in your Windows console. You can exit it using exit, logout or something in PuTTY.


Is this a reasonable dual-boot partition scheme for my needs? (Ubuntu/Win10)

Logical 1. swap (8GB) [linux-swap]

I'd suggest you to reduce it to 6GB (at least). In fact, if swap space getting used for whatever reason, apps start lagging (because they're swapping), and system becomes hard to use, so I'd leave ≈2GB just to be sure that I notice that RAM is dried, so I have to do something. As for hibernation: it depends on your usage. E.g. on the office (8GB RAM) I use hibernation every day, and the swap-partition is just 3GB. It covers everything which I usually have running, except for VirtualBox, but I prefer it to turn it off because it takes a few GBs most of which goes unused internally anyway.
Logical 2. / (50GB) [ext4]

Given that you decided to leave a separate partition for /home, I'd suggest to reduce /. I just looked at how much space / (excluding /media, /home, and /mnt, obviously) takes on my office PC, and it's just 19GB. And I have there many apps installed. upd: just for statistics: I've got 3569 packages here ☺ So, just for the safe case, set it to 25GB. I know, you're going to say that nowadays games takes very much space, but steam games would go to your home directory, and those that in repositories doesn't take very much space, so you better off give the freed space to the home dir.

I'm not sure I get what do you want with distro2, but if it's for experimentation with other distros — well, I think that space would be well enough. Here're some good distros you could be interested in: Fedora (very stable, developed by RedHat who're contributing into the ecosystem very *very* much. In particular they fully ported Gnome to Wayland), and Archlinux («do it yourself» distro, have advantage of having latest versions of most packages, easy installation from source code when needed, and… well, from my experience, it boots way faster than Ubuntu does).


I can’t start pc after I dual booted ubuntu and deleted the ubuntu partition

I would recommend finding a windows install media, and using it in 'rescue mode'.
There may be a technique to cause GRUB to boot into the windows installation from its command line, however, it will not be comfortable for someone who is uncomfortable with a rescue shell.
Alternatively, you can reinstall Ubuntu, ensure that GRUB is aware of your windows installation, and only then uninstall Ubuntu.  This would probably make sure your data remains intact.


VM-Ware Virtual Disk recognized as /dev/sd[a-p] in Ubuntu

vd* - usually resembles virualization aware para-virt drivers.
sd* - provides a SCSI API to the kernel (could be virtio still by e.g. virtio-scsi)

This was answered many times, like here on stackexchange

In your case of ESXi it just means that the disk setup it provides by default considers the disk a normal disk driver not being virtualization aware - maybe similar to the virtio-scsi example above.

The kernel starts with major/minor numbers to names followed by  advanced rules how to name devices via udev /lib/udev/rules.d/*.
If needed you can extend the latter to get a different result.


The main window in MATLAB 2014b is not appering, just the splash window

Probably you installed MATLAB as super user with sudo ./install command, and now launching it with matlab command or using matlab-support package in linux you experience this problem.
To solve it, simply grant the permission in the preferences folder with:

sudo chmod -R a+rw ~/.matlab


What is the equivalent terminal command to ipconfig /all?

The only thing missing from ifconfig are the gateway and DNS servers.

15.04 and newer

To get the DNS and Gateway info just type:

nmcli dev show eth0

The output lists some device parameters including some IP4.DNS[x] entries, which show the DNS servers and a IP4.ADDRESS[1] line which lists the IP and Gateway used (look for the gw = ???.???.???.??? part at the end of the line up to 15.10). On 16.04 and newer versions there is a IP4.GATEWAY line which is pretty self explanatory.

Replace eth0 with the actual device name you're using, which may not be the same. To get a list of devices and their status type:

nmcli dev status

Up to and including 14.10

You can get these with nm-tool (in Ubuntu versions prior to 15.04) which BTW is the command line version of network manager.

To run it just type in a terminal:

nm-tool

If you're using Ubuntu 15.04 or newer the nm-tool has been replaced by the nmcli command which is different. Check the section called "15.04 and newer" above this one in this case.


How can I copy the current path from Nautilus?

I'd say the quickest way is to press Ctrl+L, then you can copy it (Ctrl+C).


How to make an Asus G75 laptop more energy savvy

When on battery, I set Jupiter ('http://www.webupd8.org/2011/09/jupiter-applet-finally-available-for.html') to 'Power saving'. This significantly increases your autonomy.


Update manager has managed to hang itself while updating (13.04 to 13.10)

This is an especially serious problem, which also occurred in an earlier release, since it blocks a novice user's fix of the problem (no way to update). The hang also stops a user from logging out, risking a dangerous power down as a solution. (Don't ever do that -- you'll need to manually eliminate software list fragments from root or the GUI updater will never work again.) Although somewhat risky, you can drop to Terminal and use a KILL [process ID] command to dismiss the hung process (after using ps -ux to retrieve the process ID), then use apt-get update (and) upgrade in Terminal for future updates, until you're certain the GUI updater is repaired.


Cannot change address Range 10.42.0.x in 'Shared to other computer' Method

I assume that you have shared your internet connection and the IP of 10.42.0.1/24 network has been assigned now after that do this to list all your connections
sudo nmcli c

I assume that you are sharing the internet on "Wired-Connection-1".
Take down the interface:
sudo nmcli c down Wired-Connection-1

Assign the ip4 IP that you wish to use.Iin your case I guess that will be 192.186.1.1/24.
sudo nmcli c modify Wired-Connection-1 ipv4.address 192.168.1.1/24

Then bring up the interface:
sudo nmcli c up Wired-Connection-1

reference: https://bhaskerv.blogspot.com/2016/06/network-maanget-changing-default-1042.html


The most common cause for this is

GSSAPIAuthentication yes

in /etc/ssh/ssh_config. If you are not using this as an authentication method, setting

GSSAPIAuthentication no

will speed up your ssh client.

You can also change this for just your user by setting up a personal configuration in ~/.ssh/config but if you are the only user on the system, or all users will benefit, then setting it in /etc/ssh/ssh_config is fine.

See man ssh_config for more information on setting up your ssh client.


Is it possible to install OpenFoam on Ubuntu 20.04?

Did you try to install the one released on 8th July 2019? If that didn't work, you will have to wait for the next update. They may not have made it compatible with Ubuntu 20.04 yet. That's probably the reason for the issue.


If your current directory is /home/username and you want to go up one level to /home, all you have to do is execute cd ...


Windows 8 Ubuntu 14.04.3 desktop 64bit dual boot on multiple large disks

Based on that error message, it sounds like you're trying to install Linux onto the 3TB disk. Since you used the MS-DOS partition table for that disk (which I would recommend against doing that), you are not allowed to store any data beyond that 2GB point. It would probably make sense for you to convert that into a GPT disk so you can utilize all of your space!

In order to actually solve your issue, be careful to choose that 200GB partition on disk 0  as your Linux target (in Linux it will be presented as something like /dev/sda5).
One trick to preventing you from accidentally installing to the wrong device is to just unplug the additional drives before installing Linux. Simply plug them back in once you have your dual boot set up.

I strongly recommend using manual mode to configure your partitions when installing Linux. It really isn't much more difficult than the wizard, but in my experience the wizard never seems to do exactly what I need. The wizard makes it very easy to blow away your Windows partition on accident!


How can I tell if I'm using alsa or pulse-audio by default? (Switching to i3-wm)

Ubuntu uses both ALSA, and Pulseaudio for controlling sound input and output.
ALSA
ALSA serves as a kernel based system to connect your sound hardware to the operating system. All sound cards in your system will controlled using drivers and card specific settings. Most of this is done under the hood with no need for users to interfere.
In addition ALSA offers libraries and tools to control our sound system. The tool most of us may have come across may be the alsamixer, a semi-graphical terminal application to control sound volume, and mute state of all cards and profiles in our system.
We can give out sound to our soundcard simply by using ALSA without the need of PulseAudio or any other sound server.
Pulse Audio
On top of the ALSA base the PulseAudio sound server provides further tools to better control our sound system. This is done with modules to define volume levels, audio card profiles, output sinks, or input sources, and more for easy access from most Ubuntu applications.
Like ALSA, PulseAudio is also designed to run with as few user interactions as possible. Whenever we need to change volume, balance, or input/output devices it is a PulseAudio module or application we or our application call.
A professional alternative to PulseAudio is the JACK audio server with more options to interact with our sound hardware and a better low latency support. Only few music production applications expect to have JACK running, which can be done in parallel to PulseAudio.
Application/Desktop integration
The Ubuntu sound system can further be controlled from applications that run from the Unity/GNOME desktop, such as a volume control applet.
Where any given application makes use of sound control will be up to the application developers. Some applications will only use ALSA, some need PulseAudio, some need JACK.
Therefore whenever we install another desktop manager on top of Ubuntu we may lose the desktop specific applications to control sound but still, ALSA and PulseAudio will run in the background for sound control.
We may have to install additional packages like e.g. pavucontrol, the pulseaudio GTK-based volume control application.
Is any of ALSA or PulseAudio running?
Both ALSA and PulseAudio come with command line appliciations to print out the state of our sound system.

PulseAudio:
  pactl list

ALSA:
  aplay -l

Both will give an error if the sound system is not running. ALSA will be loaded with the kernel, PulseAudio will be started later. If this was not the case we can start PulseAudio manually from the terminal with:
pulseaudio [options]  ## option -D starts the daemon

In case we have audio issues I recommend reading the post written by David Henningsson on things we should not do befor we go further to debug our audio issue.


Maybe you have run into a similar problem described here.

The last commentor has the same issue I have, which I think is similar to yours.

I had the same problem (if the multi-monitor setup wasn't saved after reboot).

After startup - instead of auto-starting with a reset command you open up a terminal cmd+alt+t

Then enter:

xrandr --output LVDS --pos 1920x0 --output CRT1 --pos 0x0

(Where your monitor names and the positions are replaced by your specific settings)

Then the framebuffer will not occur.

More information here: http://bernaerts.dyndns.org/linux/74-ubuntu/309-ubuntu-dual-display-monitor-position-lost

I hope that there will be a better solution! ;-)

Edit:

I managed to delay the autostart of Gnome with the "X-GNOME-Autostart-Delay" property:

1. Create a new file "xrandr.sh" in /home/yourUserName/.config/monitors with the contents of your xrandr command (look above) and make it executeable:

#!/bin/bash

xrandr --output VGA-0 --pos 1920x0 --output DVI-I-1 --pos 0x30
exit

2. Create a new file "monitors.desktop" in /home/yourUserName/autostart with following contents:

[Desktop Entry]
Type=Application
Exec=/home/yourUserName/.config/monitors/xrandr.sh
Hidden=false
NoDisplay=false
X-GNOME-Autostart-enabled=true
X-GNOME-Autostart-Delay=05
Name[de_AT]=Bildschirme
Name=Monitors
Comment[de_AT]=Stellt die Bildschirme richtig ein
Comment=Sets the correct monitor setup

Now the xrandr script autostarts with 5 seconds delay and the flickering does not occure!

Note: The "[de_AT]" properties are optional!


I am running Unity 3D without nVidia driver in Ubuntu 11.10!

Check this out ;)

Nouveau: Accelerated Open Source driver for nVidia cards

I believe you are not experiencing no miracle here :)


How can I center a window with a keyboard shortcut?

Introduction:

The following script aligns the center of the user's active window with screen's center. It is intended to be bound to a keyboard shortcut in Settings -> Keyboard ->Shortcuts menu.

Usage:

Save the script as ~/bin/center_active_window.py. Ensure it has executable permissions with chmod +x ~/bin/center_active_window.py
Open System Settings -> Keyboard -> Shortcuts -> Custom. Click +.
You will be prompted with a popup asking for Name and Command. Name can be anything, command has to be full path to your new script, i.e. /home/your_user_name/bin/center_active_window.py.  Click Apply
Click on the Disabled text and assign it a custom keybinding once prompted. I'm using Ctrl+Super+C , but you can use whatever you like.

Source code

Also available as gist on GitHub

#!/usr/bin/env python3

# Author: Serg Kolo
# Date: Oct 3rd, 2016
# Description: Script for aligning the center of
#     user's active window with the center of the monitor
# Tested on: Ubuntu 16.04
# Written for: http://askubuntu.com/q/832720/295286

from __future__ import print_function
from gi.repository import Gdk
import subprocess

def get_offset(*args):
    command = ['xprop','-notype','_NET_FRAME_EXTENTS',
               '-id',str(args[0])
    ]

    out = subprocess.check_output(command)
    return int(out.decode().strip().split(',')[-2])

def main():

    screen = Gdk.Screen.get_default()
    window = screen.get_active_window()
    window.unmaximize()
    window_width = window.get_width()
    window_y = window.get_origin()[-1]
    print(window_y)
    window_monitor = screen.get_monitor_at_window(window)
    monitor_center = screen.get_monitor_geometry(window_monitor).width/2

    # if centers of window and screen are aligned
    # the top left corner will be at screen_center - window_width/2
    new_position = monitor_center - window_width /2

    # For some reason there is vertical offset necessary
    # Apparently this comes form _NET_FRAME_EXTENTS value
    offset = get_offset(int(window.get_xid()))

    window.move(new_position,window_y-offset)
    print(window.get_origin())

if __name__ == '__main__':
    main()


Installed Ubuntu 20.04 LTS and now computer always boots to GRUB prompt

Dumb mistake.  I experimented with the bios to change boot order.  The choices it lists are kind of confusing.  The same device appears multiple times.  Anyway, I played around selecting different sources for the primary boot device and eventually got it to load normally.


Items on desktop all disappered, including my Home, from icon list

The problem was solved by running sudo dpkg-reconfigure nautilus This command could also work on all currently supported versions of Ubuntu when "opening any folder takes me to Disk Usage Analyzer".


picasa with xp and Shotwell on Ubuntu dual boot with shared pictures

Short answer.  Yes it is possible, providing that the images are on a partition accessible by both operating systems, and not used at the same time.


Can scripts run even when they are not set as executable?

Let's say you have the file myscript containing the following:

#!/bin/bash
echo "Hello, World!"

If you make this file executable and run it with ./myscript, then the kernel will see that the first two bytes are #!, which means it's a script-file. The kernel will then use the rest of the line as the interpreter, and pass the file as its first argument. So, it runs:

/bin/bash myscript

and bash reads the file and executes the commands it contains.

Thus, for bash (or whatever interpreter your script requires) to "execute" the script, it only needs to be able to read the file.

So, for scripts, the execute bit just makes it a bit more convenient to execute it. As long as bash is executable, you can always run bash with the script file as argument, or run bash interactively and copy paste the script line by line into your terminal to have the commands executed.


You need to update your lwjgl.

1)Download LWJLG 2.9.0
2)extract the lwjgl.jar to .minecraft/bin
3)extract the files in lwjgl/natives/linux to .minecraft/bin/natives

your .minecraft is your home folder (show hidden files with crtl + h)

if you can't find it then, search the home folder and click it from there (after showing hidden)

good luck


dependency problems: Errors while processing: keyboard-configuration

As I told before, commands:

~$ sudo dpkg --configure -a
~$ sudo dpkg --configure -a --force-depends

decreased problem to keyboard-configuration error.

Now i do this steps:

Run Input Method application:

Select Update Yes button:

REMOVE Configuration:

Then run Input Method application again, click Update Yes button and now select my previous settings (in my case ibus):

Run in command-line: sudo apt update and sudo apt upgrade.


How to share internet between a Ubuntu and XP?

It is well described in ConnectionSharing ubuntu help page.


Ubuntu install Windows using a partition on the hard drive

Shrink/resize your Win partition to make space for Ubuntu partition and then create one.

Go for classic LTS desktop Ubuntu version. LTS for less bugs. Desktop, now its personal.

During install you should choose "soomething else" option, if you want to have control of your Windows partition.


Guest account works, but regular account does not

Warning: Take your time reading this first sentence:

Before typing the following keystroke, remember that Ctrl+Alt+F7 is your friend.  This is the keystroke to type to get back to where you are right now.  (probably your guest session) OK? Remember? Sure?

OK! Now press Ctrl+Alt+F1 to go to TTY1, which is a full screen terminal (and only a terminal: no mouse, no dash, no nothing).  Try to log in there.

It does show your user name when you type it after the login: prompt, but does not show anything when you type your password!  Oh, and you have to type Enter after you typed your user name and before it shows you the password prompt.

Now type the following commands: (assuming user is your old user name)

sudo adduser user2

and follow the instructions on-screen.  If you're not on a US keyboard, don't use any "special" characters like £ à ŷ ü nor any numbers unless they're from your keypad.

Now type the following commands:

sudo adduser user2 adm
sudo adduser user2 cdrom
sudo adduser user2 sudo
sudo adduser user2 dip
sudo adduser user2 plugdev
sudo adduser user2 lpadmin
sudo adduser user2 sambashare

(If any of the above gives an error like group not found, don't worry: I'm trying to be thorough)

Now, log out of the guest session and log in as "user2" and come back here to this site

Ah you're back!  ;-)  Please test now if you still have your problem...  No?  OK!

Now,

Open the file manager
Browse to the /home/user directory
Copy (don't move!) all the files from Downloads to /home/user2/Downloads
Check you did a good job.
Now delete /home/user/Downloads
Go back to step 3 and repeat for Documents, Videos, ...
In a terminal type the following command: deluser user --remove-home

Done!


Unable to connect to specific wifi network

I finally found what was causing the issue for this.

I'm not 100% sure why it worked since I didn't notice the same issue as the individual who asked this question, but it worked for me.

Edit the NetworkManager.conf file

vim /etc/NetworkManager/NetworkManager.conf

and disable random MAC addressing by adding these lines to the bottom of the file:

[device]
wifi.scan-rand-mac-address=no

Then, save the file, and restart the network-manager

sudo service network-manager restart

This worked for me.


How do I minimize all windows in Ubuntu 12.10?

Maybe you can try MyUnity. I don't know if your keyboard shortcuts Ctrl + Super + D will work then, but you will get an icon in the launcher:
See this question:
How to add a “Show desktop” icon to the launcher?


Tooltips are black text on black background

Oddly, what fixed this was turning the colours to a light background and a dark foreground for the tooltips.


Connect Ubuntu server 18.04 to Wi-Fi without installing additional tools over apt-get

I assume that yours is a server that is not intended to be a cloud instance. If this is correct, let’s follow the recommendation included in the 50-cloud-init.yaml file. Please open a terminal and do:

sudo -i
echo "network: {config: disabled}"  >  /etc/cloud/cloud.cfg.d/99-disable-network-config.cfg
exit

Next, let’s remove the file and simultaneously back it up:

sudo mv /etc/netplan/50-cloud-init.yaml  ~/50-cloud-init.yaml

Next, verify the wireless interface name with the command:

ifconfig

Substitute the interface you found below if not wlp3s0.

Now let’s write a new file using the command line text editor nano:

sudo nano /etc/netplan/01-netcfg.yaml

Write the following:

network:
  version: 2
  renderer: networkd
  wifis:
    wlp3s0:
      dhcp4: no
      dhcp6: no
      addresses: [192.168.0.21/24]
      gateway4: 192.168.0.1
      nameservers:
        addresses: [8.8.8.8,192.168.0.1]
      access-points:
        "******":
          password: "**********"

Of course, substitute your exact details here. Save (Ctrl+o followed by Enter) and Exit (Ctrl+x) the text editor. Save your netplan changes changes by running the commands:

sudo netplan generate
sudo netplan apply

Please note and follow the spacing and indentation. Also note that the SSID and password are in between quotes ".

Reboot and test:

ping -c3 8.8.8.8
ping -c3 www.ubuntu.com


What is difference between these command?

The simple command cd <dir> which changes directory to <dir>.

~ indicates $HOME directory
/ indicates the root directory
~/ indicates the $HOME directory as well. The only difference is that it explicitly shows it's a directory (the trailing slash). cd ~/ and cd and cd ~ and cd $HOME all do exactly the same thing.
cd - Changes the working directory to the previous working directory.

These special symbols "." (dot) and ".." (dot dot)[Relative Parameters]:
The "." symbol refers to the current directory and the ".." symbol refers to the current
directory's parent directory.

$USER and $HOME are Environment-Variables

$USER = The name of the currently logged-in user. This variable is set by the system. You probably shouldn't change its value manually. (ex:myuser1)

$HOME = The location of the currently logged-in user's home directory.(ex: /home/myuser1)

Recommended to use cd "$HOME" or cd "$USER" so-that cd gets proper input in case of space, etc.


Grub won't install on Macbook Air 5,2 (13" 2012)

Did you follow the detailed instructions on Ubuntu's Apple Intel Installation documentation page?

According to that, you should be installing GRUB to Ubuntu's root partition (assuming the instructions are followed verbatim, that partition would be /dev/sda3, but your mileage may vary).


You can use curl to fetch the online file:

curl -sL http://www.your.fi/le | md5sum | cut -d ' ' -f 1

To compare against another one, store it in a variable and then proceed:
online_md5="$(curl -sL http://www.your.fi/le | md5sum | cut -d ' ' -f 1)"
local_md5="$(md5sum "$file" | cut -d ' ' -f 1)"

if [ "$online_md5" = "$local_md5" ]; then
    echo "hurray, they are equal!"
fi


Mouse and keyboard input ignored after installing virtualbox-guest-x11

After installing xserver-xorg-core and virtualbox-guest-x11 to attempt to get shared clipboard working with virtual box, although this worked fine at first, upon rebooting I encountered this error where I could not control the machine at all.

To resolve I booted to recovery mode (hold Esc on boot) and ran:

apt-get remove virtualbox-guest-x11
apt-get remove xserver-xorg-core
apt-get install xorg

This returned me back to where I was to begin with.


Cannot install flightgear on Ubuntu 15.04 because of broken packages

I'm the Flightgear dev.

Thanks for letting me know.

A rebuild of the package is happening, which should build it against the latest libraries in Vivid. The fixes package should be available in a hour or two.


For a production system it can be a good idea to put directories that can fill up quickly on  their own partitions, like /tmp/ or parts of /var.

Sometimes you want to use different file systems or file systems with different parameters for some directories, like big mail or news spools which hold very much small files.

If /usr is on its own partition it can be mounted read-only so it doesn't get corrupted at  system crashes.

For a learning system this things aren't needed - but maybe it's something you want to play with.


It seems that the missing step for me was to turn off all output sinks except for the Bluetooth headphones.  When I did that, my headphone sound took over from the laptop speakers.  But I still get some annoying background clicks. I don't know if that's fixable.


Is my Nvidia Geforce 8600 GT compatible with Ubuntu?

I have a GeForce GTX 860M on newer hardware that was giving me problems after installation of 14.04. My problems are a combination of video card and other unsupported hardware. I updated my kernel and driver and that has resolved most of my problems. One relevant glitch that persists is my system boots to a black screen because the nVidia driver doesn't know how to switch the output to the LCD correctly. (Solution: close lid of laptop after boot. System goes into suspend. Then, open lid and unsuspend. Video driver figures it out and login dialog appears.)

To do what I did:

Get a newer kernel. It is not clear to me from your description if you need this but it is fairly safe and fully reversible. sudo apt-get install linux-generic-lts-vivid It will leave your original kernel in place. Make sure you have some extra free space on /boot if you are going to let Ubuntu auto-update both series of kernels. Afterwards pay attention to the kernel that GRUB selects when you boot up.
Install the xorg edgers ppa and then sudo apt-get install nvidia-352. to get a newer nVidia driver. Note that 352 is not the newest release. I am using it because the newer ones have/had a bug in them that conflicted with my upgraded kernel. Feel free to try the others but you can only test one at a time. If you want to be able to go back to your previous configuration after installing this PPA be sure to read the information on the PPA page before you begin.


Maybe you could open »NVidia X Server Settings« and see if you can change your resolution there to something higher or lower (if you have a resolution problem). You can open it from the dash.


phpmyadmin is not included in mysql-client, you need to install it manually.

Open a terminal (Ctrl+Alt+T) and run :

sudo apt-get install phpmyadmin

When the installation is done, you can open phpmyadmin in your browser at this address : http://localhost/phpmyadmin.

If you still have a 404 error run :

sudo ln -s /usr/share/phpmyadmin /var/www/html

And try again.


Let's start

On some pc you have web server and you wish to deny any except input to port 80 and 443

Delete curent rules and chains

sudo iptables --flush
sudo iptables --delete-chain

allow loopback

sudo iptables -A INPUT -i lo -j ACCEPT
sudo iptables -A OUTPUT -o lo -j ACCEPT

allow established connections

sudo iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT

allow 80 and 443

sudo iptables -A INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT
sudo iptables -A INPUT -m state --state NEW -m tcp -p tcp --dport 443 -j ACCEPT

default policies

sudo iptables -P INPUT DROP
sudo iptables -P OUTPUT ACCEPT

In case to allow access from pc only to 80 and 443 do
Delete curent rules and chains

sudo iptables --flush
sudo iptables --delete-chain

allow loopback

sudo iptables -A INPUT -i lo -j ACCEPT
sudo iptables -A OUTPUT -o lo -j ACCEPT

allow established connections

sudo iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT

allow traffic to 80 and 443

sudo iptables -A OUTPUT -p tcp --dport 80 -m state --state NEW,ESTABLISHED -j ACCEPT
sudo iptables -A OUTPUT -p tcp --dport 443 -m state --state NEW,ESTABLISHED -j ACCEPT

default policies

sudo iptables -P INPUT ACCEPT
sudo iptables -P OUTPUT DROP

This is it. I think :)


Forget it.

If an attacker has physical access to your computer, they can remove the disk and read the content of the disk without ever logging in.

The solution here is full disk encryption, with a reasonably secure pass phrase that is not feasible to guess, in combination with a log on password that is reasonably secure.

You should also define who the attacker is. If it's a thief that stole your laptop they're probably after the value of the laptop. They won't spend hours attempting to crack anything; they'll spend minutes probably.

If it's a three letter agency, they may gain access to your laptop to install hardware keyloggers, capturing your password and making any length considerations void.


This file is hidden. Press Ctrl+H in nautilus and you will see hidden files.