How to get normal Ubuntu orange color in window titlebar using Human-Clearlooks theme?

Human-Clearlooks needs GTK+3 support to be useful.

With some efforts, the legacy theme can be adapted and can be used in newer releases of Ubuntu and the derivatives. The title bar with Human theme however, will only be visible when Metacity window manager is used.

  Useless warning: Some window managers may not show the title bar with Human theme at all. For GTK+ desktop environment, if the client-side decoration a.k.a. header bars in GNOME is used by default, user might want to disable that and replace with title bar for desired appearance. Hence this useless warning or the warning of becoming useless (pun included).

The following instructions will assume that:

user has installed the required packages from the Universe repository: human-theme and exactly mate-themes and prefer to do either;
Setup A (easy): Human-Clearlooks theme with Blue variant or,
Setup B: Human-Clearlooks theme with Blue/Orange variant.

The required packages would provide the base theme: TraditionalOk is recommended. More information is found at lower half of this post, under Troubleshooting section.

Setup A (easy)

MATE, like GNOME2, has a native way to easily customize GTK+ theme. User will choose one of available themes and then customize to mix and match with other themes.

Go to Control Center > Appearance - Theme and select the base theme: TraditionalOk. Click Customize... and change the options in respective tab accordingly.

Controls: TraditionalOk
Window Border: Human (changed from TraditionalOk)
Icons: Humanity (changed from MATE)
Pointer: MATE

Click Close to finish and user will see a new entry Custom that will appear as the first entry. The changes are applied immediately, but not persistent. To make the changes persistent, select the customized theme and click Save As... and enter Name and Description as desired or accordingly.

Name: TraditionalHuman
Description: TraditionalOk customized with Human window border and Humanity icons (optional)

Finally click Save and user will see the customized theme is now renamed from Custom to the name of choice. This will automatically create ~/.themes/TraditionalHuman/index.theme for the customized theme.

As a result, we have recreated Human-Clearlooks theme with Blue variant. The Blue colour comes from the base theme: TraditionalOk, a GTK+3 port of Clearlooks from mate-themes package.

Compatibility: MATE/GNOME2 desktop environment only.

Limitation: Setup A does not provide option to freely change the colour. Customization is limited to the number of available themes to mix and match. Whichever themes that were used should not be removed, otherwise the customized theme will be broken.

Setup B

This setup will use selected parts of available themes to create a new theme: simply named "TraditionalHuman" with minimal dependence on these packages: gtk2-engines, humanity-icon-theme and dmz-cursor-theme. Take note as follows.

For Human-Clearlooks with Blue variant (same as Setup A), follow only these steps: 1, 2, Final.
For Human-Clearlooks with Orange variant, follow all steps below.

Step 1: Create a local theme directory at ~/.themes and copy the following selective files from the available themes to the local theme directory. Available themes to use: Human, Human-Clearlooks, TraditionalOk.

$ cd $HOME
$ mkdir -p .themes/TraditionalHuman
$ cd .themes/TraditionalHuman
$ cp /usr/share/themes/Human/index.theme .
$ cp /usr/share/themes/Human/cursor.theme .
$ cp -R /usr/share/themes/Human/metacity-1/ .
$ cp -R /usr/share/themes/Human-Clearlooks/gtk-2.0/ .
$ cp -R /usr/share/themes/TraditionalOk/gtk-3.0/ .

Step 2: Edit index.theme file with the following content to define the local theme.

$ nano index.theme
[Desktop Entry]
Type=X-GNOME-Metatheme
Name=TraditionalHuman
Comment=Make TraditionalOk more Human
Encoding=UTF-8

[X-GNOME-Metatheme]
GtkTheme=TraditionalHuman
IconTheme=Humanity
MetacityTheme=TraditionalHuman
CursorTheme=TraditionalHuman

Step 3: Edit the lines containing theme_selected_bg_color and core_color_a and replace the hexadecimal value to #ffbe6b. Precaution: Keep the semicolons ; at the end!

$ nano gtk-3.0/gtk.css
...
@define-color theme_selected_bg_color #ffbe6b;
...
@define-color core_color_a #ffbe6b; /* Core color for blue widgets in TraditionalOk. */
...

Step 4: Edit the line containing selected_bg_color and replace the hexadecimal value to #ffbe6b. Precaution: That is a single long line. Keep the \n instances!

$ nano gtk-3.0/settings.ini
...
gtk-color-scheme = "base_color:#ffffff\nbg_color:#edeceb\nfg_color:#000000\nselected_bg_color:#ffbe6b\nselected_fg_color:#ffffff\ntooltip_bg_color:#f5f5b5\ntooltip_fg_color:#000000\ntext_color:#1a1a1a\nlink_color:#0000ee\nvisited_link_color:#551a8b"
...

Final step: Change the theme and enjoy.

Go to Control Center > Appearance - Theme (or any supported theme manager) and select the created theme "TraditionalHuman". The changes will be applied after several seconds.

As a result, we have recreated Human-Clearlooks theme with Orange variant. The Orange colour comes from the hexadecimal value #ffbe6b that is used in the original Human-Clearlooks theme.

Variation: If user wish to have Human theme with both Blue and Orange variants, make sure to give a different name for each variant. That means, user should specify the different names for the created theme directory and every instance of the name used in index.theme file.

For example, I renamed Blue variant as "TraditionalHuman" and Orange variant as "TraditionalHumanMore" that are shown in the screenshot as follows.

User can also create more variations with different colour likewise.

Compatibility: MATE/GNOME2 and other GTK+ desktop environment.

Limitation: Setup B mostly relies on user initiatives. The theme documentation might be helpful, but rarely found. Customization is either doable or impossible: depends on whether user can understand how the theme files work or otherwise.

Troubleshooting

Additional notes to understand how theme works as follows.

The base theme: This should be the most compatible theme. A common mistake is that user tend to use the legacy theme, which is the least compatible to begin with. Do not use, and I mean do not use Human theme as the base theme (repeated on purpose).

Example of a "wrong" base theme that cannot be customized as expected:

Colour selection: Check the original theme files to be sure, and do not use colour picker against the apparent colour seen on the desktop. The apparent colour is not the actual colour: Human-Clearlooks uses Ubuntu Orange (#ffbe6b) as the main colour, but the title bar with Human theme does not show this colour itself.

Install directory: The customized theme is installed for current user only at ~/.themes in the Home directory. For system-wide users, install to /usr/share/themes instead. System-wide themes must be installed with proper permission 755, otherwise the theme may appear broken.

Yet unusable: Regardless of setup, use theme files for the same release. Do not mix theme files from different releases, otherwise the result is an unusable theme!

I have at least tested TraditionalOk from mate-themes package on all supported LTS releases at this time. Theme files for the same release will always work. Exceptional case: theme files in 14.04 and 16.04 are fairly backward and forward compatible, with little to no apparent defects.

|      \theme |       TraditionalOk      |
| system\     | 18.04  | 16.04  | 14.04  |
| ----------- | ------ | ------ | ------ |
| 18.04       | OK     | BROKEN | BROKEN |
| 16.04       | BROKEN | OK     | FAIR   |
| 14.04       | BROKEN | FAIR   | OK     |

Example of a "broken" appearance (narrow alignment in menu bar), and also an unsupported window manager with Human theme (only had some hint of Ubuntu Orange):

Other environment: Human-Clearlooks was designed for GNOME2 and Metacity window manager. Cinnamon with Muffin window manager may support the Human theme natively. Other window manager like Xfwm or Openbox might require additional configuration to show the exact appearance. That will be too broad and will not be covered in this answer.

User can hack any theme files; however, be prepared to spend at least few hours or may be several days in test environment. Hacking theme files is usually not worth the time (try again by own... without looking at this answer). Not to mention that GTK+ theme documentation is rarely found.

The most simple solution: use whatever theme that works for newer releases.

TL;DR: Use a theme that supports GTK+3 and customize from that. Unless user has a great interest in themes, not worth looking at theme files with jumbled codes. I had a quick look and thought easy to fix, but instead took several days to reach this answer.


You've probably already resolved this, but in any case. If you're using Linux then you can't use QAxObject.

If you're on Windows, you most likely just need to add axcontainer to your project.pro file:

QT  +=  core  gui  axcontainer


How to set static routes in Ubuntu Server?

You can put static routes in /etc/network/interfaces:

auto eth0
iface eth0 inet static
      address 192.168.1.2
      netmask 255.255.255.0
      up route add -net 192.168.0.0 netmask 255.255.0.0 gw 192.168.1.1
      up route add -net 172.16.0.0 netmask 255.240.0.0 gw 192.168.1.1


OK, I was reading another answer, and it had this:

  Upgrades between LTS releases are not enabled by default until the
  first point release, 12.04.1/14.04.1, scheduled for July/August. It is
  recommended that most LTS users wait until then before upgrading to
  12.04/14.04.

Ubuntu 14.04.1 is scheduled for July 24th.

Hope that explains why you don't get the 14.04 prompt.

PS: As you guys don't seem to like my duplicate suggestions, I humbly concede, and post this as a possible answer.


I just downloaded webkitGTK using svn and I am not sure what to do next

Prefix is a directory under which the compiled application is going to be installed. I'd use something like /opt/WebKitGtk to be sure it does not override anything. Installing in /usr is definitely not a good idea.

Also note I corrected a typo in your command example - make should be a separate command.

Good luck :)


The command you're executing (minicom) is using "VT100 Escape Sequences" to do cursor positioning.

To remove the characters listed above, pipe the file through

sed -e 's/^[\[[0-9][0-9];[0-9][0-9]H//'
#         ^^ actual ESCape

I got the Escape by typing Ctrl-VEsc.


Will an Ubuntu upgrade restore my rights privileges?

If it's the same problem you wrote about here, then no. The update will update packages in system directories, not content in $HOME.


Can LIB paths be set in rc.local? Does it execute its commands after we login?

The script /etc/rc.local is invoked at the end of normal system startup. It is executed as root and has no relationship whatsoever with a user logging in. Any environment variable assignments in /etc/rc.local are available only to the processes started by /etc/rc.local; they are not available to processes started in a user's login session.

/etc/rc.local has no direct effect on a user's login session. It is normally used to mount some disks, start some services and other such tasks. It cannot be used to set up a user's environment.

First, let's look into /etc/rc.local itself:

$ cat /etc/rc.local
#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.

exit 0

rc.local is an old feature of Unix-like system, older even than the System V initialization system (the one which used the directories /etc/rc[0-6S].d). Recent Ubuntu systems used systemd to control initialization; /etc/rc.local is invoked by the systemd unit rc-local.service:

