NGINX not routing to the net core Project (with port other than 80)

This site can’t be reached The connection was reset.

This message was appearing b/c the port 81 was blocked in my organization.

Secondly, the problem can also be resolved by using different server names in the config file. so the default file will become like this

 server {
listen 80;
server_name keywordsapi.test.kfupm.edu.sa;
location / {
    proxy_pass http://localhost:5000;
    proxy_http_version 1.1;
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection keep-alive;
    proxy_set_header Host $host;
    proxy_cache_bypass $http_upgrade;
}
}
server {
listen 80;
server_name keywords.test.kfupm.edu.sa;
location / {
    proxy_pass http://localhost:5050;
    proxy_http_version 1.1;
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection keep-alive;
    proxy_set_header Host $host;
    proxy_cache_bypass $http_upgrade;
}
}


Ubuntu 20.04 show date/time/volume on every screen

For a solution based on an official package: make sure that you have "Universe" enabled in your repositories:
sudo add-apt-repository universe

and that you're using the GNOME desktop or a derivative.
Search Synaptic (or via apt) for the package:

gnome-shell-extension-multi-monitors

Install it, along with the GNOME tweak tool (package "gnome-tweaks", not "gnome-tweak-tool" - the latter is to access some additional settings):
sudo apt-get install gnome-shell-extension-multi-monitors gnome-tweaks

You’ll have to log out and back in (sometimes just reboot your system). After that, search for the Tweak Tool in GNOME menu and launch it. Select "Extensions" on the left-hand side, and scroll till you see multi-monitors-add-on. Activate the slider.
You should see a dual monitor symbol on your taskbar. Click it and select "Preferences". This prefs page will let you tweak all sorts of options... including "Show panel on additional monitors", which is the setting that you are looking for.


Can I create a bootable Windows 7 installation USB from within Ubuntu to boot a 2010 model iMac?

Booting Windows 7 in EFI mode on a Mac is tricky at best. (Note UEFI is EFI 2.x, but Macs' EFIs are all 1.x versions, so Macs technically don't have UEFIs.) There's a very long thread on MacRumors about this subject:

http://forums.macrumors.com/threads/win7-x64-booting-natively-via-efi-no-bios-emulation.696523/

To boil this thread down, some people have successfully installed and booted Windows 7 on some Macs in EFI mode. The procedures for doing so are often convoluted, and most people who attempt it fail. At least, that's my impression from the last time I reviewed it, which was over a year ago. Perhaps somebody's made a breakthrough since then.

Windows 8 is much easier to get working on Macs in EFI mode, but even it doesn't always works. I haven't been keeping track of details of which models work best in EFI mode.

Dual- or triple-booting Windows 7 on a Mac is most easily done in BIOS mode. In fact, given a Windows/Linux dual-boot on a Mac (with no OS X), by far the easiest solution is to boot both OSes in BIOS mode. If you were starting from scratch, I'd say to create an MBR partition table, boot Windows 7 in BIOS mode, install it, and then boot and install Ubuntu in BIOS mode. Maintaining an EFI-mode boot on a Mac without OS X poses some challenges because Apple has deviated from the usual EFI boot procedures, so tools like Ubuntu's efibootmgr may not work quite right; you really need OS X's bless utility to properly manage the EFI boot process. Going with a strictly BIOS-mode setup bypasses these problems.


How can I change the default music player?

Right-click an MP3 file, and from the menu select “Properties”.

In the window that appears, go to the “Open With” tab and select VLC. Click the “Set As Default” button to set VLC as the default player.

You might also want to set the default player in the sound menu:

How do I change the Sound Menu's default music player?


Remote into Ubuntu Server 14.04 with GUI

You can use vnc for gui access to server.

Install the VNC-server

sudo apt-get install vnc4server

Please make sure that you are using only vnc-server & no other VNC-server are installed as this could give errors in future mostly that clipboard sharing between the host Ubuntu Server & vnc-client machine. You can check it as follows:

xxx@yyy ~ $ sudo dpkg -l | grep vnc
ii  vnc4server                                            4.1.1+xorg4.3.0-37ubuntu5                           amd64        Virtual network computing server software
xxx@yyy ~ $

Please uninstall if tightvnc or anything similar installed. Adding VNC user

In my case I am using user=sssss it will differ in your case. You can use any username for the same.

adduser sssss

xxx@server1:~$ sudo adduser sssss
Adding user `sssss' ...
Adding new group `sssss' (1001) ...
Adding new group `sssss' (1001) ...
Adding new user `sssss' (1001) with group `sssss' ...
Creating home directory `/home/sssss' ...
Copying files from `/etc/skel' ...

Enter new UNIX password: <--yourpassword
Retype new UNIX password: <--yourpassword
passwd: password updated successfully
Changing the user information for sssss
Enter the new value, or press ENTER for the default
    Full Name []: <--ENTER
    Room Number []: <--ENTER
    Work Phone []:<--ENTER
    Home Phone []:<--ENTER
    Other []:<--ENTER

  Is the information correct? [Y/n]<--ENTER

Start the vncserver with the user, for this use:

su - srijan
vncserver

It will see:

    sssss@server1:~$ vncserver

You will require a password to access your desktops.

Password:<--Put your VNC password
Verify:<--Put your VNC password
Password too long - only the first 8 characters will be used
xauth:  file /home/sssss/.Xauthority does not exist

New 'server1:1 (sssss)' desktop is server1:1

Creating default startup script /home/sssss/.vnc/xstartup
Starting applications specified in /home/sssss/.vnc/xstartup
Log file is /home/sssss/.vnc/server1:1.log

    sssss@server1:~$

Make backup of the original file & then make the configuration

cp ~/.vnc/xstartup ~/.vnc/xstartup.bak > ~/.vnc/xstartup
vi ~/.vnc/xstartup

#!/bin/sh
unset SESSION_MANAGER
unset DBUS_SESSION_BUS_ADDRESS
startxfce4 &

[ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup
[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
xsetroot -solid grey
vncconfig -iconic &

Make the startup script for the vncserver

sudo vi /etc/init.d/vncserver

#!/bin/bash

unset VNCSERVERARGS
VNCSERVERS=""
[ -f /etc/vncserver/vncservers.conf ] && . /etc/vncserver/vncservers.conf
prog=$"VNC server"
start() {
 . /lib/lsb/init-functions
 REQ_USER=$2
 echo -n $"Starting $prog: "
 ulimit -S -c 0 >/dev/null 2>&1
 RETVAL=0
 for display in ${VNCSERVERS}
 do
 export USER="${display##*:}"
 if test -z "${REQ_USER}" -o "${REQ_USER}" == ${USER} ; then
 echo -n "${display} "
 unset BASH_ENV ENV
 DISP="${display%%:*}"
 export VNCUSERARGS="${VNCSERVERARGS[${DISP}]}"
 su ${USER} -c "cd ~${USER} && [ -f .vnc/passwd ] && vncserver :${DISP} ${VNCUSERARGS}"
 fi
 done
}
stop() {
 . /lib/lsb/init-functions
 REQ_USER=$2
 echo -n $"Shutting down VNCServer: "
 for display in ${VNCSERVERS}
 do
 export USER="${display##*:}"
 if test -z "${REQ_USER}" -o "${REQ_USER}" == ${USER} ; then
 echo -n "${display} "
 unset BASH_ENV ENV
 export USER="${display##*:}"
 su ${USER} -c "vncserver -kill :${display%%:*}" >/dev/null 2>&1
 fi
 done
 echo -e "\n"
 echo "VNCServer Stopped"
}
case "$1" in
start)
start $@
;;
stop)
stop $@
;;
restart|reload)
stop $@
sleep 3
start $@
;;
condrestart)
if [ -f /var/lock/subsys/vncserver ]; then
stop $@
sleep 3
start $@
fi
;;
status)
status Xvnc
;;
*)
echo $"Usage: $0 {start|stop|restart|condrestart|status}"
exit 1
esac

Make it executable:

chmod +x /etc/init.d/vncserver

Make the configuration file for the vncserver by creating file as follows:

mkdir -p /etc/vncserver
vi /etc/vncserver/vncservers.conf

Give the entries like this.

VNCSERVERS="1:sssss"
VNCSERVERARGS[1]="-geometry 1024x768"

Add it into boot startups:

update-rc.d vncserver defaults 99

xxx@server1:~$ sudo update-rc.d vncserver defaults 99
 Adding system startup for /etc/init.d/vncserver ...
   /etc/rc0.d/K99vncserver -> ../init.d/vncserver
   /etc/rc1.d/K99vncserver -> ../init.d/vncserver
   /etc/rc6.d/K99vncserver -> ../init.d/vncserver
   /etc/rc2.d/S99vncserver -> ../init.d/vncserver
   /etc/rc3.d/S99vncserver -> ../init.d/vncserver
   /etc/rc4.d/S99vncserver -> ../init.d/vncserver
   /etc/rc5.d/S99vncserver -> ../init.d/vncserver
xxx@server1:~$

Reboot the machine.

To access server you can use any  VNC/Clients Application.


If you click on the WiFi indicator and select Connect to Hidden WiFi Network

enter the Network name,
select the WiFi security
and enter your password

Then, when you press Connect it may, if you are lucky, connect


First trying this ->

sudo apt-get update
sudo apt-get -f install

If it doesn't fix the problem, try removing the package with

sudo dpkg -r ttf-mscorefonts-installer

Hope it will help.


Confirm Hyper-V Integration Services are Running

Finally figured it out as I'm back to using Hyper-V for work.

root@openproject:~# systemctl status hv-fcopy-daemon.service
● hv-fcopy-daemon.service - Hyper-V File Copy Protocol Daemon
   Loaded: loaded (/lib/systemd/system/hv-fcopy-daemon.service; enabled; vendor preset: enabled)
   Active: active (running) since Fri 2020-02-14 17:27:44 UTC; 6min ago
 Main PID: 1249 (hv_fcopy_daemon)
    Tasks: 1 (limit: 2224)
   CGroup: /system.slice/hv-fcopy-daemon.service
           └─1249 /usr/lib/linux-tools/5.0.0-1031-azure/hv_fcopy_daemon -n

Feb 14 17:27:44 openproject systemd[1]: Started Hyper-V File Copy Protocol Daemon.
Feb 14 17:27:44 openproject HV_FCOPY[1249]: starting; pid is:1249
Feb 14 17:27:44 openproject HV_FCOPY[1249]: kernel module version: 1
root@openproject:~# ps -u root | grep fcopy
  1249 ?        00:00:00 hv_fcopy_daemon
root@openproject:~# ps -u root | grep hv
    31 ?        00:00:00 hv_vmbus_con
    32 ?        00:00:00 hv_pri_chan
    33 ?        00:00:00 hv_sub_chan
   511 ?        00:00:00 hv_balloon
   526 ?        00:00:00 hv_kvp_daemon
  1249 ?        00:00:00 hv_fcopy_daemon
  1260 ?        00:00:00 hv_vss_daemon

Note: on older systems you may need to use ps -u root | grep hyper

Note: These are all the process in a list that I found

hv_vmbus_con
hv_pri_chan
hv_sub_chan
hv_balloon
hv_kvp_daemon
hv_vss_daemon
hv_fcopy_daemon


Monitor configured outside of supported operating frequencies