$ sudo systemctl status rc-local
● rc-local.service - /etc/rc.local Compatibility
   Loaded: loaded (/lib/systemd/system/rc-local.service; static; vendor preset: enabled)
   Drop-In: /lib/systemd/system/rc-local.service.d
       └─debian.conf
   Active: active (exited) since Fri 2017-04-28 17:44:18 EEST; 2 days ago

Apr 28 17:44:18 factissa systemd[1]: Starting /etc/rc.local Compatibility...
Apr 28 17:44:18 factissa systemd[1]: Started /etc/rc.local Compatibility.

The unit is automatically generated at boot if the file /etc/rc.local exists, and is set by default to be invoked after achieving network.target; on Debian and derivatives such as Ubuntu, a drop-in configuration file modifies this so that the unit is run after network-online.target.

This is not exactly the same as the traditional place of /etc/rc.local at the end of a multi-user runlevel initialization, but it's similar enough so that in most cases no adjustments need to be done. (Look into those files, they are text and quite understandable; to make modifications please read the systemd documentation first.)


ATI 5770 HD - its fan runs all time - how can I resolve this?

You have installed the right drivers but using a method that is not for your Ubuntu version.

For more information on how to install, remove and revert drivers please follow the link to this question

Is my ATI graphics card supported in Ubuntu?

If you have installed the proprietary drivers and there is a problem with the fan speed you need to report that to AMD as a bug in the drivers.

As a workaround for that you might want to set a lower power state using the aticonfig tool. Set it on a console using this command:

aticonfig --set-powerstate=1

To find out which powerstates your Radeon supports try:

aticonfig --lsp


You would need indeed to use xrdp in order to perform a remote session to your ubuntu machine.  This will ensure that nobody can see your actions on the monitor connected to the machine you are connected to

About the connection issue you have, you could try one of the following options (please test it beforehand and see what's could be working for you)

Option 1 : You perform a standard installation of xrdp package from ubuntu repository

You can follow this guide and see if it works for you (http://c-nergy.be/blog/?p=8952).  In a nutshell, you type the following command in a terminal session

step 1 - Install xrd package
 - sudo apt-get install xrdp

Step 2 - install your xfce desktop interface if not done yet
 - sudo apt-get update
 - sudo apt-get install xfce4
Step 3 - Say to xrdp software to use xfce session

echo xfce4-session >~/.xsession

Try to connect but remember that the default keyboard layout for the login page of xrdp is en-us by default (you can change that - please read the guide http://c-nergy.be/blog/?p=8952)

Note : because the package is pretty old (0.6.x), you will have basic functionalities

Option 2 : You perform a custom install of xrdp package and you can use Unity interface

Visit this page (http://c-nergy.be/blog/?p=11719) and download the script provided.  This will perform a custom installation of the xrdp packages (version 0.9.x)

You simply need to execute the script and it will perform the installation. Then, ensure that you logoff from the physical machine and try to perform a remote desktop session.  At the xrdp login screen, provide your credentials and check if this work

Hope this help
Till next time
See ya


press Ctrl-Alt-t and try the following in the terminal:

sudo nvidia-xconfig

Reboot. If that doesn't do the trick run ccsm in the term and re-enable the unity plugin.

If ccsm is not installed run:

sudo apt-get install compizconfig-settings-manager
ccsm

If that doesn't help either I would suggest this:

remove nvidia

sudo apt-get --purge remove nvidia

or

sudo apt-get --purge remove nvidia-current

depending on the driver you have installed. If you want you can run both to make sure.

add the x-swat ppa THE REPO IS NOT OFFICIAL BUT STABLE

install ppa-purge in case the ppa doesn't work for you

sudo apt-get install ppa-purge

add repository

sudo add-apt-repository ppa:ubuntu-x-swat/x-updates

update package list

sudo apt-get update

install newer drivers

sudo apt-get --purge remove xserver-xorg-video-nouveau
sudo apt-get install nvidia-current nvidia-settings
sudo nvidia-xconfig

Reboot

if it doesn't work out you can revert back with

sudo ppa-purge ppa:ubuntu-x-swat/x-updates


Why "fdisk -l" does not give any output in terminal?

Because fdisk is a menu-driven program for creation and manipulation of partition tables. Therefore it requires sudoers or root access

try using

sudo fdisk -l.


Default PDF viewer suddenly changed in Firefox & Thunderbird under KDE

I see the same behaviour (Manjaro 19.0.2, KDE 5.68.0 / Qt 5.14.1):
Thunderbird 68.6.0 64-bit is configured to use "system default" for display of PDF attachments.
In KDE file associations, the PDF viewers are (in this order):
1. okular
2. LibreOffice Draw
3. Inkscape

Double clicking the PDF attachment of an email opens it with... yeah! - Inkscape grr

Now, choosing a certain application as PDF handler within Thunderbird does what you'd expect. So that could be a workaround, but of course I don't want to accepts this crumpy behaviour as a solution.

When I change KDE's file associations by rotating the viewer order and put LibreOffice Draw in the first place, it does indeed work - PDF is opened with LibO Draw!

Next, I put Okular back on the top of the list - and astonishingly now Thunderbird does what one would expect...


internet works with ip address but not with website name

it is an error in DNS server settings. DNS is service translating domain names to the IP addresses. Your DNS server is not set properly or does not work properly. Usually this can happen if you set fixed IP address with incorrect DNS. The advice in comment to setup DNS to 8.8.8.8 is correct and can help you, but better will be, if you use your local DNS, usually it is given from your provider or it can be IP address of your local router. For most cases to setup DHCP (automatic IP setup) will work.


16.04 Safely remove "ubuntu software" after installing appgrid?

It is not a bad idea to remove "Ubuntu Software." If you are comfortable using command line. Alternative installers upon failing may leave you in a position where you are forced to install or remove by terminal. I was only using Ubuntu Software or App Grid as a catalog of what i kept installed. These packages are not necessary for Ubuntu to function or update.


No Wifi Adapter found Ubuntu 20 LTS Legion Y7000

You need to install drivers for rtl8822be.
Run in a terminal:
sudo apt update
sudo apt install git dkms
git clone https://github.com/lwfinger/rtw88.git
sudo dkms add ./rtw88
sudo dkms install rtlwifi-new/0.6

Probably previously you installed a driver without using dkms. So it didn't build on a kernel update.
I suggest to remove the /etc/modprobe.d/r8822be.conf file.
Secure Boot should be disabled in BIOS.


Start Terminator via shell script in broadcast mode

First, you must change the terminator config file and add "dbus = True" then you can open a new terminator windows like terminator -e "ssh xxx.xxx.xxx.xxx" --new-tab


Broken Wi-Fi on Dell Inspiron 5567 and 17.10

It's a kernel problem. Installing kernel from http://kernel.ubuntu.com/~kernel-ppa/mainline/v4.13.10/ fixed the issue for me.


Installer hangs/get stuck at "where are you?"

Got the solution here in this bug report. Quoting the relevant part here:

  Hi,

  A new discovery! Today I tried again but this time DISCONECTING THE
  NETWORK, and voila!. It let me choose the right TimeZone and carry on
  with the installing process. In any case is still a problem because
  the installer is not suppoused to wait forever in that place.

  Greetings.


Killing Subprocess in Ubuntu NOT the Parent?

You can loop  through the process list, identifying children
with the same parent and kill them one by one.

Attribution: http://www.unix.com/17901-post4.html

#!/bin/sh
while true
do
  echo "Enter parent process id  [type quit for exit]"
  read ppid

  if [ $ppid -eq "quit" -o $ppid -eq "QUIT" ];then
     exit 0
  fi

  for i in `ps -ef| awk '$3 == '$ppid' { print $2 }'`
  do
      echo killing $i
      kill $i
  done
done

You can also kill by session id but that get's the parent and the
children.

https://serverfault.com/questions/40303/how-do-you-kill-a-process-tree-in-linux

ps -eo pid,ppid,sess,cmd -u ppetraki  | grep whoami

pkill -9 -s SESS_ID

Using the information from the later, you could build a simpler
tool that targeted only children.


The only think you can get close to this is by just changing the login screen wallpaper. You can do that by installing  Simple LightDM Manager
Open terminal and run these following commands. (remember to press enter after each command)

sudo apt-add-repository ppa:claudiocn/slm

sudo apt-get update && sudo apt-get install -y simple-lightdm-manager

Open the newly installed application, called Simple LightDM Manager, from Unity Dash and select the wallpaper you want to set as default, for both your desktop and login screen, by clicking the "Location" button. You can even change the logo.

For additional settings like changing the theme and all, you can install the Unity tweak tool from the appstore.

  One machine can do the work of fifty ordinary men. No machine can do the work of one extraordinary man. -Elbert Hubbard


How can I fix TTF fonts' ligatures (tt, ti, fi, ff, etc) in Firefox?

Another solution that will work with all applications, including Libre Office, is given by aldeby:

Edit or create the file ~/.fonts.conf and paste this code in it:

<match target="font" >
<edit name="embeddedbitmap" mode="assign">
<bool>false</bool>
</edit>
</match>

Make sure to keep the XML structure.

Log out and in again, and Calibri (and possibly some other fonts) will look much better (actually even better than with the other answers given here, because the ugly bitmap substitutions are completely disabled).


First, disable Fast Startup in Windows. That feature can cause filesystem corruption in a dual-boot configuration, and may be what's causing Boot Repair to say that it needs to repair a filesystem.

OTOH, your /dev/sda3 is identified by partition type as a Microsoft Reserved partition, which is normally empty and is used by certain Windows partitioning tools; however, Boot Repair has identified it as a damaged ext4 filesystem. It's possible that you accidentally created an ext4 filesystem on it and then subsequently damaged it; or it may be a misidentification from random leftover data in the partition. Either way, that could be what Boot Repair is complaining about. If so, wiping it clean (as in dd if=/dev/zero of=/dev/sda3) is probably safe -- but don't do this unless you can be certain that it doesn't hold valuable data!

It looks as if you've booted something (your original Ubuntu install and/or Boot Repair) in BIOS mode, which is the real cause of your main problem. Unfortunately, it can be difficult to control a medium's boot mode, particularly if you're unfamiliar with how a modern EFI works. I recommend you proceed as follows:

Download and prepare the USB flash drive or CD-R version of my rEFInd boot manager.
If you haven't done so already, disable Secure Boot.
Boot the rEFInd medium. It will boot only in EFI mode. If it fails to boot, try again, but look for some other boot option -- trying to boot it in BIOS mode will cause a failure, but it should be possible to boot it in EFI mode.
Test that rEFInd can boot both Ubuntu and Windows. (Some entries may be non-functional; just be sure that you can boot both OSes.)
Boot to Ubuntu.
Do one of the following:

Install the Debian-package version of rEFInd. Downloads are available from the rEFInd downloads page; or you can use the rEFInd PPA, as described later on the rEFInd downloads page. This will enable you to boot much as you did with the USB drive or CD-R, but from your hard disk.
Re-run Boot Repair. This will probably produce the same complaint about the partition that needs repair unless you correct the cause of the problem.

Note that you may have some lingering issues, such as extra entries in the boot menu (whether that's rEFInd or GRUB 2). You'll need to deal with those after making the main repair to get both your OSes booting.


Why am I unable to create a SWAP partition?

Why not just create a swap file in unused space? Quick and easy:

For Adding a 512MiB swap

Creating a file for 512MiB  adjust size as desired to the size you want:

We will create a /mnt/512MiB.swap swap file and set the permissions so that users cannot read it directly.

sudo fallocate -l 512m /mnt/512MiB.swap
sudo chmod 600 /mnt/512MiB.swap

fallocate length suffixes are: k, m, g, t, p, e (See man fallocate).

By default your swap file may be created world readable. We set the 600 mode permissions in order to prevent users from being able to read potentially sensitive information from the swap file.

If fallocate fails with "fallocate failed: Operation not supported" as it currently does on my Maverick machine, you can do this the old way, again 512 mebibytes:

sudo dd if=/dev/zero of=/mnt/512MiB.swap bs=1024 count=524288
sudo chmod 600 /mnt/512MiB.swap

Formatting that file to create a swapping device:

sudo mkswap /mnt/512MiB.swap

Adding the swap to the running system:

sudo swapon /mnt/512MiB.swap

The additional swap is now available and can be seen by cat /proc/meminfo or free

Making the change permanent:

Edit the /etc/fstab:

gksudo gedit /etc/fstab

Add this line at the end of the file:

/mnt/512MiB.swap  none  swap  sw  0 0

Save. After the next reboot the swap will be used automatically.

Example of making a swap file

This is an example of making and using a swap file on a computer with no swap partition.
Enter the command below and your password when prompted:
sudo fallocate -l 512m /mnt/512MiB.swap

Then this command:

sudo mkswap /mnt/512MiB.swap

Output will be similar to the below.

Setting up swapspace version 1, size = 536866 kB

no label, UUID=dd6a01c8-93f0-41e0-9b7a-306956d8821b

Then issue the command:

sudo swapon /mnt/512MiB.swap

The following command shows you the results:

cat /proc/meminfo

MemTotal:       499496 kB

MemFree:          9156 kB

Buffers:          4748 kB

Cached:         233140 kB

SwapCached:        724 kB

Active:         254432 kB

Inactive:       157920 kB

HighTotal:           0 kB

HighFree:            0 kB

LowTotal:       499496 kB

LowFree:          9156 kB

SwapTotal:      524280 kB

SwapFree:       523556 kB

Dirty:             128 kB

Writeback:           0 kB

Mapped:         243420 kB

Slab:            20672 kB

CommitLimit:    774028 kB

Committed_AS:   648680 kB

PageTables:       2224 kB

VmallocTotal:   524280 kB

VmallocUsed:      5708 kB

VmallocChunk:   518176 kB

Make the change permanent by editing your fstab

gksudo gedit /etc/fstab

Add the line:

/mnt/512MiB.swap  none  swap  sw  0 0

A simple command to see usage is:

free

              total       used       free     shared    buffers     cached
 Mem:        499496     479488      20008          0       8256     215892
 -/+ buffers/cache:     255340     244156
 Swap:       524280       3856     520424

Then, after running a few more programs...

free

              total       used       free     shared    buffers     cached
 Mem:        499496     492768       6728          0       1240     142336
 -/+ buffers/cache:     349192     150304
 Swap:       524280      53384     470896

Next, reboot to make sure it will work consistently.

free

              total       used       free     shared    buffers     cached
 Mem:        499496     493136       6360          0       7528     174700
 -/+ buffers/cache:     310908     188588
 Swap:       524280      17148     507132

Source: https://help.ubuntu.com/community/SwapFaq


I recommend installing gawk 4.0.1 or later from one of the two PPA's that have it:

https://launchpad.net/~dns/+archive/gnu
https://launchpad.net/~schot/+archive/gawk

There shouldn't be any problems with system utilities breaking due to using this newer version of gawk.

What are PPAs and how do I use them?


My browsers can not connect to the internet while my Ubuntu is connected

This occurred to me when I updated firefox. It occurred because by default firefox use IPv6 protocol. You need to disable that.

Try this:

1) In search tab, type about:config
2) Accept the safety prompt
3) Search for network.dns.disableIPv6
4) Make sure its value is set to true. You can change it by double tapping it.

Hope it helps!


My ubuntu version is showing ubuntu 13.04 version

It seems you have added a wrong repository.

Simply just open  the sources.list

sudo gedit /etc/apt/sources.list

then remove the lines that includes the codename Quantal

Then update

sudo apt-get update

and now you are on the safe side :)


The best practice is related to needs.

for example If I want to keep my user data and i consider those data are much valuable then i'll make my home on different partition.

here in your case, since you have only one empty partition to be assigned so you have to make a choose.

What's most important for you, the users data or the services data (mysql-nginx-...) , so either make your home on the third partition or assign it for /var according to your definition of how much this data is valuable.

For me, I prefer to assign /var.

So in simple words nobody can answers you what is the best in general, you have to choose what is most valuable for you to keep it save..


At the login screen use the icon in the upper right to mute the sound. The setting is persistent.


Problem with boot from USB installing Ubuntu 12.04

You may try making your bootable USB flash drive using UNetbootin.


Error installing repo command. Help please?!! Ubuntu 12.04 LTS

Is r0b458 your user name? I assume it is not: since the error notice probably means your are not and when putting files onto your system in a location that is not owned by you you need to use sudo.

sudo curl http://commondatastorage.googleapis.com/git-repo-downloads/repo > ~/bin/repo

By the way: your command works on my system when I am logged in as rinzwind:

rinzwind@schijfwereld:~$ mkdir bin
rinzwind@schijfwereld:~$ curl http://commondatastorage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 23618  100 23618    0     0   113k      0 --:--:-- --:--:-- --:--:--  113k
rinzwind@schijfwereld:~$ cd bin
rinzwind@schijfwereld:~/bin$ ls -l
total 24
-rw-r--r-- 1 rinzwind rinzwind 23618 dec 14 21:30 repo
rinzwind@schijfwereld:~/bin$

If you forget to include the ~ in front of /bin/repo at the end of the command that would error it out with a permission denied. Otherwise I would assume it should work as shown above.


You need a wubildr file to be in the root of a (any) partition. You can find a copy of this in the E:\ubuntu\winboot directory. So copy E:\ubuntu\winboot\wubildr to C:\wubildr (this is the place the installer puts it).

For more info refer to ubuntu-with-wubi.blogspot.ca/wubildr-wubildrmbr-and-grldr


Disk drive for / not ready on boot after upgrade from 10.04 to 12.04

The apt-get -f install did not work, to many dependency package was not installe,  the solution to maintain data was download a 11.10 cd version an perform an upgrade from 10.04 to 11.10. Error was recovered and data maintained available ( the only pitty was that the 3 users defined in 10.04 was not created on 11.04 but is not a big problem )

good luck


how to extend main partition with gparted live cd