What you describe in your question at first seemed similliar to the problem in the question linked below.
Error message "Signal out of range 92KHz - 58Hz " when starting Ubuntu. What is wrong and how can I fix it?

The main difference seems to be in the situation described in that question Ubuntu would successfully start, but apparently this does not happen for you?

Have you installed Ubuntu? If so, how did you do the install? (I am wondering why you did not also have this problem when you booted a Live CD or USB)


Where is the transmission-daemon torrent list stored?

This data is stored in /var/lib/transmission-daemon/info (requires root access to view, use sudo from the command line or install nautilus-gksu).

In my case depressingly empty.


Desktop in Kubuntu lacks bars and quite everything after trying to apply Plymouth fix for proprietary drivers

I am not sure if this will fix it, but ...

sudo apt-get purge v86d

As root, edit /etc/initramfs-tools/modules and remove the line "uvesafb mode_option=$resolution mtrr=3 scroll=ywrap"

As root, edit /etc/initramfs-tools/conf.d/splash and remove the line "echo FRAMEBUFFER=y"

Then run

sudo update-initramfs -u
sudo update-grub2

That might fix the problem, assuming you purged and re-installed grub2 (looks if all the other files edited were grub files).


Why doesn't my second cron task get run?

I guess this is pretty obvious but just to exclude this type of error I have to ask it.
Does the second crontab really look like:22 20 * * * python /root/vine/hello.py (to run everyday at 20:22).If so then remove the part in braces because that's wrong or put a # in front of that part which makes it a comment.


VirtualBox running Ubuntu 14.04, after update and reboot can't change size and other problems

Update guest additions in the VM. If your guest is running ubuntu:

  sudo /media/$user/$vboxversion/VBoxLinuxAdditions.run


I had the same issue.  Steam worked after running:

sudo apt install libnvidia-gl-390:i386


Is the monitor refresh rate.
   With me it happened in any video, that was in the browser or Totem, VLC etc.
    Under Settings go to Devices > Monitors > Resolution. click to change. At this point there is the resolution chosen by the system and just below the same resolution. choose the second option and the Update Rate will appear. Choose the one from your monitor if not already ... 60Hz, 120Hz etc. Do the test.


Use sed to replace the last space in each line with a comma, then remove all spaces

Something like:

sed -r 's/(.*) /\1,/; s/ //g'

The first substitution, being greedy, will cover all but the last space in the group, replacing the last with a ,. The second will then eliminate the rest.


Disable Secure Boot in BIOS, connect to the Internet using your phone and run in a terminal

sudo apt update
sudo apt install bcmwl-kernel-source

That will install the driver.


How do I install the Epson L220 printer driver on Ubuntu 14.04 LTS?

You need to install the drivers for the printer. This can be found on the Epson website.
Please go to:

Epson Linux Printer Search or Epson Linux Driver Support.
Search for the Epson L220 printer.

Click on the download link.

Click on the accept link at the bottom of the page to say you agree to the terms.

Click on the download button for your distro

You will need the files that end with amd64.deb

Make sure you do this for all the files available in step 3 above.

Install the .deb package files with your favourite package manager, e. g. GDebi or Software Center (Ubuntu 16.04 or later only) or on the command-line:
sudo dpkg -i /path/to/pacakge.deb ...
sudo apt install -f

As a side note, the best way to find if a printer is compatible is to search OpenPrinting.org. I found the Epson L220 printer there, and saw that it was compatible. I then searched for the recommended driver on Google which pointed me to the Epson Linux Driver website.


Not able to play .avi files with VLC media player on Ubuntu Mate on Raspberry pi2

Make sure you have proper codecs installed with:

sudo apt-get install ubuntu-restricted-extras

Hardware accelerated video with VLC and ffmpeg
Ubuntu MATE 16.04 added OpemMAX IL hardware accelerated video playback to VLC and MMAL hardware accelerated video playback to ffmpeg.

To enable hardware accelerated video playback in VLC go to Tools -> Preferences -> Video and select OpenMax IL.
To use hardware accelerated video playback with ffplay you must specify the h264_mmal codec.

ffplay -vcodec h264_mmal video.mp4

Hardware accelerated playback on the Raspberry Pi works by overlaying the video directly to the screen. Therefore there are no onscreen controls for playback control. You’ll need to use the VLC and ffmpeg keyboard shortcuts.

  SOURCE: https://ubuntu-mate.org/raspberry-pi/

Also some people recommends to use omxplayer for accelerated video playback on Raspberry pi x.


I'm getting an error with nginx, php and wordpress - 502 Bad Gateway

This is probably a problem with RAM. If you look on your wordpress hosts, they're likely running out of RAM quite quickly, and probably spraying 'out of memory' errors in dmesg. Thats because the default tuning setting of single does include a lot of plugins.

If you run juju set wp-service-name tuning=bare it will use less RAM and it might be able to survive on a t1.micro. If that still doesn't work, I'd recommend filing a bug against the charm here:

https://launchpad.net/charms/+source/wordpress/+filebug

And perhaps look into patching it to allow reducing the number of php5-fpm processes running or other things to save RAM in such a hyper-constrained environment.


Black screen after installing vboxvideo module on guest Kubuntu 17.04

If you press ALT+F2, does the searchbar come up? Can you switch to the terminal with CTRL+ALT+F1 and back with CTRL+ALT+F7?
I've had this problem multiple times with Kubuntu where the plasma crashes and you can't get your actual desktop or widgets to show up. I've heard deleting caches or uninstalling plasma sometimes fixes the problem. But I've been best off with fresh installing the whole operating system.

I'd recommend switching to KDE Neon. It's essentially the same as Kubuntu except this distro uses the LTS version of Ubuntu such that KDE applications are more stable.


How to make a fuse-filesystem appear on /media/$USER without root or changing fstab?

I just found out that although it's not possible to make udisksctl explicitly recognize a mount, it happens anyway, making nautilus recognize it, if you mounted on a visible user folder

My whole problem was that my previous attempt was on .cache/ before i tried to change it to /media/$USER and hitting this. I tried it on $HOME/Desktop later and it appears on nautilus. So it works.


Cant boot up from an external source anymore , please help.....(Totally a different sceenario from the usual cases )

Since part of Ubuntu (specifically the piece of the boot loader that resides in the master boot record) still exists on the disk, I believe your computer's UEFI firmware ("BIOS") is still trying to boot from it.

Unlike when the disk is truly blank, your computer does not automatically boot from an attached USB device, even if the USB device is bootable. But you should still be able to boot from it, through your "BIOS" boot menu. Most computers' firmware has a boot menu that can be accessed by pressing or holding a particular key while starting up your computer. Another key will enter the firmware setup utility itself; the default boot order can be changed there.

Often F12 is the key to access the "BIOS" boot menu and F2 enters the "BIOS" setup. This is the case for most Dell computers, and some others with similar firmware. I don't know what current Packard Bell machines use. You can likely find this by searching, or just try all the common keys. The common ones are Escape, Delete, and the twelve function keys.

If you are able to select the USB flash drive to boot from but it still will not boot, then further troubleshooting will be required:

Can you write an Ubuntu desktop ISO to a USB flash drive and boot from that?
(If so, the problem relates to the Windows ISO, flash drive, or the way it was written.)
How did you write the Windows ISO to the USB flash drive? Note that, unlike an Ubuntu ISO image, a Windows ISO image is not designed to work "out of the box" when written to a USB flash drive; additional data, to make the USB flash drive bootable, must be written.

See How can I create a Windows bootable USB stick using Ubuntu?

Since you have no working operating system, if it turns out you also have no working bootable media, you may need to use a different computer to create such media.


Gnome - Cannot click between windows or click on UI elements with Mad Catz R.A.T. 3 mouse

So after doing some more research, I stumbled upon a thread with the same question. It turned out to be a problem with my Mad Catz R.A.T. 3 mouse. I didn't realise that i didn't have any drivers for it. Here's how you can fix this issue.

Write this section to /etc/X11/xorg.conf:

Section "InputClass"    Identifier "Mouse Remap"
    MatchProduct "Madcatz Mad Catz R.A.T.3 Mouse"
    MatchDevicePath "/dev/input/event*"
    Option "ButtonMapping" "1 2 3 4 5 6 7 8 0 0 0 0 0 0 0 0 0 0 0"
EndSection

PS: Here's a link to ArchWiki. It has all the information you need to set up your mad catz mouse.


Try

sudo tar acvf /home/john/Desktop/KS_UserFolders.tar.gz \
  --exclude='*.m4v' \
  --exclude='*.m4a' \
  --exclude='*.mp3' media/john/OS/Users/

Note that the archive file name must come right after the f option (without a -), and the --exclude options need two dashes.

If you want it all on one line, it would be

sudo tar acvf /home/john/Desktop/KS_UserFolders.tar.gz --exclude='*.m4v' --exclude='*.m4a' --exclude='*.mp3' media/john/OS/Users/


.eclipse shows that the folder was hidden.Go inside /home/bensalem via nautilus and then press ctrl+h to see the hidden .eclipse directory.

OR

Run the below command on terminalctrl+alt+t to directly view the log file,

gedit /home/bensalem/.eclipse/org.eclipse.platform_3.7.0_155965261/configuration/1388736884438.log


gconftool2 settings aren't saved permanently

gconftool-2 --dump /|grep show_label

is there any result?


Is there a manual "scan for Wifi networks now" in Network-Manager?

Networks are re-checked automatically. You do not need to press anything. You can wait for some seconds to see a new network.

To re-check immidiately you do not need to restart Network Manager. You can click "Disable Wi-Fi" and "Enable Wi-Fi", if you are so impatient.


Killer Bluetooth and wifi not working with Bionic Beaver 18.04

Quite an old post but I'm struggling with this network card (1435) too and can only advise people with the same card to change it if possible. It has very bad performances on Linux. The driver can be found at https://github.com/kvalo/ath10k-firmware in the QCA6174 folder. There are many firmwares to try out. I could not find one that doesn't crash or has good performance uploading files. The upload with this card is really slow. Really slow!

To load the module in the command line I have to:

sudo modprobe ath10k_pci
sudo modprobe ath10k_core

Although this is not an ideal solution, this will load the driver. I thought it might be helpful to someone having problems with this network card.


According to the documentation:

  Renewing the Installation without
  formating the partitons (in contrast
  to upgrading), will also keep the
  personal data and configurations under
  /home but will renew all system
  settings under /etc as well as the
  default set of installed packages.

However, it is impossible to upgrade from 8.10 directly to 10.04. You would need to upgrade to 9.04, then 9.10, and then finally 10.04. This can be a long and painstaking process, so in your case I would recommend doing a new install over your existing install, which will not format your drive. (More detail here). The installer will preserve the data in your home directory but do an install over the rest of the system.

As always with every upgrade please make sure you backup your important data.


how to configure usb to hdmi in ubuntu 18?

The security maintenance of Ubuntu 14.04 has been extended for an additional 3 years of extended security maintenance (ESM) until April, 2022. Anyone can use Ubuntu Advantage Infrastructure Essential which includes Ubuntu 14.04 ESM for free for personal use on up to 3 machines (limitations apply). All you need is an Ubuntu One account.

Then you can install the Fresco Logic FL2000 Linux/Android Kernel driver for your Fresno Logic USB to HDMI device in Ubuntu 14.04.


Problems with grub finding windows. Windows 7 / Ubuntu 14.04