First, you need to delete the partition (New Partition #1)
Then you will be able to resize sda1


Is it possible to make a python script that runs on a specific terminal-profile

Put following script at the end of ~/.bashrc:

if [ x$DISPLAY != x ] ; then
    gnome-terminal --save-config=/tmp/prof
    PROFILE=$(grep 'ProfileID=' /tmp/prof | sed 's/ProfileID=//g' | tail -1)
    if [ "$PROFILE" == "Profile1" ] ; then
        # run your script here
    fi
fi

First if statement checks if you are running GNOME terminal, not a virtual console one. Then configuration of profile is saved into /tmp/prof. Third line reads profile name from that file. Inner if statement checks if it's a profile in which you want to call your script.

To list names of your profiles run:

$ gconftool-2 --get /apps/gnome-terminal/global/profile_list
[Default,Profile0,Profile1]


Ubuntu 20.04 Upgrade failure concerning grub-efi-amd64-signed

I used:
apt list --upgradable to get list of packages that needed to be upgraded:
Listing... Done
grub-common/focal-updates 2.04-1ubuntu26.11 amd64 [upgradable from: 2.04-1ubuntu26.9]
grub-efi-amd64-bin/focal-updates 2.04-1ubuntu44 amd64 [upgradable from: 2.04-1ubuntu26.9]
grub-efi-amd64-signed/focal-updates 1.167+2.04-1ubuntu44 amd64 [upgradable from: 1.142.11+2.04-1ubuntu26.9]
grub-efi-amd64/focal-updates 2.04-1ubuntu44 amd64 [upgradable from: 2.04-1ubuntu26.9]
grub-efi/focal-updates 2.04-1ubuntu26.11 amd64 [upgradable from: 2.04-1ubuntu26.9]
grub2-common/focal-updates 2.04-1ubuntu26.11 amd64 [upgradable from: 2.04-1ubuntu26.9]

And
sudo apt --only-upgrade install grub-common

Updated that package updated everything


Compare differences with package default configuration files

The maintainer's version of the file should be there with the same name but an added extension .dpkg-dist.

So in your case /etc/nginx/fastcgi_params.dpkg-dist should be the maintainer's version of your /etc/nginx/fastcgi_params.

By extension, you can compare the two with a quick diff:

$ diff /etc/nginx/fastcgi_params{,.dpkg-dist}
5a6
> fastcgi_param SCRIPT_FILENAME     $request_filename;
21c22
< fastcgi_param HTTPS           $https;
---
> fastcgi_param HTTPS           $https if_not_empty;


can't access ubuntu after :"sudo lilo -m /dev/sda mbr"?

Try adding a Windows version of Grub2 such as the Neogrub Bootloader. You might wanna try below guide:

The procedure which has worked for me is outlined below.
Did you perform the install of the NeoGrub bootloader in step (3)? If
NeoGrub is installed then there will be a \NST folder on your C:
drive.
I think this step is sometimes left out of guides for setting up
EasyBCD.
Using EasyBCD to Boot to GRUB from Windows Boot Menu

Start Windows and install the free version of EasyBCD.
Open the EasyBCD program and select Add New Entry from the sidebar on the left.
Select the rightmost tab, NeoGrub, under "Operating Systems" and click the Install button.
   Note:
This adds the NeoGrub bootloader code to your C:\ folder. If the
install worked correctly you will see the file C:\NeoGrub and the
folder C:\NST.
Select the Linux/BSD tab. Choose GRUB2 as the type of the entry and, optionally, edit the name of the entry you are about to add
to the Windows Boot menu.   <img src="https://i.stack.imgur.com/w89tZ.png" alt="EasyBCD Add New Entry for Linux/BSD
for GRUB2" />   Click the Add Entry button to add
an entry to boot Linux (GRUB menu) to the Windows boot menu.
Select Edit Boot Menu from the sidebar to review your changes.
Note: You can delete the entry for NeoGrub Bootloader if you wish.   You need the bootloader, but you do not need a boot menu entry
for it unless you are using it in some other way.
Save your changes and reboot. When the Windows boot menu appears, select the EasyBCD  entry you added to boot Linux. You should see
something similar to the text below.

Then the GNU GRUB boot menu should appear.
Quoted from https://askubuntu.com/a/140376/408593


Upgrading iwlwifi 7260 firmware on Lenovo T540p

The first solution with the replacement of iwlwifi-7260-10.ucode with iwlwifi-7260-12.ucode is a "cheat" for the kernel.

The module  iwl-7000.c is searching for maximum version iwlwifi-7260-10.ucode and loads it. When you replace the file it loads the new firmware.

In this case you do not need to edit the kernel source. If that solution does not improve your wireless connection, then the firmware update does not help.

The second "option" is not an option. It is the patch to iwl-7000.c to get it search for iwlwifi-7260-12.ucode instead of iwlwifi-7260-10.ucode. That will not improve anything, it will just load the original firmware file without renaming.

You will not find kernel source in your system. To patch the source you will need to download the kernel source, patch it, and then compile the kernel or just iwlwifi module.

You can find a lot of guides how to compile Linux kernel in the net or even some specific kernel modules. But it is not worth studying in this  case, because the first "option" does the same for you.

In addition, in kernel 3.19 that patch is already there, so you do not need to rename the file. That is why it does not work.

See iwl-7000.c in Ubuntu kernel 3.19.

Just leave the original iwlwifi-7260-12.ucode file name.

P.S. You found an old solution. Now the latest firmware is already iwlwifi-7260-13.ucode and it is available in Ubuntu 14.04 and 15.04 already. But still there are issues with this wireless adapter.

So I suggest using the workaround.

P.P.S You can try to replace iwlwifi-7260-12.ucode with iwlwifi-7260-14.ucode the 3.19 kernel tries to load the version 12, but 14 may have some improvements or not.


xdotool errors over ssh on Ubuntu 20.04 LTS

The thing is this will control the system that is connected via SSH and not the Host you want to Control.
For a example I login with the ssh -X server@192.192.192.192 and then tell xdotool to move the mouse instead of moving the mouse on the Server it moves the mouse on the client that is connected.


english for terminal, spanish for everything else

Try something like:

export LANG=en_US.UTF-8 && export LANGUAGE=en_US:en && gnome-terminal --window

If this works, create a launcher for this command ..


Run Full Ubuntu Installation from UEFI Bootable USB stick

Not sure why you cannot use Windows UEFI system to create UEFI flash drive. You should still turn off fast boot, and probably turn off secure boot. You then should be able to boot Ubuntu installer and using Something Else install to the second flash drive. You must specify to install grub2's boot loader to that flash drive.

If not you cannot easily create a UEFI bootable device on a BIOS system. You can manually partition with gpt which is required for for UEFI boot. But Ubuntu will also boot in BIOS mode from gpt partitioned drives and Boot-Repair will convert a BIOS install to UEFI by uninstalling grub-pc and installing grub-efi. But that needs to be on a UEFI system.

You can format in advance using gparted, advanced choose gpt not default msdos(MBR) partitioning. Create 200 or 300MB FAT32 partition with boot flag so it is efi partition. If booting initially in BIOS mode create an unformatted 1 or 2MB partition with the bios_grub flag. Then add partitions you want, / (root) and /home or data. If wanting to also share data with Windows, make first partition NTFS, and efi etc after that.

I have not tried it but you may be able to just copy grub's efi boot files into efi partition and add a configfile to get it to find grub.cfg in your install. Or manually boot from grub rescue and reinstall grub.


Unity not working properly after a crash

There seems to be something completely messed up !

The re-install of the desktop environment should fix it.

Open a terminal and execute the following commands :

sudo apt-get update
sudo apt-get install --reinstall ubuntu-desktop

After the installation I recommend to restart the system.


My computer came with Windows 8 pre-installed so I shrunk the Windows partition to make room for Ubuntu. That is how it worked for the last year.
After the second reboot in Windows 10 upgrade the computer did not boot any more. GRUB only displayed a grub rescue command prompt. I found out later that the problem occurred because Windows somehow changed the partition scheme. The boot partition (containing normal GRUB data) was no longer where GRUB expected it. I don't know how and why this happened.

The first thing that you can do in the rescue mode is to see the partitions with the ls command. Mine were:

(hd0,gpt1),
(hd0,gpt2),
etc.

Try to find out which partition is your boot partition. There is no Tab completion, you have to type it out completely. I tried the following commands until I found the right partition:

ls (hd0,gpt1)/
ls (hd0,gpt1)/boot
ls (hd0,gpt2)/

etc.

Then type set in the same prompt. It will display where GRUB looks for its files. In my case (hd0,gpt6) has moved to (hd0,gpt7). The set command displayed:

prefix=(hd0,gpt6)/boot/grub
root=hd0,gpt6

To get back into normal GRUB, start by changing the prefix setting to point to the right partition. In my case the command was:

set prefix=(hd0,gpt7)/boot/grub

Then you can switch from rescue to normal mode:

insmod normal
normal

One could also have fixed the root setting with:

set root=(hd0,gpt7)

But this is not strictly necessary, as it doesn't matter for Windows chain-load entries. Once in the normal GRUB menu, you can boot Windows and finish your Windows upgrade. The problem is that you have to tell grub rescue about the right partitions on every reboot. That is how I did it. I left the problem of GRUB for later because I was not sure whether Windows would do some more changes to the partitions or boot.

When Windows finished I started to solve GRUB problems. Press e to edit boot options for Ubuntu. I changed all (hd0,gpt6) to (hd0,gpt7) and Ubuntu booted.

However, I use encrypted partition and cryptswap. At the boot Ubuntu asked me for the passphrase. Fortunately I saved it at the installation of Ubuntu and entered it at the boot. Ubuntu booted without problems.

I then corrected the /boot/grub/grub.cfg file where I replaced (hd0,gpt6) with (hd0,gpt7) and performed:

sudo grub-install

At that point the only remaining issue was the encryption. Since the root Ubuntu partition number was increased by one (7 instead of 6), the swap partition suffered a similar change. I had to change the /etc/crypttab file to point to /dev/sda8 instead of /dev/sda7.

I am using only two partitions for Ubuntu (root and swap). If other operating systems coexisting with Windows use more partitions there might be more changes required. Especially if partitions are mounted according to their numbers and not by their UUIDs. Take a look at your /etc/fstab. If the partitions are identified by UUID there should be no problems. But if there are /dev/... lines the number should be corrected if these partitions had been renumbered.


RT2800 Wireless card on 16.04 ubuntu (Fresh Install)

You have three (!!!) wireless drivers loaded. I suggest that we unload the two that are not relevant. Please open a terminal and run:

sudo modprobe -r rtl8192cu
sudo modprobe -r rtl8xxxu

Reboot. Did they somehow load automatically anyway? If so, we'll blacklist them. CAUTION: Do not undertake this step unless its required because the drivers reloaded.

sudo -i
echo "blacklist rtl8192cu"  >>  /etc/modprobe.d/blacklist.conf
echo "blacklist rtl8xxxu"  >>  /etc/modprobe.d/blacklist.conf
exit

I suspect that you tried some other USB wireless with an rtl8192cu chipset that also didn't work well because too many drivers loaded.

Finally, I suggest that you turn off wireless N in your router. I have seen and worked on several cases where 802.11N made rt2800xxx devices throw errors and fail to connect. Please set your router to use Auto B and G but not N.


Do all updates, even kernel, take affect without rebooting

Kernel updates will need a reboot to complete.

After a kernel update, the new kernel is installed but Ubuntu continues to run to old kernel until reboot.  upon reboot, the new kernel is loaded.

Most other updates can be done with the system running, any open applications that were updated run the old version until they are restarted but the system does not have to be restarted, just the application.  This is because the running application is loaded into the RAM so they continue to happily run the older, loaded version until they restart at which time they reload from the hard disk with the new version.

About the kernel update message you posted;

This update message is telling you that the new kernel is being installed and the system boot files updated and then finally that Grub is being updated to find the new kernel and then add it to the boot list as the default version at boot.  While the new kernel is installed on the disk and set as the default boot selection, it will not be loaded until reboot.

If you install one of the updates that need a reboot to take affect, after a short time the gear icon on the top right hand corner of your screen(assuming you are using Unity) will turn red to notify you that you need to restart.  If you try to log off when a restart is needed a dialog box will pop up notifying you that a reboot is needed and asking you if you would rather restart instead of logging off.

Edit: I forgot to mention that this is true not matter what version of Ubuntu you are running.


access to a web application from ubuntu 14.04 to windows 7

First of all the IP Address you have 10.1.1.177 is private, it means that, this can only be recognized and accessible within the same domain not from the PC which is not part of your home network.

So for accessing your PC from any remote site, you have to determine your Public IP address, that is, your Router's IP Address, then you have to forward your port number (which is 80 in your case, but it might be different if you manually select some other port number). For understanding of port forwarding and router's working, the links below maybe helpful:

How To Forward Ports on Your Router

How to Set Up Port Forwarding on a Router


Here's what I have used:

Where MY_WIN_NAME is my windows username
      WIN_PASSWD  is my windows login password
      192.168.1.77 is the ip address of my windows box
      SHARE_NAME   is the windows share name
      /home/myacct/m edia is the mount point:

mount -t cifs   -o \ user=MY_WIN_NAME,password=WIN_PASSWD,rw,hard,nosetuids,noperm,sec=ntlm \
      //192.168.1.77/SHARE_NAME  \
      /home/myacct/media


Wireshark HTTP request methods for GET and POST on wlan0

When I try to use a DNS lookup on the addresses given by other machines on the network, they don't turn up anything.

Well, Wireshark's using DNS to translate IP addresses to names, so there's your answer.  If there were DNS entries for them, they'd get resolved.  Perhaps some other address-to-name resolution mechanism allows the IP address for your host to be resolved on that host.

(And, no, this has nothing whatsoever to do with the false claim that "|| behaves like && and && behaves like ||".)


The Big Blue 'E' is Internet Explorer on Windows, which is a web browser.  Ubuntu does not run Internet Explorer, but has several other browsers available to access the internet.  Common ones include Firefox and Chromium, and Google Chrome.

Look for an Icon on the desktop that looks like a blue circle with an orange fox wrapped around the bottom - this is Firefox.  You can use it to access the internet.  Alternatively, press the 'special' key on your keyboard (probably looks like a windowpane) and type firefox, which will cause your computer to search for firefox.

The default icons for various browser on Ubuntu include:

Firefox
Chromium


Workaround to Hash sum mismatch in apt-get update behind firewall

I think your options are to:

Update from another location, off line. See How can I update Ubuntu offline without using Synaptic or Keryx?
Talk to your sysadmin and have them explore a solution to the firewall.


No such file or directory Ubuntu Commanline

The current working directory before the $ terminal prompt shows that you are currently in your home directory and so is TESTgithub, however you are trying to change directories with the command cd /TESTgithub to it as if it's located in the root directory / instead. The correct command to use for this operation is cd ~/TESTgithub where the ~ is an abbreviation for your home directory, or you can also use cd TESTgithub if you are already in your home directory.


In short:

to have working graphical UI you need X server and window manager
you can set up X to just start window manager, you choose, without presenting login screen, but then you will be logged in as the user, that runs X (so in most cases iirc root)
if you want to be able to log in as different user you need Display Manager
(disclaimer: I haven't dabble into it for some time, so don't know if what I say applies to Unity and Cinnamon) most of desktop environments provide their own display manager (XFCE - xdm, KDE/plasma - kdm, old Gnome - GDM)
if you use display manager, it's where you choose what session to run, and only after you provide correct credentials, chosen desktop environment is started
it is possible to use KDM and choose XFCE session and it will work ... well, in most cases at least, that is why, most desktop managers have their own DM, which they prefer and will install it by default (it boils down to each window manager/desktop environment requiring some set of variables to be set, or certain services to be started, before user can interact with the actual UI, that's why it's better to use native DM for given environment)
if you want to try out different desktop environment, it's generally better to install a distro that comes with it by default (f.ex. Kubuntu, Xubuntu, Ubuntu Gnome, etc.) that to install meta packages like xubuntu-desktop or kubuntu-desktop iirc
there are also stand-alone login managers (f.ex SLIM - simple login manager)

Glossary:

Window manager, Desktop Environment, Desktop manager - I'm using those interchangeable, I know, that from purist point of view they are not the same, but here, generally refer to your Desktop - be it Unity, KDE, Gnome, Fluxbox, or whatever else :)
Display Manager, Login manager - KDM, GDM, XDM, SLiM, etc


As I documented here in another question, this should install RVM on a per-user basis.


Recover files from External HDD to DVD+RW using Photorec

We can not use a DVD/RW to save our recovered files.

In case the files you need to recover are worth it you should get another external drive to hold all the data.

Another possibility it running testdisk from the same application suit. With this application you may be able to recover your partition table to access files. You can also restore single files on your internal drive from running testdisk.

See: How do I recover my accidentally lost Windows partitions after installing Ubuntu?

  To avoid data loss it still is strongly recommendend to run testdisk on an image of your drive rather than on the original drive.


How do I force a redraw using python in gtk3?

widget.queue_draw()

It is the same as in GTK+ 2.x.


I want to extract link from a HTML page to download my images, and I have several thousand of these HTML files. How do I go about this?

Depending on the complexity of the input files I suggest
not trying to parse HTML with awk, grep and such but
to use an HTML parser. For similar tasks I use lynx,
the text mode browser. To install it a
simple sudo apt install lynx is sufficient. Then:

for file in *.html; do
    lynx -dump -listonly -nonumbers $file >> links.txt
done

For your sample snippet it creates the following output:

file:///imagelibrary/large/009514HB.JPG

When done, the file:// part needs to be replaced with a proper base URL:

sed -i 's|file://|https://www.dermquest.com|' links.txt

Result:

https://www.dermquest.com/imagelibrary/large/009514HB.JPG


ProStar gaming laptop, which had Ubuntu 10.10, won't boot past Grub. Thoughts?

It turns out that the laptop isn't worth the trouble.  My solution was to install Windows 7, and then use the Windows 7 installer for Debian, which installed Debian onto the second hard drive.  Then I modified the Windows 7 bootloader to boot Debian by default.  I still don't know why the machines that once booted into Ubuntu 9.x and 10.x without issue fail to boot any Linux installation disc.  I also did check the BIOS, no changes.  I checked the installation discs, they work just fine on other machines.  Truly a case for the Twilight Zone.


Switch keyboard layout with Win (Super) key

I use a workaround which in itself is not dependent on Dash, but for that very reason can be used with Dash or any launcher - like Synapse, but also launchers specific to each desktop like Xfce, KDE etc.

The idea is to create layout-specific desktop-files and put them in /usr/share/applications, so that they can be launched like any other application.

In action:

The launcher sees them as applications, each selecting a specific keyboard layout.

The command executed by each such launcher should be a setxkbmap command, which has the following form:

setxkbmap <keyboard-layout>

For example, for French it should be setxkbmap fr. For US International with dead keys: setxkbmap us intl, where us is US English and intl is the variant.

To see the proper forms of layouts and variants, look in /usr/share/X11/xkb/rules/xorg.lst.

Each desktop file should be created by opening a text editor, putting inside lines similar to the below and saving the file with a name similar to keyboard_FR.desktop, keyboard_US, keyboard_US-deadkeys.desktop, etc. (The name of the .desktop file may be different than the one set in the line Name=. The later is the one seen by the launcher.)

[Desktop Entry]
Name=US - Keyboard US International dead Keys
Exec=setxkbmap us intl
Icon=path/to/some/icon/file
Terminal=false
Type=Application
Categories=Application;Utility;

So, create a desktop file for each keyboard layout that you need, changing accordingly the name, command variables and icons.

Pay attention to the first letters of the line Name= because Dash and any launcher will find according to the beginning of the name. You may choose to start with a short-name of the layout (FR for French, US for US English, etc) or with a common form like Keyboard to see them all together.

Icon= is also a useful line, to display it all better. You may find  country flags or letters ready made icons on the internet by searching "icons flags" or "icons letters". (Or use Shutter to create your own png icons by selecting a monochrome field and writing on that the short-name of the layout etc.)

On Synapse - here.


APT update fails: writing more data than expected

Add a parameter that adds a 'no-cache' header to the http/https requests. It asks the apt server to provide un-cached files. This can be useful if there are any kind of (broken) caching mechanism between your machine and apt mirror/server. (Such as proxy, transparent caching by ISP etc)

sudo apt -o Acquire::https::No-Cache=True -o Acquire::http::No-Cache=True update

just run this command in your terminal and it should work just fine


Running `sudo ./install` for MATLAB returns a permission denied error

Try executing the following command:

chmod +x /home/jan/matlab2015linux/bin/glnxa64/install_unix

After that, try to install MATLAB again.

Good luck!


Ubuntu 16.04 - HP Envy x360 WiFi issue Intel 7265NGW

Simply blacklist it:

sudo -i
echo "blacklist acer-wmi"  >>  /etc/modprobe.d/blacklist.conf
exit

Reboot.


To force the qtcreator launcher to point to the right location you can copy the .desktop file of the version installed by apt-get in your $XDG_DATA_HOME folder (default is ~/.local/share)

Open a terminal and copy the /usr/share/applications/qtcreator.desktop file to ~/.local/share/applications :

cp /usr/share/applications/qtcreator.desktop ~/.local/share/applications

Edit the Exec= command to use your custom location:

[Desktop Entry]
Exec=<path_to_your_custom_location>/qtcreator %F
Icon=QtProject-qtcreator
Type=Application
Terminal=false
Name=Qt Creator
GenericName=Integrated Development Environment
MimeType=text/x-c++src;text/x-c++hdr;text/x-xsrc;application/x-designer;application/vnd.nokia.qt.qmakeprofile;application/vnd.nokia.xml.qt.resource;
Categories=Qt;Development;IDE;
InitialPreference=9

Now if you lock this new .desktop file in your Unity Launcher it should start the right version.

Reference: http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html


The permissions on your $HOME directory are incorrect. You can fix it by typing chmod u+w $HOME.

Notice that the files and directories you created using sudo are probably owned by root now, so, you will need to fix ownership on these. You can do it by using sudo chown logandark.logandark <file or directory name>.

EDIT: To change ownership recursivelly, add the -R option to chown, like chown -R logandark.logandark .git. Be very careful when doing stuff recursivelly.


Instructions to use Mac to create USB boot to install Ubuntu 18.04 stick for PC please

Launch Disk Utility from Applications>Utilities or Spotlight search
Insert your USB stick and observe the new device added to Disk
Utility
Select the USB stick device (you may need to enable the option
View>Show All Devices) and select Erase from the tool bar (or
right-click menu)
Set the format to MS-DOS (FAT) and the scheme to GUID Partition Map
Check you've chosen the correct device and click Erase.

Warning: Disk Utility needs to be used with caution as selecting the wrong device or partition can result in data loss.

To write the ISO file to the USB stick, we're going to use a free and open source application called Etcher. After downloading this and clicking to mount the package, Etcher can either be run in-place or dragged into your Applications folder.

By default, recent versions of macOS block the running of applications from unidentified developers. To side-step this issue, enable ‘App Store and identified developers' in the ‘Security & Privacy' pane of System Preferences. If you are still warned against running the application, click ‘Open Anyway' in the same pane.

Etcher will configure and write to your USB device in three stages, each of which needs to be selected in turn:

Select image will open a file requester from which should navigate to
and select the ISO file downloaded previously. By default, the ISO
file will be in your Downloads folder.
Select drive, replaced by the name of your USB device if one is
already attached, lets you select your target device. You will be
warned if the storage space is too small for your selected ISO.
Flash! will activate when both the image and the drive have been
selected. As with Disk Utility, Etcher needs low-level access to your
storage hardware and will ask for your password after selection.

After entering your password, Etcher will start writing the ISO file to your USB device.

The Flash stage of the process will show progress, writing speed and an estimated duration until completion. This will be followed by a validation stage that will ensure the contents of the USB device are identical to the source image.

When everything has finished, Etcher will declare the process a success.

Congratulations! You now have Ubuntu on a USB stick, bootable and ready to go.

If you want to use your USB stick with an Apple Mac, you will need to restart or power-on the Mac with the USB stick inserted while the Option/alt(⌥) key is pressed.


What are the hotkeys to find the next and previous occurrence of a search term in man and info?

For the man command, as you say, use /YOUR_SEARCH to find the first occurance of YOUR_SEARCH and then n to get to the next one.  Use N to move to the previous occurrence.

For the info command, type s to search, then enter your search term or regex.  It will bring you to the first occurrence.  To move to the next match, type }, to move to the previous occurrence type {.


How do I fix(make) apps windows to be opened at desired place of the desktop?

If you run the script below with the arguments:

<application> <x> <y>

The window of the application will be placed at x, y on your screen.

How to set up

The script uses both wmctrl and xdotool:

sudo apt-get install wmctrl
sudo apt-get install xdotool

Then:

The most elegant way is to Copy the script into an empty file and save it in ~/bin (you might have to create the directory) as place_window (no extension)
Make the script executable (!)
If you just created ~/bin, either log out / in or run the command:

source ~/.profile

Test run it with the command (e.g):

place_window gedit 100 100

A gedit window should appear at x = 100, y = 100 on your screen.

If all works fine, you can either put the command under a shortcut combination (choose: System Settings > "Keyboard" > "Shortcuts" > "Custom Shortcuts"), or at it as a quicklist -shortcut to an application launcher.

The script:

#!/usr/bin/env python3
import subprocess
import getpass
import time
import sys

app = sys.argv[1]
user = getpass.getuser()
get = lambda x: subprocess.check_output(["/bin/bash", "-c", x]).decode("utf-8")
ws1 = get("wmctrl -lp"); t = 0
subprocess.Popen(["/bin/bash", "-c", app])

while t < 30:
    ws2 = [w.split()[0:3] for w in get("wmctrl -lp").splitlines() if not w in ws1]
    procs = [[(p, w[0]) for p in get("ps -u "+user).splitlines() \
              if app[:14] in p and w[2] in p] for w in ws2]
    if len(procs) > 0:
        w_id = procs[0][0][1]
        cmd1 = "wmctrl -ir "+w_id+" -b remove,maximized_vert remove,maximized_horz"
        cmd2 = "xdotool windowmove "+w_id+" "+sys.argv[2]+" "+sys.argv[3]
        for cmd in [cmd1, cmd2]:
            subprocess.call(["/bin/bash", "-c", cmd])
        break
    time.sleep(0.5)
    t = t+1

How it works

The scripts runs the command to start the application, waits for the corresponding window to appear (waiting for the pid to produce a new window) and positions it to the coordinates you define.

place_window gedit 50 150

place_window gedit 150 50

Setting the command as a quicklist item

The most elegant would be to add it as a keyboard shortcut, or, alternatively, as a quicklist item:

In that case, the command to use in the Exec= line would be e.g.:

Exec=/bin/bash -c "place_window gedit 600 600"


Two Issues: And it sounds like you will need to do Reference 2B and 2A BEFORE you can fix the problem
1:
A "High-severity security bugs found in Nvidia drivers" in both
the Windows and the Linux Drivers.
There was a problem with the drivers for the Nvidia GTX 1660 Super Graphics card and an updated version was released last week.
But it is worse than that. A "High-severity security bugs found in Nvidia drivers" and after I read the article about it, I updated mine.
In Reference:
https://www.techradar.com/news/nvidia-warns-gamers-to-update-their-gpu-drivers-right-now-due-to-severe-security-problems
Issue Two
Part A the problem
Part B Fix with Boot Live Windows Tools:
2A:
Overview
Intel Rapid Storage Technology (RST) is a solution built into a range of Intel chipsets. On platforms that have RST support built and enabled in the computer’s BIOS, it allows users to group and manage multiple hard disks as single volumes. This functionality is known as the Redundant Array of Independent Disks (RAID).
In some usage scenarios, RAID offers various advantages over the use of several disks independently. RAID offers multiple configurations - levels - which focus on performance and redundancy.
The directions for
"Changing the storage controller protocol from RST to Advanced Host Controller Interface (AHCI)."
And more is posted
In Reference:
https://help.ubuntu.com/rst/
2B:
Fix with Boot Live Windows Tools
Search terms used
"Boot Live Windows 10 repair distros 2021 Hirens"
The following looks like an excellent reference {from the search I did}>
5 Bootable Windows PE ISO To Boot, Recover And Repair Windows
Posted January 1, 2021
https://www.geckoandfly.com/32030/bootable-windows-pe-recovery-repair/


Starting EasyVPN Snap VPN on boot systemd

The Problem arises because SystemD is run as root. The easyvpn command mentioned above is not known systemwide.

The Path can be corrected by changing the bash command to:

#!/bin/bash
echo "snap run easy-openvpn.connect-server /home/alexlanganke/vpnconfig.ovpn" | bash

Found the Solution with better explanation here:
How to run a command in a snap package


Korean (hangul) text entry not working Ubuntu 18.04

The solution to my problem was so simple I wanted to hit myself.

I couldn't choose Korean (Hangul) and picked Korean instead. As a result I could only use it as a modified english keyboard. I tried 3 different things people suggested to similar problems and nothing worked.

Long story short, the answer was the Tweaks application. Just go to Keyboard & Mouse and swich on Show Extended Input Sources and then restart.

After that Korean (Hangul) can be chosen in the usual language input settings.

All that was left to do was go to the toggle option in the top bar (usually showing en or ko depending on which language is in effect), then to Setup (only visible when korean is currently chosen), lastly check the box left to Start in Hangul Mode and restart one last time.

Now everything is working exactly the way it should.

This may be trivial to most of you but I for one would have appreciated a walk-through like this to save me a lot of frustration...


That's because the developer (grumbel) has only released xboxdrv for Ubuntu 12.04 yet, NOT xboxdrv-stable. I don't know the difference, but try

sudo apt-get install xboxdrv

and your problem should most probably be solved.


terminal won't open after changing locale file

I faced a similar issue while installing some packages that modify the locale files. Had to google and roam around SO pages a lot until I found the solution here.

Basically, the issue is that the LANG or LC_ALL properties need to be set properly for many GUI apps like Terminal to work. Some package changes might corrupt these properties.

You need to inspect the output of locale command and make sure that at least the LANG property is set to your preferred locale language. Mine is en_US.UTF-8 or en_IN.UTF-8.

You can do the following steps to resolve the problem:

1.) generate a locale if it's not already available using the command,