First, disk device filenames (/dev/sda, etc.) are subject to change. They can change because you physically move disks around, because you plug in additional disks (even external devices), because of changes in the way drivers load, because of changes in firmware settings, or even randomly (typically because two drivers may be competing to load first, and which one succeeds varies from boot to boot). Thus, don't get too attached to your device filenames or rely on them.

Second, your boot configuration is unclear and complex. Using the device identifiers in your Boot Info Script output:

/dev/sda uses GPT and has an EFI System Partition (ESP), which in theory holds EFI boot loaders. I say "in theory" because the Boot Info Script didn't find any boot loader files on your ESP. OTOH, sometimes the Boot Info Script misses things, so they may be there. Also, efibootmgr found an entry for an Ubuntu GRUB in the firmware's NVRAM, so clearly at one point you had installed Ubuntu in EFI mode. It's not clear if that entry still works, but it does exist.
/dev/sdb uses MBR and has two NTFS volumes with Windows boot files. It therefore appears as if the computer is set up to boot Windows in BIOS mode. This would not get along too well with an EFI-mode Linux boot, although there are ways to get the two to coexist.
/dev/sdc uses MBR, but with a Windows Logical Disk Manager (LDM) configuration layered on top of that. You should NOT attempt to access your /dev/sdc* partitions directly in Ubuntu, much less install Ubuntu on that disk. If necessary, you may be able to access that disk via device files in the /dev/mapper directory. If you need to do more than that, you must convert from LDM to plain MBR partitions. You can do this with various third-party Windows partitioning tools. To make matters more twisted, you've got GRUB installed in the MBR of /dev/sdc.

Two ways to cut through this mess occur to me:

Method 1:

Physically unplug /dev/sdb and /dev/sdc.
Boot an Ubuntu live CD or live USB.
Use GParted, parted, or gdisk to create a new BIOS Boot Partition on /dev/sda (your GPT disk).
Install GRUB to /dev/sda. In principle, you should be able to use Boot Repair to do this if you like. Note, however, that if you run Boot Repair in EFI mode, it may try to install the EFI version of GRUB, which you do not want. Check for a directory called /sys/firmware/efi to determine your boot mode; if it's present, you've booted in EFI mode and if it's absent you've booted in BIOS mode. If you're in the wrong mode, you'll need to reboot and select the right boot option in your firmware's boot manager or reconfigure the firmware to not support EFI-mode booting. (Details vary greatly from one machine to another, I'm afraid.)
Shut down the computer and re-attach the other two disks.
Boot to Linux using the GRUB you've just installed. (You may need to adjust the default boot order in your firmware.)
Run update-grub. This should cause it to detect your Windows installation and enable you to boot Windows from GRUB the next time you reboot.

This method has the advantage of keeping everything booting in a single mode (BIOS/CSM/legacy). That boot mode is better understood by the community as a whole than is EFI-mode booting. OTOH, you'll be messing with your disk and boot loader configuration with no guarantee that the changes will actually work, so you could end up making matters worse.

Method 2:

Download the USB flash drive version of my rEFInd boot manager.
Prepare a USB flash drive with rEFInd.
Mount the USB flash drive and edit the EFI/BOOT/refind.conf file it contains: Uncomment the scanfor line and ensure that hdbios is among the options. You might also need to uncomment the uefi_deep_legacy_scan option, although I recommend leaving that as-is for now and use it only if you can't boot Windows in a couple of steps.
If necessary, reconfigure your computer's firmware to enable EFI-mode booting. You may also need to disable a "fast boot" option. (It might already be set up this way.)
Boot to the rEFInd USB flash drive. With luck, it will show you options to boot Ubuntu and one to three more with gray diamond-shaped icons to boot in BIOS mode. One of those should boot Windows. Test to be sure you can boot both Ubuntu and Windows.
If all this works, install rEFInd to your hard disk by booting Linux via rEFInd (and not via one of the gray diamond legacy options) and installing the Debian package or PPA version noted on the downloads page. You'll need to edit /boot/efi/EFI/refind/refind.conf as you did earlier on the USB flash drive. If you've got too many options in rEFInd, you can use dont_scan_volumes or dont_scan_files to remove redundant options from the menu.

This approach has the advantage that you won't make any changes to your permanent configuration until you've fully tested it via the USB boot of rEFInd, so there's very little risk of making matters worse. It assumes that your computer is EFI-capable and that it provides a CSM, though. It also assumes that your Windows boot loader is intact on /dev/sdb. (Boot Info Script says it's there, but whether it works or not is another matter.)


How to become Super User in a guest-session?

You cannot. Using sudo was one of the things that Guest sessions cannot do, by design.


Mounting CIFS Share per User using AutoFS

You can use variables in autofs which may be a solution to your requirement. Everybody has their own way of doing autofs and this is mine. I just did this on Ubuntu 18.04 primarily to see if it still works at this release:

I edited /etc/auto.master and as the last line added:

/mnt/Samba /etc/auto.sambashares --timeout=30 --ghost

I purposely made the parent folder /mnt/Samba and not something under /media or the home directory because it results in mass confusion by the OS.

I edited /etc/auto.sambashares and added one line using the ${HOME} and in my case the ${UID} variables:

GroupShare -fstype=cifs,rw,credentials=${HOME}/.cifs_credentials,uid=${UID},iocharset=utf8 ://server/share

Then restarted the autofs service.

When usera accesses /mnt/Samba/GroupShare ( which can be bookmarked ) his credentials at /home/usera/.cifs_credentials will be used to access the share and userb will use his own credentials in his own home directory.

Alternate Method for Concurrent Users:

** Create a parent folder under /mnt for each user - example: /mnt/bob and /mnt/mary.

** Change ownership to each user ( i.e., sudo chown bob /mnt/bob )

** Limit access only to that user ( sudo chmod 0770 /mnt/bob )

** Replace the one line in auto.master to two:

/mnt/bob/Samba /etc/auto.sambashares-bob --timeout=30 --ghost
/mnt/mary/Samba /etc/auto.sambashares-mary --timeout=30 --ghost

** Then create the two auto.sambashares-xxx files each having the same line:

GroupShare -fstype=cifs,rw,credentials=${HOME}/.cifs_credentials,uid=${UID},iocharset=utf8 ://server/share


If it is a matter of package that was uninstalled you can run this at terminal:

sudo apt-get install ubuntu-desktop


Unable to boot 14.04 on new Alienware 17

Try the solution I found and wrote about in this thread:

Ubuntu 12.10 failing to install on Alienware M17x

The key (for me and my Alienware M18x R2) was setting the vga and nomodeset options before selecting a menu option. I too was installing Ubuntu 14 from DVD. Note that after you press a menu ("Try Ubuntu..." for example) the next screen should be this one with the progress dots:

If you see this screen its time for your happy dance because you will be able to see the rest of the installation!

Note: there are times after this progress screen where the screen goes black even for many seconds. Do not fret, it WILL eventually get you to Ubuntu. The DVD is chugging away loading junk into memory so it will eventually get there. Have patience.


use like :

find /var/log -type f -size -10M -size +1M -exec ls {} \; > result.txt

It will store files name that have size more than 1Mb and less than 10Mb.

cat result.txt
/var/log/wtmp
/var/log/audit/audit.log.1
/var/log/audit/audit.log
/var/log/anaconda/journal.log
/var/log/mongo/mongod-11.0.0.11.log

If you pass as input parameters then use like:

find /var/log -type f -size -"$1"M -size +"$2"M -exec ls {} \; > result.txt

Below are the available units for size.

  -size n[cwbkMG]
          File uses n units of space, rounding up.  The following
          suffixes can be used:

          `b'    for 512-byte blocks (this is the default if no suffix
                 is used)

          `c'    for bytes

          `w'    for two-byte words

          `k'    for Kibibytes (KiB, units of 1024 bytes)

          `M'    for Mebibytes (MiB, units of 1024 * 1024 = 1048576
                 bytes)

          `G'    for Gibibytes (GiB, units of 1024 * 1024 * 1024 =
                 1073741824 bytes)


How to modify a group to have the same GID as another group?

From man groupmod:

  The value of GID must be a non-negative decimal integer. This value must be unique,
             unless the -o option is used.

So all you have to do is to add the -o-option to your command, you will also need root-privileges to run the command:

sudo groupmod -o -g 27 myGroup

I don't know why you want to do this and I can't tell you what the side-effects of doing so are. For me this sounds a bit scary, but you might have a good reason.


Cannot update with 'sudo apt-get update' or update manager

Those mirror.picosecond.org links seems unrelated to the Tor instructions on their website.
Please open the /etc/apt/sources.list file and post here any row containing mirror.picosecond.org.

gedit /etc/apt/sources.list

Probably you have activated a "commercial" section which does not exists in that repository. In that case, remove that line.
For example, comment it by adding a # at the beginning of the line:

#deb http://mirror.picosecond.org/ubuntu precise commercial


Why is my screen flickering on my fresh ubuntu install (possible graphics driver issue)?

really new hardware requires newer software -> use 16.10
it seems an issue related to PSR (panel self-refresh), try disable it -> https://wiki.archlinux.org/index.php/Intel_graphics#Screen_flickering
since the issue seems video-related and you are using integrated one (intel), try to disable other features, such as power-saving one, if enabled by default -> https://wiki.archlinux.org/index.php/Intel_graphics


Here's a simple Python script:

#!/usr/bin/python

import ftplib

host = '127.0.0.1'
dir = '001'
filename = 'mdfile.d.z'

# connect

ftp = ftplib.FTP(host)

# login - anonymous by default
# use ftp.login("username", "password") if no anon access

ftp.login()

# change to desired dir

ftp.cwd(dir)

# fetch the file, and copy it to a file of the
# same name in the local pwd

with open(filename, 'wb') as local_file:
    ftp.retrbinary("RETR {}".format(filename), local_file.write)


What is the technical reason preventing a simple upgrade (non-destructive) from 32 to 64-bit?

A migration can be done: Migrate a 32-bit debian installation to 64-bit one (i386 to x86_64) but it will not be a one click operation.
If you re-install using the 64-bit installer and do NOT format the discs you will end up with a 64-bit machine where all (but maybe not all: it will sort of upgrade to newer versions so if there is no newer version ... so it probably is best to do this with a newer release) packages are replaces but the setting files are kept intact.

See https://superuser.com/questions/129222/upgrade-ubuntu-from-32-to-64-bit-edition (answer by user swcai).

Both methods work but are not newbie friendly. Heck they are not even average user friendly.
Re-installing is easier, more secure since it is a proven method and makes sure you do not end up with an unstable system (for what ever reason).

--Warning--

Changing the architecture of your Ubuntu installation from 32 to 64-bit is not recommended or supported in any way. Perform this at your own risk after creating a suitable backup.


Well, I fixed it. I installed redshift like @Terrance suggested, but it didn't work because it needed location services, which I had disabled.

So I turned those on and immediately the screen yellowed. I assumed that was Redshift working so I've uninstalled it, and turned the Nightlight on and off but  it still works...

So, either turning on location services, or installing and then uninstalling Redshift worked... I've now turned location services off again but it's still working.


Is it possible to install and run Thunar 1.5.1 in Lubuntu 12.04?

After several discussions in the comments, it was shown that the essentials of my first comment was correct and installing xubuntu-desktop and then the PPAs and then upgrading enabled Thunar to be installed and available in Lubuntu, and not just for the Xfce session.

Firstly, the ppas are designed for Xubuntu 12.04, as noted at Launchpad, so it may be easier to install Xubuntu-desktop and then upgrade that:

sudo apt-get install xubuntu-desktop

If you wish to get the very minimum amount of packages you could use the --no-install-recommends flag after xubuntu-desktop.

As noted at Launchpad, it is important to note that on 12.04 both the Xfce 4.10 ppa and the Xfce 4.12 ppa needs to be installed.

Install the 4.10 ppa first with

sudo add-apt-repository ppa:xubuntu-dev/xfce-4.10
sudo apt-get update
sudo apt-get upgrade

Then logout and login again (in your normal Lubuntu session) and install the next PPA with

sudo add-apt-repository ppa:xubuntu-dev/xfce-4.12
sudo apt-get update
sudo apt-get upgrade

Now logout and login again (in your normal Lubuntu session) and Thunar will be able to be used in a normal Lubuntu session and not just in an Xfce session.

This article and this one contain information for updating a full Xubuntu 12.04 LTS install and may also be useful, but, as I have shown, the steps are different in Lubuntu 12.04.


Error 1962: no operating system found after installing 12.04 (Lenovo ThinkCentre)

Ok...this took a lot longer than it should. But here it goes:

Installing 12.04 on a 64 bit system that supports UEFI booting like the thinkcentere will create three partitions on the system: a FAT partition for EFI, the ext4 partition for ubuntu and some swap. However, restarting the machine, I was not able to boot at all. Initially, the Intel Boot agent would kick in and try to boot from the network. Even if you turn that off, as indicated later, it still doesn't boot. It says no operating system found.

Now here are the things I tried that didn't work for me:

Change the SATA controller type to IDE Using a boot repair disk (it
doesn't know how to handle EFI with GPT partitioning)
Changing the order of the boot sequence to put HDD first
Changing the boot mode from UEFI, to Legacy or to Auto
Recompiling GRUB2 and putting it in the UEFI paritition, as indicated here:https://help.ubuntu.com/community/UEFIBooting

The first good direction I got was from this thread:http://ubuntuforums.org/showthread.php?t=1896052  People were having problems with earlier versions of Ubuntu. One of the suggested solutions is to install 10.04 first, and update from there.

What this really does is forget UEFI altogether, and create just two partions..the ext4 for ubuntu 10.04 and swap. You could then upgrade to ubuntu, which keeps the same partitioning. A couple things to note...mind your architectures, since this particular machines support 64 bit or 32 bit, so the 10.04 you install first should have the architecture you intend to keep. Also, your network card will likely not work on the 10.04 kernel, so you will have to upgrade from the cd by installing the alternate iso. Follow these instructions: https://help.ubuntu.com/community/PreciseUpgrades#Upgrading_Using_the_Alternate_CD.2BAC8-DVD .

What I did instead was, First installed 10.04, then install ubuntu 12.04 again, but go to 'do something else' on the partitioning page...and i simply chose to reformat the main ubuntu parition and leave the swap as is (mind you, after 10.04 you probably have only those two partions on the HDD you installed the ubuntu on). [in retrospect, I could just have created those partions without installing 10.04, it seems]

Once installation is done,  I restarted, but was greeted with an error "invalid arch independent ELF magic". Looking this up indicated that grub was probably from a previous version of ubuntu,and needs to be installed again. I had to boot from the liveCD/USB again, and reinstall grub2 (you can follow these steps:https://help.ubuntu.com/community/Grub2/Installing#Reinstall_from_the_LiveCD)

Alright, now restart again. It should boot, but I got some errors at the begining which said "no suitable mode found" and "no graphics mode found". Apparently, this is something simple that has to do with fonts. Found this bug report https://bugs.launchpad.net/ubuntu/+source/grub2/+bug/699802 and then used the workaround on comment #24 and viola. Now the system boots into 12.04 with no errors...it is using legacy booting...but it working for now at least.

I believe this can be fixed in the installation process of 12.04, but things are this way for now.


You can access a terminal by striking CTRL+ALT+F1. Then you can make the changes you need there.

You can even restart the lightdm service afterward with

sudo service lightdm restart

Then re-enter your lightdm session by striking CTRL+ALT+F7


I've experienced the same, but it happened when a game froze and I rebooted from the terminal.

The manual workaround is to switch to the text console with Ctrl+Alt+F1 and go back to X11 with Ctrl+Alt+F7. Someone else's answer, but it works for me.


How do I clear everything (data, viruses) from a thumbdrive?

You can use good old Linux tool dd to do this.

To do so:

First open a terminal with pressing Ctrl+Alt+T.
Then type sudo blkid in the terminal.
Very carefully and closely examine the output.

[sudo] password for anwar:
/dev/sda1: UUID="63c6fb01-aac4-4d38-b29e-5a5780a98d12" TYPE="ext4"
/dev/sda2: LABEL="Main" UUID="A80C1BD70C1B9F7E" TYPE="ntfs"
/dev/sda5: LABEL="Work" UUID="01CCB271A80A07E0" TYPE="ntfs"
/dev/sda6: LABEL="Edubuntu" UUID="364126ac-01c9-4dd2-ab19-eecc733a9640" TYPE="ext4"
/dev/sda7: LABEL="Windows" UUID="5A8C72C98C729EE7" TYPE="ntfs"
/dev/sda8: UUID="312d4cd9-21a9-4c0d-aa34-26230e70fa89" TYPE="swap"
/dev/sdb1: UUID="E87F-1D12" TYPE="vfat"

Look at the last line with /dev/sdb1. That is the USB drive which is formatted with Fat (vfat) file system. Note that, the USB drive has only one partition which is named /dev/sdb1. If it had other partitions, they would have been named as /dev/sdb2 ... and so on. The USB drive itself is named /dev/sdb, Note that, it doesn't have a 1, 2 or any number after sdb
Then execute this command to replace all of the data in the USB drive with  0.

sudo dd if=/dev/zero of=/dev/sdX bs=1k count=2048

I intentionally haven't given the original /dev/sdb in the command, so that new users do not accidentally mess up their system. Replace the USB drive name found in step 4 in the above command.

This should give you a clean USB. You need to create at least one partition to use the USB after this operation.

Creating partition on the empty disk

To create a new partition on it, You can use parted program. I'm giving an example of creating a partition in a complete raw disk. Our USB disk is 2GB (~2048) in size. We assume, it's device name is /dev/sdb. You can check your device name with the command sudo lsblk (you have to guess the correct device by looking at size and etc).

First we need to eject the USB after the last command and re-insert it.
Then we need to create a partition table on the disk. We are going to create a partition table of type msdos, sometimes known as Master boot record.

sudo parted /dev/sdb mklabel msdos

Then you are adding an empty "primary" partition, which will hold a Fat file system later.

sudo parted -a none /dev/sdb mkpart  primary fat32 0 2048

We specified the start point (from 0 MB) to the end point (2048 MB), though actually the disk may not have full 2048 MB space, but don't worry, parted will adjust it automatically. Note we are creating a single, primary partition on the whole disk. But you can create multiple partition on it. (Though it is not recommended, because Windows will only recognize the first partition).

This newly created partition will have the id /dev/sdb1
Then finally create a Fat filesystem on the /dev/sdb1 partition by doing formatting.

 mkfs.vfat -n "Disk" /dev/sdb1

We are creating a fat filesystem on /dev/sdb1 partition with the name "Disk".

That's it. You have now a new clean USB disk with a fat partition.

Note, you can also use the Disk-Utility program to create partition and Format it with Fat.

Using Disk-utility

Press Super key and Type "Disk utility" in it.

In the Disk utility window, Select the USB drive in the "Peripheral devices" section.

You may need to unmount the drive first.

Then click on the "format drive" button

Select partition table type from the new window. Select "Master boot record".

After you created the new partition table. The disk utility window will look like this

Click on "Create new partition" button.
Select "Partition type" and optionally type a name for the partition.

The partition will be created within 4-5 seconds and you will have a clean USB disk afterwards.

Using Gparted

First you need to install gparted, if you haven't done so yet. You can install it by clicking this link : gparted  or using this command in a terminal

sudo apt-get install gparted

Then open gparted by typing "gparted" in the dash. To open dash, press Super key which also known as "Windows" key.

Then select the USB device from the drop down menu in right. It should be like /dev/sdb, /dev/sdc etc. Please take special care for not to select /dev/sda, because it is the device your OS is installed. You should only select it, if you know what are you doing.

After selecting the USB device, (which is in my system, /dev/sdb) , see whether any of it's partition is mounted. You can see a key icon in the mounted partition entry and the mount point of that partition.

Unmount any partition mounted partition on that device. To unmount, select the partition → Right click → Select unmount from the menu.

Then going to gparted menu → Devices → select Create partition table to overwrite and create a new partition table on the selected device.

A new window will be shown Warning you to the action going to be done. The default partition type is "msdos" and I strong suggest you not to change it, if you do not know. Also check another time that, you indeed selected the right device. Then Click Apply button.

After clicking Apply button, the device will be absolutely empty. No partition and no data.

Then  select the unallocated space → Right Click → Select new to create a new partition.

In the create new partition dialog box, select Create as "primary", File system as "fat32" and click on the Add button. Optionally, you can also give a name to this partition.

After you click Add button, gparted will show you a preview of the device if you apply the changes. There will be a light green tick mark icon in the toolbar. You need to click that icon to apply change. There is also an Undo button, you can use it, if something goes wrong at any step.

After applying the changes, gparted will show you a message saying "All operations have been completed successfully".

Now you are done with it.

Using new Disk-utility (12.10)

Ubuntu 12.10 is now equipped with a new Disk utility. It uses new udisks2 program as backend.

First open the new Disk-Utility by typing "Disks" in the Dash. Bring the dash by pressing Super key

After opening the Disks (former disk-utility) program. Do these

Select the externel disk
Unmount the disk if it is already mounted.

Then select the partition and delete it by pressing the "Stop" play icon.

Repeat this step if you have more than one partition on the disk until all partition has been deleted.
After all partition has been deleted, the disk will now only contain Free space. You can now create a partition by clicking the small + icon.

Select the type as "FAT", give a label and push the "Create" button to create a partition.

Your disk is now containing a partition. You can mount the partition by pressing the "Play" icon. You can directly browse the location of the mounted drive by clicking the link with label "In use, Yes"

You're done.


You are doing nothing wrong. It was a bug in nwipe that reported the incorrect version. See https://bugs.launchpad.net/ubuntu/+source/nwipe/+bug/1835678/comments/2

Fixed in nwipe 0.26


How to make DD make a copy of my iPod's harddrive into my computer?

Seems like your SSH session is cutting out. I've expirienced a similar problem in a different situation. Try adding this line to your /etc/ssh/ssh_config file on your PC:

ServerAliveInterval 120

Give it a try and see if that prevents your Broken Pipe errors.

As for your command your missing something. It should be:

ssh root@192.168.1.101 dd if=/dev/rdisk0s2s1 bs=1M count=1024 | dd of=iphone1.img

You forgot to pipe the dd output to your PC.


Do we lose any functionality by using the openJDK instead of Oracle?

Firstly, a JDK consists of a Java Runtime Environment (JRE) and various tools that help you to compile and debug Java code. The JRE is stand-alone and doesn't contain any compiling or debugging tools. So, if you're not into development and just want to run applications written in Java, then you can just install the JRE.
The Oracle JDK is maintained by Oracle (surprise) whereas OpenJDK is an open source implementation with contributions from the open Java community as well as Oracle. As far as I know, Oracle JDK’s build process builds from OpenJDK source code. So, since Oracle JDK gets its source from OpenJDK, there is no major technical difference between Oracle JDK and OpenJDK. My understanding is that all of the development and bug fixes happen in OpenJDK and then they are propagated to the Oracle JDK.
I'll quote this answer here:

In the days of Java 6, there used to be a big difference between the two of them, OpenJDK running slower and supporting less. However, nowadays, except for the java-web-plugin (which was rewritten by the community and named icedtea-web), they are exactly the same. Neither of the two versions is "wrong".
There are still people claiming OpenJDK is worse than Oracle's JDK, but it's become a myth.

There have been instances where people claim that they had issues while running OpenJDK and that got solved when switched over to Oracle JDK or vice versa. But these claims, generally, cannot be verified. Considering the fact that Oracle JDK gets its source from OpenJDK these claims will always be difficult to prove.
Also, on an unrelated note, you can create your own JDK provided you follow the Java language specifications. Many companies (like Twitter) have their own JDKs. Of course, there are certain processes (that I'm currently not aware of) you have to follow before you do that.


Your "shell" or the command line interface is called bash. You can write a bash script which is similar to a batch file. A bash script starts with a She-bang #!/bin/bash and is nothing more then a set of commands to run in a sequence to run them. You are not limited to bash command, you can call any binary on the system by using the full path to the binary or script.

A master thread on learning/books/terminal/bash/Linux etc
Linux Command Line Learning Resources - cortman
https://help.ubuntu.com/community/CommandLineResources

My first bash was several commands I was running multiple times in terminal. So I listed history with history command and copied them into text file. First line must be this (no spaces before it and first line):

#!/bin/bash

And after saving you must make it executeable.

sudo chmod +x <path>
sudo chmod 755 <filename>

Note that it is a good idea to put your scripts in one place, so you can run them without requiring a path. If you create a bin directory in your home ( mkdir ~/bin ) the next time you login, that will automatically be included in your PATH.

mkdir ~/bin
chmod 755 ~/bin

Edit : If you want the script to be available to all users, place it in /usr/local/bin and have it owned by root with rx access by others sudo chown root:root /usr/local/bin/your_script ; sudo chmod 655 /usr/local/bin/your_script

gksudo gedit ~/.bashrc

Add the following to the end of .bashrc and save:

if [ -d $HOME/bin ]; then
PATH=$PATH:$HOME/bin
fi


How to combine ls and grep to list only files and using ls to count dirs

Your usage of ls and grep is correct, that will find any results in the ls output containing 'stomething'. Note that looks at the whole line, not just the filename (mostly applicable when using certain flags with ls, such as ls -l etc).

Finding directories, you're better off using find and wc (wordcount):

find /home/mydir -maxdepth 1 -mindepth 1 -type d | wc -l

Explanation:

maxdepth 1, count to a maximum depth in the tree of 1 (eg only dirs, not subdirs in this case)
mindepth 1, basically used in that example to make sure find doesn't find "." also.
type d, look for directories (-type f will find files, l will find soft links etc)
wc -l, count the lines returned

If you run that without the pipe to wc you'll get a list of all the results. Find is a pretty handy command to be familiar with.


Do you still have a console? Examine the outputs from your last commands, or see less /var/log/apt/history.log (if that's not meaningful, go hardcore with less /var/log/dpkg.log), and then reinstall what you removed.

apt-get install aptitude

apt would have warned you if you did try to remove something essential, so the worst thing that could happen is that you are forced to reinstall everything you just removed before having your system in a status similar to that before.

warning though: If you uninstalled some system service you made special configurations to, then just reinstalling it will wipe your chances of recovering those old config files you just purged. If you need such, you need to take a far more elaborate approach - on a different system.


need information about my username and password

What would be the use of the password if anyone could read it? Of cause you can't. In your situation there are two ways:

Reinstall Ubuntu. I recommend it because this way you will both get all the settings right and be sure nobody left a nasty trick in your machine, intentionally or not.
Boot from live CD. Then chroot into your system and change passwd. Here are instructions. If you follow them , keep in mind that your disk name may be different from /dev/sda1, use lsblk utility (in LiveCD) to  check.


Solved it. Helped by StackOverflow. Used following command.

curl http://npmjs.org/install.sh | sudo sh

My previous command

sudo curl http://npmjs.org/install.sh | sh

was fetching the url with root privileges. I was supposed to do sh with root privileges.


One way would be to execute in terminalas root:

service apache2 stop && backup_software && service apache2 start


Blank screen on boot after upgrade from 9.04 to 10.04 with a toshiba tecra a2. Fix?

These problem are usually seen in i8xx chips. Sadly ubuntu has not any proper solution for this. But they have published potential fixes. Just hope one of them work for you.

Also check out this post on ubuntugeek.


Try to locate and mount the Windows partition first, then run sudo update-grub.

For example,

sudo fdisk -l

results

/dev/sda1            2048  53035007 53032960 25.3G 83 Linux
/dev/sda2        53035008  99139583 46104576   22G 83 Linux
/dev/sda3        99139584 141266943 42127360 20.1G 83 Linux
/dev/sda4  *    141266944 215681023 74414080 35.5G  7 HPFS/NTFS/exFAT

in this case the Windows partition is /dev/sda4 (because of NTFS Type and because I know it). Then,

sudo mount /dev/sda4 /mnt

and then

sudo update-grub

Windows entry in grub.cfg is nothing special. It is just a chainloader entry. If above method fails to identify Windows properly, then you can manually add the entry in /etc/grub.d/40_custom file.

Example of Windows 40_custom entry for MBR (not GPT)

menuentry "Windows 7 64bit" --class windows --class os {
        insmod part_msdos
        insmod ntfs
        set root='hd0,msdos4'
        chainloader +1
}

What matters here is the set root parameter. hd0,msdos4 = /dev/sda4. If you have more than one HDDs then it might be hd1,msdos4 = /dev/sdb4.

If you follow the manual method, don't forget to run sudo update-grub after editing the 40_custom file.


You should specify the output file, for example:

ssh-keygen -t rsa -f ~/.ssh/my-new-key

Then to connect:

ssh -i ~/.ssh/my-new-key 192.168.x.x

Or set up an SSH configuration file:

nano ~/.ssh/config

Then put in something like:

Host my-server
    HostName 192.168.x.x
    User root
    Port 22
    IdentityFile /home/username/.ssh/my-new-key

Finally:

ssh my-server


Allow windows to overlap the panel on top or bottom

Some time ago, I found a solution that I want to share. This uses wmctrl, a program available for Debian/Ubuntu which can interact with any EWMH/NetWM compatible X Window Manager. I have success with this in OpenBox, XFWM4, and, any other NetWM standards compliant window manager.

Here is a 2 line bash script I call ``togglePanelBelow.sh

#!/bin/bash
wmctrl -l | grep panel |  awk '{print "wmctrl -v -i -r " $1 " -b remove,above"}' | bash
wmctrl -l | grep panel |  awk '{print "wmctrl -v -i -r " $1 " -b add,below"}' | bash

That allows ordinary windows to be repositioned so they overlap the panel.

This uses wmctl to list the existing windows, filters for ones with "panel" in the name, and then uses wmctrl again to tell those panels to go below the stack of windows. There are two steps because, at some point in 2015, the script quit working because properties could not be altered.  They must be removed and then re-set.

If you decide you want to see the panel on top of ordinary windows, as it was before, run togglePanelAbove.sh.

#!/bin/bash
wmctrl -l | grep panel |  awk '{print "wmctrl -v -i -r " $1 " -b remove,below"}' | bash
wmctrl -l | grep panel |  awk '{print "wmctrl -v -i -r " $1 " -b add,above"}' | bash

If you position a window half-on the screen, and then run togglePanelAbove, then the panel overlaps the window.

I configured shortcut keys for that and it has never caused any trouble.

This is not really a question, just a "look at this neat thing I found" post. Maybe a question would be: does this work in your chosen window manager? Can you confirm it is OK in OpenBox and XFWM4, what about others?  I've not had enthusiasm to test it in Enlightenment, for example.


Slow new laptop with fresh Ubuntu 18.04.3 LTS

I was wondering if the partition table may be at cause,

No.

  because it looks unusual.

How so? You have 2 partitions, one is the EFI partition formatted as FAT and 1 is your useable partition (rounded up it is 1000Gb) formatted as EXT.

A hard disk comes in 2 groups: slow hdd and quick ssd. hdd comes largely in 2 groups too 5400 rpm and 7200 rpm. The 5400 rpm is slow as hell nowadays so wait time are to be expected. If you use an ssd I would worry about the health of the disk.

The partition table itself is not really part of the operation of the OS itself. So that will not be the issue.

  horribly slow at everything (boot, any action taken after booting, etc.).

The 1st thing to do is

systemd-analyze blame

This will list the time each segment of the boot process took. If there is something taking a lot of time that can be used for further investigation.

You did not include specifics about your system. Please add those to the question. Brand, make, model are important.


How can I uninstall Qt5 that I installed from .run?

I finally managed to do it,

to uninstall, I managed go to the installation directory, there is an executable called MaintenanceTool, we need to run it, in order to uninstall and remove Qt.

what to do:

open terminal,

go to the installed directory cd /opt/Qt
run MaintenanceTools by the following command ./MaintenanceTool

and it is done.....


DWA 131 wireless adapter not working 16.04 LTS

I don't believe the ndiswrapper command was exactly correct. Please try:

sudo ndiswrapper -e dnetrtwlanu

Please post any errors or warnings and we'll try to fix them.

Next, I don't believe the rtl8192eu-dkms package covers your exact device; let's remove it:

sudo apt-get purge rtl8192eu-dkms

Finally, I believe the Mange package from github is correct. Just to be on the safe side, let's get a fresh clone:

rm -r rtl8192eu-linux-driver
git clone https://github.com/Mange/rtl8192eu-linux-driver.git
cd rtl8192eu-linux-driver
make
sudo make install
sudo modprobe 8192eu

Reboot and tell us if the wireless is working. As before, post any errors and we'll try to fix them. A few warnings are probably harmless.


systemd user service not starting on login

Edit: it turns out my specific case/problems were related to my encrypted home dir and using only systemd was all that was needed for it to work, although the unit has to be started on each login. For more info see here.

Looking into this more, it appears that using only systemd isn't the best approach anyway, since I'd like to have the backup to USB triggered any time USB drives with "backup" partitions are mounted (potentially multiple times per session). Instead, it's better to have udev "want" a systemd user unit that will then trigger the actual backup script. Here's what I did:

Label the drives in GParted (e.g. to be called "backup") so they will always be mounted at the same mountpoint.

Add a user systemd unit in ~/.config/systemd/user/auto-usb-backup.service with:

[Unit]
Description=Autobackup to USB drive

[Service]
ExecStart=/home/david/Documents/computer/backup/scripts/backup_to_usb.sh

Reload the daemon: systemctl --user daemon-reload so it's aware of the new unit.

Then, add a udev rule to trigger the unit when a USB drive with a "backup" partition is mounted. Create a udev rule at /etc/udev/rules.d/90-auto-usb-backup.rules containing

SUBSYSTEM=="block", ACTION=="add", ENV{ID_FS_LABEL}=="backup", TAG+="systemd", ENV{SYSTEMD_USER_WANTS}="auto-usb-backup.service"

The ID_FS_LABEL parameter name and value were obtained using udevadm monitor  --environment --udev and plugging in the drive, but the lsusb (and its -v option) and udevadm info -a -p  $(udevadm info -q path -n /dev/sda) may also be useful to fine-tune rules (e.g. have the udev rule trigger only for a specific drive based on its serial number).

Reload udev for the new rule to apply: sudo udevadm control --reload

Check the rule will trigger for the drive with udevadm test /block/sda (where sda is the current drive mountpoint): you should see TAGS=:systemd: among the output.

Finally, turn remove and add the drive: the script in the systemd user unit defined above should get executed. You can double-check this (and debug) using journalctl --user-unit auto-usb-backup -r -b (note that on some systems the --user-unit option may be -u instead).

Note: it appears the script gets triggered before the drive is done mounting, so the backup script called by the systemd unit has a wait loop to sleep until the folders its looking for are available.

Resources that were helpful:

https://vic.demuzere.be/articles/using-systemd-user-units/

https://borgbackup.readthedocs.io/en/stable/deployment/automated-local.html


How to tell whether my HDD is IDE or SATA

You have a SATA hard drive.
The reason that you are seeing IDE in there is actually quite simple: SATA can operate in one of two modes, AHCI or IDE.
Your controller appears to be in the IDE mode at the moment, as you can clearly see from the command output:
SATA Controller [IDE mode]

As for the difference between the two modes:

Only 2 major differences between AHCI and IDE mode.
AHCI allows for hot swapping of hard drives if the motherboard chipset
also supports it, and it also  enables NCQ for hard drives if
they support it. IDE mode does not allow for either of these
functions.
There is a small hard drive performance hit when you use IDE mode due
to NCQ being disabled.
Intel PDf's on the AHCI standard if you wish to do some reading

The above quote is from this answer on Superuser.
And here's some more info about the difference between the two modes from the Crucial forums:

Depending on your system, multiple SATA controller modes may be
available in your BIOS or UEFI to manage how an SSD operates with the
rest of your system.
AHCI (Advance Host Controller Interface): The
modern standard for SATA controller operation, this provides the best
performance possible with a SATA storage device, combined with the
best support for features to optimize an SSD's performance, such as
TRIM. We recommend this mode for a majority of our users, and only
deviating from this if needed for addressing compatibility and
software problems.
IDE (Integrated Drive Electronics): A legacy
standard dating back to the 1990s. Due to slower performance and worse
support for modern hardware, we don't suggest using this mode over
AHCI. An exception to this is if you are using an older system missing
AHCI support, or are experiencing system instability using an SSD in
another mode and need to use this mode for compatibility/testing
purposes.
Note that the above modes may be reference differently by
some motherboards, such as AHCI being called "Serial ATA" or IDE being
labelled "Legacy" or just "ATA." If your SATA modes are not described
in an obvious way, please refer to your system or motherboard
documentation for clarification

.


How do I add Ubuntu to the msconfig boot menu on windows 7?

I figured it out, I had install Ubuntu on a separate partition, then use Easy BCD to add an entry to the windows boot loader, that points to Ubuntu's GRUB boot loader on the other partition.


How can I programmaticatly check if a source is in sources.list?

apt-cache policy shows all available sources. Example output (trimmed):

Package files:
 100 /var/lib/dpkg/status
     release a=now
 500 http://ppa.launchpad.net/lekensteyn/wacom-tablet/ubuntu/ precise/main i386 Packages
     release v=12.04,o=LP-PPA-lekensteyn-wacom-tablet,a=precise,n=precise,l=Wacom Tablet Drivers,c=main
     origin ppa.launchpad.net
 500 http://ppa.launchpad.net/lekensteyn/wacom-tablet/ubuntu/ precise/main amd64 Packages
     release v=12.04,o=LP-PPA-lekensteyn-wacom-tablet,a=precise,n=precise,l=Wacom Tablet Drivers,c=main
     origin ppa.launchpad.net
 500 http://ppa.launchpad.net/bumblebee/testing/ubuntu/ precise/main i386 Packages
     release v=12.04,o=LP-PPA-bumblebee-testing,a=precise,n=precise,l=Bumblebee Developer releases,c=main
     origin ppa.launchpad.net
 500 http://ppa.launchpad.net/bumblebee/testing/ubuntu/ precise/main amd64 Packages
     release v=12.04,o=LP-PPA-bumblebee-testing,a=precise,n=precise,l=Bumblebee Developer releases,c=main
     origin ppa.launchpad.net
 500 http://archive.canonical.com/ubuntu/ precise/partner i386 Packages
     release v=12.04,o=Canonical,a=precise,n=precise,l=Partner archive,c=partner
     origin archive.canonical.com
...
 500 http://nl.archive.ubuntu.com/ubuntu/ precise/main Translation-nl
 500 http://nl.archive.ubuntu.com/ubuntu/ precise/main Translation-en
 500 http://nl.archive.ubuntu.com/ubuntu/ precise/multiverse i386 Packages
     release v=12.04,o=Ubuntu,a=precise,n=precise,l=Ubuntu,c=multiverse
     origin nl.archive.ubuntu.com
 500 http://nl.archive.ubuntu.com/ubuntu/ precise/universe i386 Packages
     release v=12.04,o=Ubuntu,a=precise,n=precise,l=Ubuntu,c=universe
     origin nl.archive.ubuntu.com
 500 http://nl.archive.ubuntu.com/ubuntu/ precise/restricted i386 Packages
     release v=12.04,o=Ubuntu,a=precise,n=precise,l=Ubuntu,c=restricted
     origin nl.archive.ubuntu.com
 500 http://nl.archive.ubuntu.com/ubuntu/ precise/main i386 Packages
     release v=12.04,o=Ubuntu,a=precise,n=precise,l=Ubuntu,c=main
     origin nl.archive.ubuntu.com
 500 http://nl.archive.ubuntu.com/ubuntu/ precise/multiverse amd64 Packages
     release v=12.04,o=Ubuntu,a=precise,n=precise,l=Ubuntu,c=multiverse
     origin nl.archive.ubuntu.com
 500 http://nl.archive.ubuntu.com/ubuntu/ precise/universe amd64 Packages
     release v=12.04,o=Ubuntu,a=precise,n=precise,l=Ubuntu,c=universe
     origin nl.archive.ubuntu.com
 500 http://nl.archive.ubuntu.com/ubuntu/ precise/restricted amd64 Packages
     release v=12.04,o=Ubuntu,a=precise,n=precise,l=Ubuntu,c=restricted
     origin nl.archive.ubuntu.com
 500 http://nl.archive.ubuntu.com/ubuntu/ precise/main amd64 Packages
     release v=12.04,o=Ubuntu,a=precise,n=precise,l=Ubuntu,c=main
     origin nl.archive.ubuntu.com
Pinned packages

Using awk to retrieve the actual source (URL or file):

$ apt-cache policy | awk '/^ *[0-9]/{print $2 " " $3}'
/var/lib/dpkg/status
http://ppa.launchpad.net/lekensteyn/wacom-tablet/ubuntu/ precise/main
http://ppa.launchpad.net/lekensteyn/wacom-tablet/ubuntu/ precise/main
http://ppa.launchpad.net/bumblebee/testing/ubuntu/ precise/main
http://ppa.launchpad.net/bumblebee/testing/ubuntu/ precise/main
...
http://nl.archive.ubuntu.com/ubuntu/ precise/universe
http://nl.archive.ubuntu.com/ubuntu/ precise/restricted
http://nl.archive.ubuntu.com/ubuntu/ precise/main


You can download it for free at http://www.michaelfogleman.com/craft/


cloning server to almost identical server

Theoretically it should work.
A few things you should be aware of:
If /etc/fstab uses UUID to identify partitions, then you'll probably have to edit it to work with the new SSD.
You should probably also change the hostname, unless the old server is not going to run anymore.

Seeing as it's the same architecture and pretty much same hardware, you should be able to run the same kernel and the same applications as before.


Besides Powertop (available from Software Center), and turning all options to GOOD when on battery, you need to set several kernel parameters:

i915.i915_enable_rc6=1
i915.i915_enable_fbc=1
i915.lvds_downclock=1
pcie_aspm=force

Add to /etc/default/grub, Line starting with GRUB_CMDLINE_LINUX_DEFAULT="quiet splash pcie_aspm i915.i915_enable_rc6=1 i915.lvds_downclock=1"

call sudo update-grub after editing...

This boosted my battery life from 4 hours to over 10 hours (without networking)

Check out this post http://www.williambrownstreet.net/blog/?p=387


Why did my LibreOffice icons change and how to I get the old ones back

The icons you see are from the package libreoffice-style-oxygen.

Others you can install, including some that should be installed by default, are:

libreoffice-style-crystal
libreoffice-style-galaxy
libreoffice-style-hicontrast
libreoffice-style-human
libreoffice-style-tango ( and last but not least, the new and probably the best ;-)
libreoffice-style-sifr

These can be found in Software Center by entering "libreoffice-style" in the Search box (at the top-right corner).

You can select them from the LO menu:

Tools > Options... > View > User Interface : Icon size and style

Uninstalling a "libreoffice-style-*" package removes that icon style from those options.


Acer BIOS/UEFI often has an extra menu only accessible if you set a supervisor password. Acers are notoriously difficult to install Linux on.
Try these steps:
They assume that you have installed Ubuntu, but some steps might also be required for booting from a Live USB
Always make sure your UEFI is up to date. If you can't access the TRUSTED menu, you may have to mount the EFI partition.
To mount the EFI partition, you need to:

Install Ubuntu; (You should have done this already)

Boot into a live session using your Ubuntu USB and select "Try without installing";

Launch Gparted to get the EFI partition address. I think yours is dev/nvme0n1p2 from what you posted above but it might not be. If not, or you don't know, post a screenshot of GParted.

While still in the live session, Open the Terminal (ctrl + alt + T);

In the Terminal execute the following to create a directory in the "media" folder and to mount the EFI partition to that folder:
sudo mkdir /media/EFI
sudo mount dev/nvme0n1p2 /media/EFI (Or change dev/nvme0n1p2 to whatever you found in GParted).

*Update
While in the terminal,
sudo mkdir /media/EFI/EFI/Linux
sudo cp -R /media/EFI/EFI/ubuntu /media/EFI/EFI/Linux

Exit the live session and reboot into UEFI
In UEFI, you must set a supervisor password. Once the supervisor password is set, some new menus are accessible.
Enter the "Select an UEFI file as trusted for executing" menu. It will allow you to declare the newly installed Ubuntu boot image as trusted on your laptop.
Select EMMC >> EFI >> Ubuntu and select the file shimx64.efi. (It might have a different name on your machine eg. Linux) You will be prompted to give it a name of your choice (which will appear in the F12 boot options).
Type the name press Enter and then "Yes" should be highlighted.
Press enter again. Restart the computer without any boot disk and tap F12 during the boot process.
You should now get the boot option menu with the name you chose.
You can change the boot order in UEFI now so that it boots directly to the Grub screen.
Either disable the supervisor password, or save it in a secure place.

Hopefully Ubuntu will boot.


How to share folder from Ubuntu Server 14.04 using samba to 2 desktop, windows XP and Ubuntu in Virtual Box

Have you seen this turorial link? At which point are you stalled?


How to set up and run the code for "stlink" zip file from github in ubuntu 20.04

After downloading and extracting the zip file, please consult the README. It says, in part:

Linux

We recommend to install stlink-tools from the package repository of
the used distribution:

Ubuntu Linux: (Link)

I suggest that you open a terminal and do:
sudo apt update
sudo apt install stlink-tools

You should be all set.


HP EliteBook 8540p fingerprint not found (Ubuntu 16.04)

Your fingerprint reader is 138a:0007 Validity Sensors, Inc. VFS451

It's not in the supported model of fingerprint-gui project, therefore it's not working for sure.

You can found a bug report for this device here on launchpad.


How to tell javac which libraries to include

You need first to install libcommons-io-java:

sudo apt-get install libcommons-io-java

Then use the installed jar file with javac this way:

javac my_file.java -cp /usr/share/java/commons-io.jar

From the javac man pages:

      -cp path or -classpath path
         Specify where to find user class files, and (optionally)  annota‐
         tion  processors  and source files. This class path overrides the
         user class path in the CLASSPATH environment variable. If neither
         CLASSPATH,  -cp  nor -classpath is specified, the user class path
         consists of the current directory. See Setting the Class Path for
         more details.


I had a similar problem with fonts in xemacs under opensuse 12.1.
It disappeared after I added a different font description (different iso) in my xemacs starting files:
(set-face-font 'default
                         "-b&h-lucidatypewriter-medium---*-14-140---*-*-iso10646-1")


My steps to solve this problem:

dpkg -r --force all gstreamer0.10-plugins-good
apt-get -f install
apt-get install ubuntu-omap4-extras

Force to remove the good package first!


Turns out reinstalling covers over a multitude of errors.  I think I failed to install one of the windows dependencies.


You most definitely will. Use this diagram:

(Your HDD) -> (Your Dynamic HDD) -> Pacman File

A dynamic Hard Disk Drive is a very useful device, which replaced the fixed virtual hard drive. The Dynamic HDD is a file that contains your VM's hard drive. However, it doesn't use all n gigabytes of space you assigned it. That n is a cap, the most  space it can take up. In your case, n = 200 GB. Your virtual machine considers this as a 200 GB drive plugged in to it. As space is used in the VM, the same amount of space is used in the file. For example, your VM shows you are using 190 GB of hard drive space. The Dynamic file will also be around 190 GB. The dynamic HDD will reach its cap with the addition of 10 GB.

There are 3 ways to increase the actual drive size (The Host Machine):

Go out any buy a new one.
Clean up unused programs, files, etc.
EMPTY THE RECYCLE BIN. You would be surprised that sometimes 50+ gb just sits in the recycle bin.

Increasing your dynamic HDD space (as your problem is) is rather difficult if not impossible. The easiest way would be to create a new virtual drive of a large size and start using that as a dedicated drive for development, etc. Note that this adds a second drive, and does not increase the capacity of the first. To figure out how to do this, consult your software's manual.

You should always keep about 5% of your hard drive free for error logs, temp files, and similar short-lived data.


Partition Disks on VirtualBox When installing Ubuntu Server

Yes,its just refferring your virtual hard drive and not the real hard-drive.It doesn't affect your main hard-drive,i'm sure about that.


Postgresql server installation keeps failing due to postgresql-common error

The problem was that postgres user was not getting created.(Looks like an error with the package configuration scripts, not sure though) I then created the user manually using:

sudo useradd -r -s /bin/false postgres

The above command is to create a user, without home directory.(Courtesy)

After that I tried to install again, and it succeeded, without any problems.

N.B:
Some guys at the Ubuntu IRC channel helped me with the solution.

Update:

After restart postgresql server was not accessible, so tried to restart postgresql server, and got the following error:

$ sudo service postgresql restart
[sudo] password for username:
 * Restarting PostgreSQL 8.4 database server
 * The PostgreSQL server failed to start. Please check the log output:
2014-04-03 09:54:22 IST FATAL:  could not create lock file "/var/run/postgresql/.s.PGSQL.5432.lock": Permission denied
[fail]

Solved it by editing the postgresql.conf file. We have to look for the line that begins with that begins unix_socket_directory and change it to read as the following:

unix_socket_directory='/tmp'

Now start the postgresql server using:

sudo service postgresql start

The problem was because

  the default directory for lock files in Ubuntu was changed to
  /var/run/postgresql, which is not world-writable. However, simply
  changing write permissions on the directory does not work; they are
  reset when the default init script runs.

Courtesy: http://eclecticquill.com/2013/02/26/postgresql-fails-to-start-on-ubuntu-12-10/

Got more info from this link:

  But if you are trying a to run an instance of the PostgreSQL server
  owned by your local user, you need to ensure that the unix socket
  directory is writable by the user that owns the PostgreSQL server
  process. Try:

  unix_socket_directory='/tmp'

In short:

We had to do that because we created the postgres user manually.


How do I configure nagios with audio notifications?

This was done with the authorized written permission of nagios.com

  There's been a lot of questions as to exactly how notifications work.
  This will attempt to explain exactly when and how host and service
  notifications are sent out, as well as who receives them.

  When Do Notifications Occur?

  The decision to send out notifications is made in the service check
  and host check logic. The calculations for whether a notification is
  to be sent are only triggered when processing a host or service check
  corresponding to that notification; they are not triggered simply
  because the  has passed since a previous
  notification was sent. Host and service notifications occur in the
  following instances.

  When a hard state change occurs.
  When a host or service remains in a hard non-OK state and the time specified by the  option in the host or service definition has passed since the last notification was sent
  out (for that specified host or service).

  Who Gets Notified?

  Each host and service definition has a  option that
  specifies what contact groups receive notifications for that
  particular host or service. Contact groups can contain one or more
  individual contacts.

  When Nagios sends out a host or service notification, it will notify
  each contact that is a member of any contact groups specified in the
   option of the service definition. Nagios realizes that
  a contact may be a member of more than one contact group, so it
  removes duplicate contact notifications before it does anything.

  What Filters Must Be Passed In Order For Notifications To Be Sent?

  Just because there is a need to send out a host or service
  notification doesn't mean that any contacts are going to get notified.
  There are several filters that potential notifications must pass
  before they are deemed worthy enough to be sent out. Even then,
  specific contacts may not be notified if their notification filters do
  not allow for the notification to be sent to them. Let's go into the
  filters that have to be passed in more detail.

  Program-Wide Filter

  The first filter that notifications must pass is a test of whether or
  not notifications are enabled on a program-wide basis. This is
  initially determined by the enable_notifications directive in the main
  config file, but may be changed during runtime from the web interface.
  If notifications are disabled on a program-wide basis, no host or
  service notifications can be sent out - period. If they are enabled on
  a program-wide basis, there are still other tests that must be passed.

  Notification Methods

  You can have Nagios notify you of problems and recoveries pretty much
  anyway you want: pager, cellphone, email, instant message, audio
  alert, electric shocker, etc. How notifications are sent depend on the
  notification commands that are defined in your object definition
  files. 1

Read More

1Source:Nagios Notification

This was done with the authorized written permission of nagios.com

  After installing alsa by using the command

sudo apt-get install alsa alsa-base alsa-utils

  after that we go to configure Nagios Core to use aplay as command-line
  audio file player for the ALSA sound card driver.

> $: cd /usr/local/nagios/etc $: sudo nano commands.cfg

  adding the following lines

define command{  command_name    play_siren  command_line    /bin/bash
> /usr/local/nagios/etc/objects/play_siren.sh  }

  create a script to run the sound alarm

> $: cd objects $: sudo nano play_siren.sh

  with those lines

> #!/bin/bash  /usr/bin/aplay -q /usr/share/nagios/etc/objects/alarm.wav

  give to it the permissions and create a log

> $: sudo chown nagios.nagios play_siren.sh $: sudo chmod a+x

  play_siren.sh

  modify the file contact.cfg to say to nagios of using the sound alarm

> $: sudo nano templates.cfg:

  modify the

  define contact{
          name                            generic-contact
          service_notification_period     24x7
          host_notification_period        24x7
          service_notification_options    w,u,c,r,f,s
          host_notification_options       d,u,r,f,s
          service_notification_commands   notify-service-by-email,play_siren
          host_notification_commands      notify-host-by-email,play_siren
          register                        0
          }
  2

2Source:ideasnet.wordpress.com

Extra References:

custom checks and notifications nagios


"this is not a bootable disc..." when installing on a Macbook Air 13 6,2 with usb

I have ubuntu running natively  on a macbook pro 5.5 without OSX.  It appears I ran into the same errors as you have described, which is that the grub bootloader fails to install to disk during installation.

Edit:

The following steps were needed to prepare a mac/macbook for ubuntu single booting:

To prepare your disk run the Apple recovery media (USB/Disk/HD Partition) by holding opt at boot. (If you do not have this you can create one inside OSX using this app)
Using Disk Utility erase and set up a new partition scheme in Fat32 format (1 partition intended for the ubuntu system and 1 for swap). During this phase Disk Utility will create a hidden EFI partition at the beginning of the disk.
Run the ubuntu live CD however ensure you select 'something else' as an option. The partition editor should now allow you to see the hidden EFI partition. At this point make sure you set this partition to 'do not use this partition'. Specify your system and swap as normal and continue the installation.
You will get an error regarding continuing without a bootloader, and a warning about being unable to boot.  Do not worry about this, ignore and continue.
When installation completes do not reboot, select 'continue testing'. Now we must install the bootloader. Enable networking (if not already enabled) and download boot-repair:

sudo add-apt-repository ppa:yannubuntu/boot-repair && sudo apt-get update

Press ENTER.
Then type:

sudo apt-get install -y boot-repair && (boot-repair &)

Select 'fix recommended' and Boot-repair will ask you to open a terminal to purge grub. The EFI files will be put where they need to be for your mac to find them, and all that is left is to reboot.


as far as i know, I do not think it's possible to have xRDP warn if somebody try to connect to a system while you are connected (out-of-the box) because xRDP by default allows multiple connections.  RDP in microsoft when used against windows workstatioins are limited to one remote connection only (licensing wise)

However, you can limit the number of connection allowed through xRDP.  If you need to ensure that only one user can connect remotely to a specific system, you might wanna check the /etc/xrdp/sesman.ini file and set the max number of connection you might want to authorize

It might be possible to create a script that would monitor number of xrdp sessions and if the session number is above a threshold, you could get a notification....(but never tried that)

Hope this help
Till next time
See ya


Why is lowlatency kernel not being updated in parallel with the generic kernel?

Because the lowlatency kernel is not officially supported, but is maintained by the community, who are not as diligent about security fixes as the security team.


Ubuntu LIVE installation on UEFI system creates boot partition with msdos instead of GPT

gpt disk partitioning is recommended on a machine new enough to use it.  To change from dos partitioning to gpt, run a disk partitioning tool like gdisk, delete all the current partitions, create a new partition table as gpt, then remake partitions in the size you want them. Google for recommended partitioning schemes -- search for disk partitioning recommendation for ubuntu  .  These days, a swap partition is not necessary and is not automatically created because a swap file is used.  Fine, unless you want to have multiple installations on the disk and have them share swap.  I like to have two partitions for root, so I can try out a new release without giving up the current one being used.  Make a swap partition if you will eventually have multiple installations.  I like a big data partition, mounted at /usr/local/data.  Not /home, because with multiple installations, the home directory has release specific files.  From the any release's home directory, you may add links to the data partition as needed.  Make a 300M partition first, for the EFI partition.

At the installer,  chose the "something else", select the partitions you created, and set what they contain and what they are to be used for (e.g. fat filesystem, efi  or  ext4 filesystem, root).

The mode (UEFI vs legacy) the installer is booted determines the way the install is done.


Why are some OCRed pdfs greppable, and some aren't?

A without specifying what the source of these PDFs is, it's hard to say for certain but a PDF can be one of a few things:

An actual text document, strings, formatting instructions, etc. Easily greppable.
An image that has been run through an OCR mechanism to embed text under the image. Easily greppable.
An image of a piece of paper. Not greppable.

I would suggest the ones you can't use haven't had their OCR done. There are processes for doing it but that's a slightly bigger question.


Downloading urls with backslashes with wget or curl from IIS server

The solution is to convert the back slashes to forwards slashes:

http://domain.com/dir/msrubbish.aspx?urlPath=D:/2014/AC_001/English/AC001_FIN_E_182.PDF


external monitors with different resolution 2K 4K, diff. errors, daisy chain, Ubuntu

pc="eDP-1"
benq="DP-2-1-8"
dellb="DP-2-2"
xrandr -v --output ${benq}  --mode 3840x2160 --rate 29.97 --primary \
          --output ${dellb} --mode 2560x1440 --rate 59.95 --left-of  ${benq} \
          --output ${pc}    --mode 1600x900  --rate 59.99 --right-of ${benq}

with a lower refresh rate and a smaller resolution of the laptop monitor is it working all right


Considering you want sums in file.dat added together and then print them out, the line should be:

awk '{sum +=$1} END {print sum}' file.dat

Telling awk to print the sum every time you add a new value to sum makes it show each intermediate value, just as you have experienced.


I am thinking by devices you mean under /dev like /dev/sdaX ,/dev/sdaY and so on. That I am afraid is not possible. You could follow bkzland's instructions and stop your those two NTFS drives (Windows partition & Recovery Partition) from auto-mounting on startup, if they do.

Another viable option using the fstab file is to limit the permissions of who can access/edit the two partitions. You could take a look at the Ubuntu Community Documentation on fstab to achieve any of these solutions.

Just to prevent other users from touching those partitions from the Nautilus side-bar, you could follow the instructions on this page and also this thread at UbuntuForums.org to do that. I haven't tested either of them myself personally, but just saying that you could. But even then, your drives will show up in command-line tools like fdisk, blkid and such and also on disk-utility programs like Gparted partition editor and such.


Epson Scanner sx218 - Works Intermittently

I have managed to solve this problem. Full description follows -

I have read that Epson provides very good driver support for Linux and from my limited experience this would seem to be the case. The Epson web site can lead to a bit of confusion in this respect. When initially searching for information about your Epson scanner/printer/all-in-one the Epson site suggests searching for the device using a format such as SX-218 (i.e. with a hyphen). This works and takes you to a device information page. On those pages there is a Drivers and Downloads section that has a drop-down list for the OS. If you are running Windows the page will list driver links beneath the drop-down. If you select Linux, the only thing that is displayed is a tiny link that says "driver". If you click that link, you are taken to a search page for Linux drivers. It appears initially that nothing is there. When you search for your printer, you need to remove the hyphen from the search string. So SX218 will get a result. SX-218 will not. Very confusing at first.

When you get to the driver information, there are download links for the driver software. At the bottom of the page there is a tiny link to FAQs. Click on this somewhat easily overlooked link and read the FAQs. The information is very useful.

Step by Step Instructions

Download the software. You will need iscan-data_1.24.0-2_all.deb (or later version) and iscan_2.29.2-1~usb0.1.ltdl7_amd64.deb or similar. the "ltdl7" packages are for current versions of Linux - the "ltdl3" are for earlier versions. The printer drivers are similarly obtained - you will want epson-inkjet-printer-workforce-320-sx218_1.0.0-1lsb3.2_amd64.deb or the i386 equivalent.
Check that the Synaptic Package manager is installed.
Check that sane-utils is installed on your system.
Check that the GDebi package installer is installed. Use Synaptic to install if not already there.
Check/Install package xsltproc using Synaptic. This step is crucial for installation of the iscan-data package.
Use GDebi to install iscan-data_1.24.0-2_all.deb
Use GDebi to install iscan_2.29.2-1~usb0.1.ltdl7_amd64.deb
Check /etc/sane.d/dll.conf It should contain a line that reads - epkowa If it has a line that reads - epson2 then comment this out with a hash (#)
Check the /etc/sane.d/epkowa.conf file. It should have a line that reads - usb 0x04b8 0x0865 - Note 0x04b8 is the vendor ID for Epson - 0x0865 is the product ID for the SX-218
Comment out the scsi entry in the /etc/sane.d/epkowa.conf file
Check the entries in /lib/udev/rules.d/40-libsane.rules - there should be an entry for the vendor and product numbers in this file (there was already one there when I did the install).
Using the "Users and Groups" package (not always installed by default), add users to the "scanner" group.
Install the printer driver - epson-inkjet-printer-workforce-320-sx218_1.0.0-1lsb3.2_amd64.deb or equivalent

Notes
When plugging in the printer/scanner use a USB2 port NOT USB3. USB3 seems to work for the printer but will not work reliably for the scanner. When plugging the device into a USB2 port it was instantly recognised by the system

You can use the lsusb command in the terminal window to get the vendor and product ID for your device.


Unable to install any application. While installing language pack it throws error

The line /etc/environment: line 2: unexpected EOF while looking for matching "' in the error message says that you missed a double quote " at the end of the second line.

Change the second line from

JAVA_HOME="/home/parmeet/JAVA/jdk1.8.0_20/bin

to

JAVA_HOME="/home/parmeet/JAVA/jdk1.8.0_20/bin"

and try sudo apt-get install language-pack-en again


Can I use fractions/decimals in a bash script?

Yeah bash only handles integers but you can route around the issue, either by not using bash (Python is very simple to pick up) or by using bc to handle the calculations.

Remember that your condition in your for loop isn't going to work at fractions so you'll need to expand that too.

step="0.5"

for (( i=0; $i<$(bc<<<"10/$step"); i++ )); do
      echo $(bc<<<"$step * $i")
done

That'll echo 0 through 9.5 in 0.5 increments.


This feature will be available only in the 3.10 version. All you can do now is to play a bit with dconf-editor.

gsettings set org.gnome.shell app-folder-categories "['Utilities', 'Sundry', 'Games' ]"

More info you will find here.


How to make my MSI computer by default use Ubuntu after installation?

You need to repair your boot menu using Boot-repair. After that, you will get the boot menu on every startup with all the boot options listed in it.
The startup menu will stay for 5-10 seconds and after that, the system will boot to the default boot entry.
If you find that Ubuntu is not your default boot entry then you can customize it using Grub-customizer
Some helpful Links
1 how to use grub-customizer


Convert all letters to uppercase in all text files from a directory

The right way using sed should be done with the help of \U switch:

sed -i 's/.*/\U&/' *.txt

See also:

Match text with regular expressions and transform upper and lower case letters with sed.
Different ways to capitalize the contents of a file.


GRUB dual boot won't load after using Windows

If you have the Ubuntu live CD or USB.
Please start your computer with it.
Then install Boot Repair (please issue the below commands)

sudo add-apt-repository -y ppa:yannubuntu/boot-repair

sudo apt-get update

sudo apt-get install -y boot-repair && boot-repair

Then start the application and re-install GRUB

Then restart your computer and everything should be back to normal


I think you might need to change this:

my-lat / # cat /etc/issue
Linux Mint 17.1 Rebecca \n \l

to

echo 'Ubuntu 14.04 LTS \n \l'>/etc/issue


How can I clean up Connect to Server's recent servers?

Easily you can edit the file:

gedit ~/.config/nautilus/servers

You can edit the file and remove some entries or if you just want to delete all history you can remove this file:

rm ~/.config/nautilus/servers


On the fly

you can configure ip as follows

ifconfig eth0 10.0.10.10 netmask 255.255.255.0 up

or static

edit /etc/network/interfaces

auto eth0
  iface eth0 inet static
    address 10.0.10.10
    netmask 255.255.255.0
    gateway 10.10.0.1

then

/etc/init.d/networking restart


The OOM Killer is activated when the system has a severe shortage of memory:

  It is the job of the linux 'oom killer' to sacrifice one or more processes in order to free up memory for the system when all else fails. It will also kill any process sharing the same mm_struct as the selected process, for obvious reasons. Any particular process leader may be immunized against the oom killer if the value of its /proc/<pid>/oomadj is set to the constant OOM_DISABLE (currently defined as -17).

Things to check:

Is something in your build script taking up a lot of memory?
Are there memory leaks in some tool you are using?

Have a look at this LWN article.


Purple screen after installing to external hard drive

If you are using an external hard drive to boot from remember that the read / write speeds of anything external are slower than they would be for an internal.

Your waiting time for any operating system that is stored on an external hard drive or USB pen is going to be at least double of that if you had the operating system installed on an internal hard drive.

Your best option would have been to install it onto an internal hard drive by itself or even dual boot Windows 7 & Ubuntu.  If you decided to dual boot then you would be able to remove the partition of Ubuntu if you decided you did not want it.

Hope this helped


Cannot find "Locale" entry in KDE System Settings

This is for Kubuntu 18.04, not 16.04, but I think the approach should be similar.

Open System Settings and type locale in the search bar.

You should see Regional Settings appear:

When you open Regional Settings, you may see something like this:

Scroll down to choose the locale you desire.

If instead of typing locale, you type language, you'll see different choices under Regional Settings as shown below:


How to Tell if Network Traffic is Encrypted

Encrypted traffic you can see with some traffic analyzer.
Wireshark is one good.
Instal them with command
sudo apt-get install wireshark

Run it with sudo wireshark
Pick the net interface and click start.
In filter type:

ip.addr == ip_address_of_usenet_server

In field below you will see only communication between your client and server.
If traffic is encrypted you will see tlsv1 packets or some another encryption and ssl layer traffic packets. If traffic is not encrypted ssl layer traffic will missing


How do you encrypt and decrypt files using your keychain?

To view the keys known by gpg run: gpg --list-keys

Assuming the key pair is still in your system, open a terminal and do:

 gpg -d FILE.pgp

You may get a password prompt if the key requires it.

To encrypt a file, you can do:

gpg -e -r NAME FILE

The -r is for --recipient and is optional. It will prompt you for more input if needed.


Delete the file .bash_history in your home directory.


Unless an executable file is in the path, it won't be found unless you provide the fully qualified name. Run ./cmake instead.


fsck on ext4 resulted in file corruption

I would recommend that you do not touch the disk any more.

You can however try to recover your files yourself with harddrive forensics analysis tools,
just download a backtrack livecd and recover files to a harddrive connected via usb.

Here you can download Backtrack: http://www.backtrack-linux.org/downloads/

If there are important files on the disk, then take it to a professional in recovering harddrives. Your money will be worth it.