locale-gen <locale_name>

You can get the names of available locales by using locale -a.
I would suggest

locale-gen en_US.UTF-8

if you are not sure about your locale value.

2.) update the desired locale for LANG property. Use the command

update-locale <locale_name>

You may need to use sudo if necessary.

3.) Restart the PC and then try opening terminal.

If this doesn't work, please post the output of locale, locale -a and contents of etc/default/locale for more info.


How to fix Ubuntu 12.04 boot, using Windows XP?

You can't fix it using a windows tool. To fix the bootloader you need an ubuntu live cd.


The 'Super' button can be set as an activation key in the configuration file for Synapse.

See Can I change Synapse shortcut to Super/Windows key alone?


Use Nautilus to open an SSH connection using hostname

"192.168.1.153" is a private ip address on a LAN.

So, on the server (192.168.1.153) set a static ip address if you have not already.

On the client, edit /etc/hosts

sudo nano /etc/hosts

and add a line at the bottom -

  192.168.1.153  barton

You should then be able to run ssh://freedom@barton


can't run python script with crontab and startup application

Jobs run through cron, crontab, aren't run in the same runtime environment that you have on your desktop. None of your PATH changes, or other environment  variable settings are automatically propagated to  your cron job. For example, there's no $DISPLAY, so GUI programs need special treatment (read man xhost).
One can set environment variables for all one's cron jobs in the crontab file
Read man 5 crontab.
Look at the results of  echo "=== set ===";set;echo "=== env ===";env | sort;echo "=== alias ===";alias in each of your environments.
Since the command part of the crontab line is, by default,  interpreted by /bin/sh, which has a simpler syntax than /bin/bash, I recommend having command be a call to a bash script  (executable, mounted, starts with #!/bin/bash) which sets up the environment,  then calls the desired program.


Regarding the standard home encryption provided by Ubuntu, you can

sudo ls -lA /home/username/

and if you get something like

totale 0
lrwxrwxrwx 1 username username 56 2011-05-08 18:12 Access-Your-Private-Data.desktop -> /usr/share/ecryptfs-utils/ecryptfs-mount-private.desktop
lrwxrwxrwx 1 username username 38 2011-05-08 18:12 .ecryptfs -> /home/.ecryptfs/username/.ecryptfs
lrwxrwxrwx 1 username username 37 2011-05-08 18:12 .Private -> /home/.ecryptfs/username/.Private
lrwxrwxrwx 1 username username 52 2011-05-08 18:12 README.txt -> /usr/share/ecryptfs-utils/ecryptfs-mount-private.txt

then the username's home directory is encrypted. This works when username is not logged in, so the partition is not mounted. Otherwise you can look at mount output.

About the swap, do

sudo blkid | grep swap

and should check for an output similar to

/dev/mapper/cryptswap1: UUID="95f3d64d-6c46-411f-92f7-867e92991fd0" TYPE="swap"


can't access certain web sites using Ubuntu

Have you checked to see if you Firefox adding folder is still there? Chromium and Firefox share a plugin folder, it could be corrupted or missing and the problem could be flash player not running.

Also check the App Store and see if you have flash installed. If so try uninstalling it then reinstalling. This is the only issue I could think of please comment if it works.


I had to run make -f Makefile.dkms boot_conf

To create initramd entries.

Also you'll need to manually enable modules in grub - add below line to /etc/default/grub.conf:

GRUB_PRELOAD_MODULES="cryptodisk luks gcry_rijndael gcry_sha1 lvm


Internet Connection for Ubuntu VM in virtualbox on corporate laptop

Normally you set the Ubuntu Guest OS VirtualBox network settings to use Bridged Adapter.

If that doesn't fix it for you, talk to your network administrator or system administrator.


brother MFC-J435W wireless scanning issue

head over to This Page and download the drivers for your scanner. There should be two deb files install them both.

After installing them, execute the command

sudo brsaneconfig4 -a name=scanner model=MFC-J435W ip=192.168.xxx.xxx

Check that your scanner is registered with

brsaneconfig4 -q | grep scanner

Your wireless scanner should now be installed


You can create animated gifs using GIMP. It's not easy to replicate those effects, though. It will take lots of experience and practice.


Windows are going black when mini/maximizing

This is a well known bug. Currently is no fix for it.

You can avoid it by turning off Animations, in ccsm (CompizConfig Settings Manager).
Or reducing the amount of memory used by your video card.

More information can be found on the bug report page.

https://bugs.launchpad.net/ubuntu/+source/compiz/+bug/1072206


Suspend and hibernate mode doesnt work on my laptop

I had similar problem with Asus laptop (motherboard: ASUS N501JW).Turned out to be a motherboard software problem and got fixed after a bios/uefi update to latest version available.

The flashing program I used was the one that came on windows. It have auto detecting and downloading of new updates. For your specific model, this is your drivers page. BIOS-Utilities are the Windows executable, while BIOS are the actual files to flash.

However, I have no experience in trying a flashing process outside of using windows' exes that OEMs distribute.


Cannot view mounted drive contents in Sonarr/Radarr

I don't have enough rep to comment, but:

And what are the permissions according to a real shell? (ls -la)
What are the settings in /etc/fstab? (Post the relevant line)
What is the drive format? (This is also noted in fstab, but to be sure: sudo file -sL /dev/sd*)

I'm guessing it's a problem like this one: How to change permissions on mounted windows share?


RaspberryPi Snappy Ubuntu. Screen only flashes on and of on boot

By the description, it sounds like you're using a Raspberry Pi B or B+, which has an ARMv6 CPU. To use Snappy, you need a Raspberry Pi 2, which has an ARMv7 CPU.


Log as the guest user, to do this click on the shut-down icon on the right and in the menu that appears choose "Guest session". Try to start openoffice in this new session.

If it does start, then it's likely that your profile is corrupt. Get back to your real session (close the guest one with the shut-down menu). Click on your home on the Places menu, then on the View Menu select Show Hidden Files. Locate a directory called .openoffice.org, rename it to something different. Try to start OpenOffice again.

Note that you will lost all your settings for OpenOffice.


Unable to mount media hard drivrs. after [user@machine ~]$ sudo usermod -G dialout user

You left out the -a switch to add, rather than replace your groups.  Now you are ONLY in the dialout group.  You will need to boot into rescue mode and go to a root shell, make sure the disk is mounted r/w, and put yourself back in the other groups:

mount -o remount,rw /
usermod -G dialout,adm,cdrom,plugdev,admin


Install and Configure Samba Server as File Server on Ubuntu Server 12.04

http://ubuntuserverguide.com/2012/06/install-samba-server-ubuntu-server-1204-lts.html


Is it possible to align windows to other windows instead of fixed half screen?

No, currently you cannot do so with compiz, which is required by Unity. Because the Grid plugin from compiz only allow you half-split the window.
But, there are plans to make the grid sizes configurable in future. From the Compiz Wiki page for Grid plugin, under ideas section, these are mentioned

Make the grid size reconfigurable instead of the fixed 33%,50%,66% sizes (ie. Maybe an even better option is to retain the 2x3 grid, but allow the user to specify how big the grid blocks are.)

Perhaps assign a layout per workspace or hotkey to switch between grid sizes


Can't ssh nor ping into and out of the system but internet is working

Have you installed ssh server and client on your Ubuntu?

Try:

sudo apt-get install sshd

Have you opened proper ports?

ufw allow 22/udp

Or maybe the problem lies on your interface having it NAT from your network.

Double check if from your Ubuntu, can you ping any devices from your network (router, computers).

Have your ping result here and let's see what we can do.


It isn't a bug. The package games-tetris is a meta package and installs

Debian's tetris-like games

as you can see here and games-tetris isn't gnome-tetris.

Install the game of your choice, here is the list. Or install a Tetris-like game for Gnome

sudo apt-get install quadrapassel

but think of it. Also this game have dependencies ;)

To search Tetris-like games use

aptitude search '~dtetris'

or

apt-cache search tetris

  So, can someone please explain to me why installing a tetris game
  requires both perl and python bindings to dozens libraries?

Yes, ask the developers of the games, why they have decided to use Perl, Python and so on.


Run:

sensors | tail -n3 | head -n2

tail -n3 will output the last 3 lines (there's an empty line at the end), then head -n2 will output the 2 first lines you want (and discard the empty one).


DenyHosts SERVER_SYNC option, call for anecdotal reports

I certainly am using it.

It works as you'd expect it to and it is probably denyhosts best feature.

I have a bunch of servers each one is set up using

SYNC_SERVER = http://xmlrpc.denyhosts.net:9911
SYNC_INTERVAL = 1h
SYNC_UPLOAD = YES
SYNC_DOWNLOAD = YES

The reason that this is so awesome is that an attack starts on one server, which causes that IP address to be blocked on all of our servers. So by the time the attacker gets around to the other servers he is already blocked before the attack starts.

Make sure you add at least one good IP address to you allowed-hosts file and then start using it.

Details of what IP addresses are being blocked using the synchronisation, can be found in the file "sync-received".

I have not found, and I cannot think of, any downside to using this.


Docker Container apt-get update fails but container can ping / curl the links just fine

docker-compose.yml

version: "3.7"
services:
  app:
    build:
      network: host
      dockerfile: dockerfiles/application.Dockerfile

Use host networking


I can only log in as a guest how do i fix this

Since you mention that no user accounts work, you will need to reset the administrator password from recovery mode.  There is already an excellent Q&A describing this so I won't reiterate that here (see below).

When you have logged into the administrator account, you can reset the user ICE-Authority file as follows:

Open a terminal
cd /home/[user account]
where [user account] is the name of the account - for example paul

i.e. cd /home/paul

then

sudo chown paul:paul .ICEauthority
sudo chmod 0644 .ICEauthority

logout and then login to the paul account.

Error saying "unable to update ICE authority" while booting
How do I reset a lost administrative password?


Switching desktop environment from Unity?

You have a few solutions here:

You could change the default session to be what you want using lightdm-set-defaults. If you've already set a different session, this may not work, I think it will prefer the session you chose last. The session name should match the file name in /usr/share/xsessions, without the .desktop on the end. I think maybe the default session moves to the top of the list though, so this may still work for you.

/usr/lib/lightdm/lightdm-set-defaults --session <session>
You can go to /usr/share/xsessions and rename the ones you don't want to something besides <session>.desktop, like <session>.desktop.old.  I think that will hide them. You could also just uninstall the desktop environments you don't want.

Lastly, please take a screen shot of this and file a bug against unity-greeter for this list not fitting properly.


Recovering encrypted home directory after UID change

I had to change the UID on the encrypted folders.  usermod didn't do that for me automatically.  Specifically, I did:

sudo chown -R newUID /home/.ecryptfs/myUser

Then I rebooted.


OS confusion about default audio sink - pulse

You can try to create udev rule
https://www.freedesktop.org/wiki/Software/PulseAudio/Backends/ALSA/Profiles/#udevrule

or create systemd service like this https://wiki.parabola.nu/PulseAudio/Troubleshooting#No_sound_after_resume_from_suspend

to handle suspend


Boot folder is full so cannot install updates.

Delete the old Kernels

sudo apt-get purge $( dpkg --list | grep -P -o "linux-image-\d\S+" | grep -v $(uname -r | grep -P -o ".+\d") )

OR

use Ubuntu tweaks and then run janitor to clear unused packages

http://ubuntu-tweak.com/


Should be pretty easy

wget https://www.dropbox.com/s/r2pb41rhx65t9zi/BCM20702A0-0a5c-216f.hcd
sudo cp BCM20702A0-0a5c-216f.hcd /lib/firmware/brcm/
sudo modprobe -r btusb
sudo modprobe btusb

And bluetooth should work

In a few days you should be able to sudo update-usbids and your bluetooth device should be identified as bluetooth in lsusb


repeatatively creating sync_super for www-data which is showing high CPU usage

It's probably malware. sync_supers was a kernel thread, which should never be running as www-data, and hardly using any resources. And it should not be in use on a 16.04-system.

So check your backup for malware, and nuke the machine, and reinstall from backups that you have verified is clean. A compromised system should probably not be trusted ever again, as it is difficult to find all backdoors that may have been left there.


Numpy installed only for python3.5, not for python3.6

make sure pip is installed with:

wget https://bootstrap.pypa.io/get-pip.py

and:

sudo python3.6 get-pip.py

and then you can install numpy with:

sudo python3.6 -m pip install numpy


I wont to diable windows 8 option in booting and directly start with ubuntu 12.04

Simplest way to do is with grubcustomizer

sudo add-apt-repository ppa:danielrichter2007/grub-customizer
sudo apt-get update
sudo apt-get install grub-customizer

You just install that app and I think you will get the hang of it, if not post here and I will show you how.

The harder way to do it is from terminal. See link here.


How do you change TTY font size before login?

I am able to change the font in TTY by adding this script to ~/.profile:

There should be no need for that. You do that with ...

sudo dpkg-reconfigure console-setup

1st window will ask for encoding. Pick UTF-8.
2nd window will ask for character set. Pick "latin".
3rd window will ask for the font. Pick Terminus.
4th window will ask for font size. And here you can choose a size; Terminus has a few more sizes that the other fonts.

Settings apply after you log in again and run

setupcon

or after a reboot.


Fresh Ubuntu Install - No Wifi Networks Discoverable

[   15.857605] iwlwifi 0000:02:00.0: Direct firmware load for iwlwifi-8000C-24.ucode failed with error -2
[   15.857612] iwlwifi 0000:02:00.0: Direct firmware load for iwlwifi-8000C-23.ucode failed with error -2
[   15.857618] iwlwifi 0000:02:00.0: Direct firmware load for iwlwifi-8000C-22.ucode failed with error -2
[   15.857619] iwlwifi 0000:02:00.0: no suitable firmware found!

We wonder how and why the appropriate firmware package is not installed. Please try:

sudo apt update
sudo apt install --reinstall linux-firmware

Check:

ls /lib/firmware | grep 8000

We hope you see:

iwlwifi-8000C-13.ucode
iwlwifi-8000C-16.ucode
iwlwifi-8000C-21.ucode
iwlwifi-8000C-22.ucode
iwlwifi-8000C-23.ucode
iwlwifi-8000C-24.ucode
iwlwifi-8000C-27.ucode
iwlwifi-8000C-31.ucode

If so, reboot and your wireless should be working.


Ubuntu 20.04 restarting on its own - how to identify the source of the issue?

The information you provide lead to one suspect. A partially faulty Power Supply Unit that cannot support the total power consumption the devices require. By removing the disks you reduced that consumption.
Another possible reason could be some kind of cable shortcut or bad power cable connection on any of the disks you removed but I think this is less likely.
These malfunctions though cannot be logged because they're very sudden and the system does not actually detect them since it restarts abruptly.


Why is kernel "rescheduling" causing so many wakes-from-idle?

Seems to be normal... at least last time when I tried to hunt down this problem I read somewhere the exact explanation... And as far as I can remember it was not a problem.

Tough you can find a documentation here: Ubuntu help

Also you could run powertop as sudo and look for the C-States. If they are in idle at lowest it should be ok.


Ubuntu 18.04 failed to boot: Faile to start MySQL Community Server

The problem has been solved by rebooting the system in the recovery mode.
To reach the recovery mode in Ubunut 18.04, click the left Shift bottom and Esc. Then you will get options, choose Clean which deletes some unnecessary files that can free up few hundreds of MBs. My main problem was full disk (0 Bytes available).
After that, I could reboot successfully.


the remote .bashrc file is not executed by default when connecting over ssh.

Adding source .bashrc to .bash_profile solved the problem. Still I don't know why it keeps asking for the password.


Cannot get Ubuntu software update to work

The error message says that the repository is not updated, and the previous index files will be used. That means you won't receive updates from that repository, so you should import the public GPG key to fix this issue.

This command updates the key for your specific repository:

sudo apt-key adv --keyserver hkp://pool.sks-keyservers.net:80 --recv-keys D45DF2E8FC91AE7E

If the error happens on more than one repository try this short script:

sudo apt update 2>&1 1>/dev/null | sed -ne 's/.*NO_PUBKEY //p' | while read key; do if ! [[ ${keys[*]} =~ "$key" ]]; then sudo apt-key adv --keyserver hkp://pool.sks-keyservers.net:80 --recv-keys "$key"; keys+=("$key"); fi; done

It searches for all missing keys and updates them.


MySQL version to be used on Ubuntu 10.04

On Ubuntu 10.04.4, the following mysql-server packages are shown as available (apt-cache showpkg mysql-server):

5.1.63-0ubuntu0.10.04.1
5.1.41-3ubuntu12.10
5.1.41-3ubuntu12.7
5.1.41-3ubuntu12

As the version numbers show, the latest is 5.1.63; the 5.1.41-3ubuntu12.10 has nothing to do with Ubuntu 12.10, but is just a numbering coincidence (notice the -12.7 and -12 versions prior to that).
Thus, an up-to-date 10.04.4 system should be running mysql-server 5.1.63. Your production server needs to be updated to 10.04.4, and then an upgrade will install 5.1.63.

Check your /etc/apt/sources.list and make sure that the lucid-updates and lucid-security repositories are included; then run sudo apt-get update before dist-upgrade or upgrade

The current mysql-server versions available for 12.04 LTS are:

5.5.24-0ubuntu0.12.04.1
5.5.22-0ubuntu1
And for the upcoming 12.10 Quantal:

5.5.25-0ubuntu2


Grub Loading error after partition during booting

I might be wrong but it looks like there are 5 headings and 4 columns of data. The missing column would be under Boot. Use a Live CD and take a look here.

http://ubuntuforums.org/showthread.php?t=1489071

Although the table is simple, I'm not familiar with its origin. If no luck, from the terminal type df and post the results back.


This is not gonna be easy, but we can do it. We will stream to Twitch.tv, which can stream to YouTube Live.

Here we go:

Preparing the libraries: Type these commands in Terminal.

sudo apt-get install ffmpeg
sudo apt-get install libx264-dev libavcodec-extra-53

The code required to stream: Open gedit/Text Editor and paste this code: http://shrib.com/ubuntu2twitch

Save the text file as twitch_stream.sh in your /home/ directory.

Obtaining a Twitch Streaming Key: Go to http://www.twitch.tv/broadcast/dashboard/streamkey and get your Streaming key. Open gedit/Text Editor and paste the key into it. Name this file as .twitch_key and save it in your /home/ directory, same as the twitch_stream.sh file.

Going live: Open Terminal and type this:

cd
cd /home/
chmod 755 twitch_stream.sh

If there are no errors, you'll see your screen on the Twitch Dashboard.

Streaming from Twitch to YouTube: Visit http://www.twitch.tv/settings/connections to setup your YouTube account and got to your live feed to share on YouTube. If Twitch does not allow live streaming to YouTube, why not add a screen to your YouTube feed to ask users to go to Twitch?

Please upvote if you think this helped you.

A big thank you to The Game Engine for the code.

UPDATE: Got it!!! There you go: http://sourceforge.net/projects/snowmix/ Install Snowmix first.

And then GStreamer: http://gstreamer.freedesktop.org/download/ Search on Ubuntu Software Center for the same.

Now read this guide and set it up. Voila, forget Twitch and stream to YouTube directly! http://sourceforge.net/p/snowmix/wiki/Snowmix%20and%20CDNs/


When I watch a video online the screen turns off after a few minutes

UPDATE 2017/08/23:  Changed script to one that doesn't send keystrokes but disables dpms and the screensaver temporarily while a video is playing full screen.

This only works with applications running full screen, not maximized.

First install xdotool:

sudo apt install xdotool

then I created a scripts folder in my home folder that I could drop any scripts into that I wanted to keep:

mkdir -p ~/scripts

then I created a file called check_full.bsh in my ~/scripts folder and added the following content to it:

Since my screensaver is set for 20 minutes, I set the sleep timer in the script to 10 minutes (600 seconds).  You can change this based on your screensaver settings.

#!/bin/bash

#Get DPMS settings
dpms_set=$(xset -q | awk '/DPMS is/ {print $NF}')

#Get screensaver type and command
scrnsvr=$(ps -ef | awk '/screensav/ {print $8}' | grep -v awk)
scrnsvrcmd=$(ps -ef | awk '/screensav/ {print substr($0,index($0,$8))}' | grep -v awk)

#Sleep Timer in seconds.
SL=600

while true;
do
result=()
#Get all window geometries
all=($(xdotool search --name - | while read win; do xdotool getwindowgeometry $win | awk '/Geometry/ {print $2}'; done))

#Get all screen resolutions detected and build array.
SCREENS=($(xrandr | awk '/\*/ {print $1}'))

SCRN=" ${SCREENS[*]} "

#Get result of all windows and match

for item in ${all[@]}; do if [[ $SCRN =~ " $item " ]] ; then result+=($item); fi; done

#If a result exists disable power management and screensaver
if [[ ${result[@]} ]]; then
    ps -ef | grep $scrnsvr | grep -v grep >/dev/null
    if [[ $? == 0 ]]; then
    kill $(ps -ef | grep $scrnsvr | grep -v grep | awk '{print $2}')
    fi
    if [[ $dpms_set == "Enabled" ]];then
    xset -dpms
    fi
else
    ps -ef | grep $scrnsvr | grep -v grep >/dev/null
    if [[ $? == 1 ]]; then
    ${scrnsvrcmd} &
    fi
    if [[ $dpms_set != "Disabled" ]];then
        xset dpms
        fi
fi
result=()
sleep $SL
done

make the script executable:

chmod +x ~/scripts/check_full.bsh

For some reason, a cron job would not run this correctly.  So I added an entry to my startup to call this script.    In the ~/.config/autostart/ folder, I created a file called Check_full.desktop with the following content:

I like to have delays added to startup as they usually load better.

[Desktop Entry]
Type=Application
Name=Check_Full
Comment=Prevent screensaver from activating when full screen video is playing
Exec=bash -c 'sleep 5 && /home/<username>/scripts/check_full.bsh'

change above Exec line to match your home folder.

Set proper permissions to the file:

chmod 664 ~/.config/autostart/Check_full.desktop

After logging out and back in, check_full.bsh is now running and checking every 10 minutes if active application is full screen.  If not, screensaver / lock screen launch at normal times.

Hope this helps!


I'll assume that on your server eth0 is connected to the switch and eth1 is connected to the router.
I'll assume that your LAN network address is 10.1.1.0/255.255.255.0
I'll assume that your router is 192.168.0.1/255.255.255.0

On the NIC connected to the switch, assign an IP address in the same range as the LAN served by your switch. But without gateway definition.
In /etc/network/interfaces :

auto eth0
iface eth0 inet static
   address 10.1.1.1
   netmask 255.255.255.0

On the NIC connected to the router, I see two possibility regarding your own setup :

You assign a fixed IP, in the same range as the one of your router and you set the default gateway toward this router IP.
In this case, you should add this to your /etc/network/interfaces

auto eth1
iface eth1 inet static
    address 192.168.0.2
    netmask 255.255.255.0
    gateway 192.168.0.1

The router is able to assign dynamically an IP to your server (DHCP), then you just have to configure this NIC as a DHCP enabled NIC.
In this case, you should add this to your /etc/network/interfaces

auto eth1
 iface eth1 inet dhcp

The second setup is to be sure that you will be able to route traffic between these two NIC's. To allow this, you will have to adapt the file /etc/sysctl.conf. In this file, uncomment the following line :

  net.ipv4.ip_forward=1

This setting will be activated at the next reboot, if you want to activate it manually without rebooting, you can do the following :

sudo echo 1 | sudo tee /proc/sys/net/ipv4/ip_forward

The third step is to be sure that all the PC of your employees are configured to use 10.1.1.1, the IP of the LAN card connected to the switch as default gateway.

The above steps will help you to setup the network connections of your server, but if you need to enforce restrictions for your employees, you will have to consider the following also :

Using iptables (aka Linux Firewall) to block some traffic you are not allowing to the Internet. Iptables rules can be very complex to manage, so I suggest that you install and try the software called ufw, the Uncomplicated Firewall that will make your life easier with Iptables.
More information about this tools can be found on the Ubuntu Community Help Wiki, among others.
You may also consider to install a Web Proxy server, like Squid. A Web proxy server will allow you to restrict the web sites that can be visited by your employees. Web proxy can also enable authentication, so only known users are allowed to use it. Rules in Squid can be setup in such way that user1 and user2 doesn't have the same restrictions. Have a look to the site of this products for information on how to set it up.
In the Web Browser of each PC, you have to specify the internal IP address of your server (in my example 10.1.1.1) as proxy server.
To be sure that your employees don't go directly to the Internet, bypassing the proxy and its protections, you will have to create firewall rules on the server to block traffic toward port 80 & 443 from the LAN to the Internet.
The setup of Squid can be completed with some addons that retrieve lists of web sites categories to allow blocking more easy. For instance, squidguard can be combined with Squid to retrieve blacklists of web sites to automatically block access to these sites without having to configure each of them manually within the standard Squid configuration. More info there.

All of these three software mentioned above are available from the standard Ubuntu repository, so just doing :

sudo apt-get install ufw squid squidguard

will install the software. You will have to refine their configuration to follow your needs.

Remark :

Making your server a Web Proxy is also possible if your server only have one NIC. Depending of your router type, it may be possible to do all the firewall things in it.
In this case, it will be more easy to do the network setup :

Router IP is the default gateway for any device on the network, PC & server
Router, server and PC's are connected to the same switches
Router, server and PC's are in the same subnet, so if the router is DHCP-capable, it can do the DHCP for the PC's too, and you don't have to bother about the network configuration on each PC
Squid & squidguard can still be installed on your server and used by all PC's.