Why isn't my Samba machine browseable on the network?

The Samba server must be defined in the DNS server you're using to make it searchable (not "browsable": that is a samba setting) by name.  Edit the relevant DNS server settings to make this happen.

As your question does not mention any network settings, (rather vague) the answer doesn't contain the exact commands neither (rather vague too).  Alternatively, if all of your clients are Windows/Mac machines, winbind on the samba server can be used as well. (again: rather vageu)

So update your question if this answer is too vague with your DNS settings, number of clients / printers /... and I'll update my answer to become more exact as well.

(an Infrastructure diagram would be best.  Something like this)


Monitor resolution messed up, monitor is unknown

The monitor reports its dimensions using EDID. Most probably the monitor does not report correctly the EDID information. In addition, newer X.Org is strict about EDID information.

So, how to figure out if this is an EDID issue;

Install the read-edid package with sudo apt-get install read-edid
Get the EDID information with sudo get-edid | parse-edid
Finally, post the information here (use pastebin).


Standalone Calendar with Unity Integration

Use Evolution Mail and Calendar. Integrates with Unity's Date & Time applet perfectly. Also it supports syncing with Google Calendar and other popular online calendar services.


Using tar for simple back-up and restore

Hey.
I'm certainly no expert in this area, and I was just pinging a linux sysadmin friend's brain for advice on a backup solution this afternoon, but I might suggest rsync instead?

rsync -avuz --exclude=PATTERN /path-to-source /path-to-destination

will create an archive backup with permissions, owner attributes, and creation times intact, and compress (zip) the transfer, excluding files which match "PATTERN" ... and if you run it again to same directory, it will update (-u) only replacing files whose checksum has changed.

Alternatively, you should (as I was recommended to do) look into rsnapshot and rdiff-backup.

Is this what you are looking for?


I worked out the issue.

sudo gedit /etc/default/tor

Change the "yes" to "no" in the following file

RUN_DAEMON="yes"


Add more disk space to Ubuntu from my Windowns 7 major disk and shrink from other drivers

Thanks @jeroen and @Sadi i went back to windows made a new partition and connected with Ubuntu, but the issue that this new partition in windows ate the Linux Boot partition so i did it all over again but now i am free in space


Run the following commands in terminal:

sudo apt-get install build-essential linux-headers-generic linux-headers-`uname -r`
wget -O- http://linuxwireless.org/download/compat-wireless-2.6/compat-wireless-2012-11-13-pc.tar.bz2 | tar -xj

cd compat-wireless-2012-11-13-pc
./scripts/driver-select alx
make
sudo make install

After reboot, you can use your Atheros card.

If you downloaded driver package on your desktop:
Open a terminal:

cd Desktop
tar -xj compat-wireless-2012-11-13.tar.gz
cd compat-wireless-2012-11-13-pc
./scripts/driver-select alx
make
sudo make install


While it is "stuck" there, can you ssh into 172.16.1.141 (the address from your screenshot, it will vary between attempts) as ubuntu, from the same machine where you are bootstrapping from? I've seen this before and there was a stuck dpkg or apt-get process on that node as a result of an incorrect MTU. Meaning, ssh worked, but as soon as a transfer of something larger than a few keystrokes in a terminal happened, like a package download, it would get stuck.


Open terminal then type the below command:

cd ~/Desktop/[Name of the folder]
pwd

This should show the preset working directory which should be /home/[username]/Desktop/[Name of the folder].


Can't connect to certain wifi network or if connects then internet is unavailable within sometime

Simply installing the Broadcom driver worked for me:

sudo apt-get install bcmwl-kernel-source

I reinstalled all the drivers in Windows partition as suggested in one of the linked posts. That actually fixed the Windows side of issue. The drivers were available in the Dell's official website where I had to provide my machine number to download the required drivers.


Have you looked at using Webdav instead. It is a HTTP based file share. This is the direction I am currently leaning. I just started researching this as a option. I have a 8tb raid5 running ubuntu server and streaming to multiple VER1 Apple TV's stripped of factory OS and running XBMC. (trying to cut the cord with sat. provider) Having issues with samba and looking for an alternative. XBMC supports webdav natively so it seemed like a natural next thing to try. Other things you could look at is
adding XMBC or PLEX software to handle it. Nice thing about that is the pretty interface you get for browsing you content

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

if you want a quick overview. There is also a wiki page for setup help.


Can't boot ubuntu, deleted 86_64x gnu accidently

You can use "Boot Repair" for this. Grab the Live USB/DVD that you used to install Ubuntu with and boot into a live session. Make sure you have an Internet connection when doing so. Once you're in the GUI, open terminal. You will need to install some packages:
$ sudo apt-add-repository ppa:yannubuntu/boot-repair
$ sudo apt-get update
$ sudo apt-get install -y boot-repair

Once this is all said and done, run:
boot-repair

Click "Recommended Repair" and follow the wizard.

This should give you a bootable machine again.


How can I set up a UEFI-partition and THEN install Ubuntu 11.10 (or higher?

Thankfully, Ubuntu 12.04 finally fixes the bug that caused earlier versions to trash valid EFI System Partitions (ESPs). Thus, you can install 12.04 (relatively) safely, without undue fear that it will trash your existing EFI boot loader(s). That said, backing up your ESP is a good idea before any OS installation. You can do this in Windows by opening an Administrator terminal and typing "mountvol S: /S". This will mount the ESP as S:, so you can back it up. (It's just files on a FAT filesystem; unlike BIOS, EFI doesn't rely on code hidden in boot sectors.)

To more directly answer the first part of your first question, I can't say whether you should restore from HP's disks or install Windows in some other way. That's up to you, really, and your choice has more to do with your preferences for what's in your Windows installation than with how Ubuntu will react to it.

The second part of your first question is tricky to answer. Ubuntu will boot up in either BIOS mode or in EFI mode, and which one depends on your firmware and the options it provides to control the boot process. Many EFI implementations provide very poor user control over this matter, so it may be a bit hit-or-miss. In a worst-case scenario, though, Ubuntu will install in BIOS mode and you'll be able to convert from that to EFI mode by switching the boot loader. You might be able to force an EFI-mode installation by installing my rEFInd boot manager and booting the Ubuntu installer via rEFInd. (You may want rEFInd or something similar to switch between Windows and Ubuntu once everything's running, so installing it now can be beneficial in the long run.) By default, rEFInd shows only EFI-bootable OSes, including optical disc installers, in its menu, so if you boot the Ubuntu installer via rEFInd, you can be pretty sure it's running in EFI mode. It will then install grub-efi rather than grub-pc, so you shouldn't need to deal with the boot mode after installing.

Your second question is a little unclear to me. You can certainly partition your disk ahead of time, using either the Master Boot Record (MBR) or GUID Partition Table (GPT) partitioning scheme. You can also create an ESP ahead of time if you like. (In fact, I recommend doing this rather than letting Ubuntu create the ESP; Ubuntu's default ESP is about 1/10 the size it should be! I recommend using an ESP in the 200-500 MiB range.)


Goto Mouse&TouchPad Settings->Uncheck Natural scrolling.

It worked for me now my touchpad works completely fine.

And also try this this


How to prevent clone my application what hosted in Apache server using Ubuntu 16.04?

From the 10 immutable laws of security:

Law #2: If a bad guy can alter the operating system on your computer, it’s not your computer anymore
Law #3: If a bad guy has unrestricted physical access to your computer, it’s not your computer anymore

If they're able to boot with a live CD, law #3 is the obvious choice. As you're unwilling to use file system level encryption, law #2 is true as well. In conclusion: it's not your computer anymore, and nothing you do can stop someone with physical access from copying.

Host it in a data center you trust. Use Microsoft Azure or similar; they're rather unlikely to start stealing clients data, as what they sell is essentially the idea that they're at least equally secure when compared with in-house data centers. If you're paranoid, make them sign a Non-Disclosure Agreement.


Apparently, the root of problem is that i can't check my OpenGL version correctly.
This is the full output of glxinfo | grep "OpenGL" on my machine :
OpenGL vendor string: Intel Open Source Technology Center
OpenGL renderer string: Mesa DRI Intel(R) HD Graphics 2500 (IVB GT1)
OpenGL core profile version string: 4.2 (Core Profile) Mesa 20.0.8
OpenGL core profile shading language version string: 4.20
OpenGL core profile context flags: (none)
OpenGL core profile profile mask: core profile
OpenGL core profile extensions:
OpenGL version string: 3.0 Mesa 20.0.8
OpenGL shading language version string: 1.30
OpenGL context flags: (none)
OpenGL extensions:
OpenGL ES profile version string: OpenGL ES 3.0 Mesa 20.0.8
OpenGL ES profile shading language version string: OpenGL ES GLSL ES 3.00
OpenGL ES profile extensions:

I thought that my OpenGL version was 3.0 (OpenGL version string). It turns out there are two OpenGL version here, 3.0 and 4.2 (core profile).
According to this, on OpenGL 3.0, many OpenGL functions were declared deprecated. OpenGL 3.1 removed almost all the deprecated functionality in OpenGL 3.0. In 3.2, OpenGL was split into two : core and compatibility.  In the compatibility profile, the deprecated feature is still accessible, but we can't access the newer feature. The new features are implemented on the core profile, but the deprecated feature is removed.
This is probably similar to Python 2.7 vs Python 3.x. All past's deprecated features is still accessible if we are using 2.7, but we can't access the newer features. If we want to use the newer features, use 3.x, but we can't access the deprecated features.
In short, 3.0 is probably the compatibility version, and 4.3 is the core version. This is already satisfied the OBS's requirement (4.3 > 3.3). My OBS is working properly now.
Why glxinfo bothers displaying two version at once (3.0 and 4.3)? Probably because OpenGL makes it mandatory to implement the core, but the compatibility is not guaranteed to be available. By displaying two version at once, it tells us that this OpenGL implementation supports both compatibility profile and core profile.


As stated in Pear Manual and also explained the same here, it is PEAR Installer download Directory.

$ pear config-show
Configuration (channel pear.php.net):
=====================================
Auto-discover new Channels     auto_discover    <not set>
Default Channel                default_channel  pear.php.net
HTTP Proxy Server Address      http_proxy       <not set>
PEAR server [DEPRECATED]       master_server    pear.php.net
Default Channel Mirror         preferred_mirror pear.php.net
Remote Configuration File      remote_config    <not set>
PEAR executables directory     bin_dir          /usr/bin
PEAR documentation directory   doc_dir          /usr/share/php/doc
PHP extension directory        ext_dir          /usr/lib/php5/20090626+lfs
PEAR directory                 php_dir          /usr/share/php
PEAR Installer cache directory cache_dir        /tmp/pear/cache
PEAR configuration file        cfg_dir          /usr/share/php/cfg
directory
PEAR data directory            data_dir         /usr/share/php/data
PEAR Installer download        download_dir     /build/buildd/php5-5.3.6/pear-build-download
directory
PHP CLI/CGI binary             php_bin          /usr/bin/php
php.ini location               php_ini          <not set>
--program-prefix passed to     php_prefix       <not set>
PHP's ./configure
--program-suffix passed to     php_suffix       <not set>
PHP's ./configure
PEAR Installer temp directory  temp_dir         /tmp/pear/temp
PEAR test directory            test_dir         /usr/share/php/test
PEAR www files directory       www_dir          /usr/share/php/htdocs
Cache TimeToLive               cache_ttl        3600
Preferred Package State        preferred_state  stable
Unix file mask                 umask            2
Debug Log Level                verbose          1
PEAR password (for             password         <not set>
maintainers)
Signature Handling Program     sig_bin          /usr/bin/gpg
Signature Key Directory        sig_keydir       /etc/pear/pearkeys
Signature Key Id               sig_keyid        <not set>
Package Signature Type         sig_type         gpg
PEAR username (for             username         <not set>
maintainers)
User Configuration File        Filename         /home/cb/.pearrc
System Configuration File      Filename         /etc/pear/pear.conf


I can't find the Linux Version of Spotify in my Software center

The correct way to install spotify is open your terminal Ctrl+Alt+t and run those commands:

sudo apt-add-repository -y "deb http://repository.spotify.com stable non-free" &&
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 94558F59 &&
sudo apt-get update -qq &&
sudo apt-get install spotify-client

If everything finish with no error then you can be sure that it's installed in your system.

Now how to find it? Or how to run it?

Indeed you have to choices: CLI and GUI

1. For CLI:  Ctrl+Alt+t again to open terminal then run the command

spotify-client

2. For GUI: you don't have to search for it in Ubuntu software Center(USC) since sure you'll not find it there. USC is just a place to search for applications found in official repositories to find and install. Read this about https://wiki.ubuntu.com/SoftwareCenter.

Then now how to find the application. easily all what do you have is to open your dash by clickin on super key which is called "windows key" also, or with your  mouse click on the dash, then in the search field write spotify, this will brings you the application then just Enter to run


Ubuntu will not boot following upgrade mishap

I still had some questions (see list below) after reading your question. If you could edit/update your question to provide more details about your problem, it might help us work towards an answer. (As requested in the site FAQ, please do not reply with comments.)

What hardware are you using?
Aside from the problem description itself, this is the most pertinent piece of information you can provide. There are lots of people out there who have successfully installed Ubuntu. What is the most obvious difference between your situation and theirs? The hardware of the computer you are using. Please try to provide some additional information.
Did you previously have a version of Ubuntu installed and working on this computer?
I think you did, but it's not really clear.
Were you doing an upgrade from 11.10 (Oneiric Ocelot) to 12.04 (Precise Pangolin)?
Or were you upgrading some other version of Ubuntu to 11.10?
What instructions did you follow "to complete the upgrade"?
Does "update through the root" mean you used the chroot command as part of the instructions you followed?
Exactly what does happen when you attempt to boot, for example, the 12.04 Live CD?
If you press shift immediately after the system starts to boot from the Live CD, do you see either of the two menu's below?


Improperly set display when running a root crontab job involving GUI

You could configure sudo to not need a password for a particular
command and go back to using a non-root cron.
For this, assuming a user id of "user" wants to run the command FreeFileSync as root, create a file /etc/sudoers.d/user with

user ALL = NOPASSWD: /usr/bin/FreeFileSync

The command must be given with a full pathname. If you don't explicitly list the args to the command, then any args will be allowed by sudo.
Replace ALL by your hostname (not localhost) to be more secure.

This assumes file /etc/sudoers has the line: (note # is not a comment)

#includedir /etc/sudoers.d

If not, then just add the user entry to /etc/sudoers. Be careful editing this file: use visudo, or ensure you have root logged in or a shell running root to be able to do any repairs.

Your user crontab entry can then just have the command:

DISPLAY=:0.0 sudo /usr/bin/FreeFileSync /home/user/bu-1.ffs_batch 2>/home/user/bu-1.ffs_log

ubuntu sudo will preserve some environment variables for the command including DISPLAY and HOME (see output of sudo sudo -V) so the program will be able to read the ~/.Xauthority file (continue reading for details).

Alternatively, to keep using a root crontab:
if when you do ps alxww|grep X you find your X11 server running with an -auth option, something like this:

/usr/bin/X :0 ... -auth /var/run/lightdm/root/:0 ...

it means clients must connect using the secret in the file /var/run/lightdm/root/:0. This file holds a copy of the secret in the user's ~/.Xauthority file.
This "secret" is just an arbitrary random number.
If you are root you can read both files, so your client can simply provide in the environment:

XAUTHORITY=/var/run/lightdm/root/:0

Alternatively, you can set the HOME to that of the user of the display,
HOME=/home/user so that the right .Xauthority file is found there.

Alternatively, you can export the secret from this to root's home:

xauth -f /home/user/.Xauthority nextract - localhost/unix:0 | sudo xauth -f /root/.Xauthority nmerge -

and then XAUTHORITY=/root/.Xauthority or just HOME=/root.


How to enable or disable -updates, -security, -backports, -proposed repositories from commandline?

Note: I need a solution without direct editing of /etc/apt/sources.list.

Would using find and sed to comment out the lines be considered direct editing?

To disable these lines:

find /etc/apt -type f -name '*.list' -exec sed -i 's/\(^deb.*-backports.*\)/#\1/; s/\(^deb.*-updates.*\)/#\1/; s/\(^deb.*-proposed.*\)/#\1/; s/\(^deb.*-security.*\)/#\1/' {} +

Alternatively, we can just delete them:

find /etc/apt -type f -name '*.list' -exec sed -i '/-backports/d; /-updates/d; /-proposed/d; /-security/d' {} +

To enable them again:

find /etc/apt -type f -name '*.list' -exec sed -i 's/^#\(deb.*-backports.*\)/\1/; s/^#\(deb.*-updates.*\)/\1/; s/^#\(deb.*-proposed.*\)/\1/; s/^#\(deb.*-security.*\)/\1/' {} +


How do I set up Ubuntu 16.04 on my HP Mini so that it automatically connects to my WiFi?

I suggest that you blacklist the module. From the terminal:

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

Reboot and let us hear your result.


Open System monitor and click on File system tab you will see all the Drive info there like this:

And when you open any directory under home directory you will see some info on the status bar. like this:


Somewhat hand-wavy answer...

The BIOS looks at drives (floppies, harddrives, USB sticks, etc) and searches for a Master Boot Record.  The MBR is usually the first 512 bytes of a disk and contains the partition table for the drive and part of GRUB (the Grand Unified Boot Loader).

This first GRUB stage is then run and ultimately handed off to another GRUB stage outside the tiny 512 byte MBR.

This then runs the kernel which in turn runs init which leads to a nice running Linux system.

I'm sure there some details in between, but that's the basics.


Where does Ubuntu 14.04 log SSH access attempts?

All login attempts are logged to /var/log/auth.log

Search for brute-force  SSH logins

Run this command:

grep sshd.\*Failed /var/log/auth.log | less

Search for failed connections

Run this command:

grep sshd.*Did /var/log/auth.log | less

UPDATE:

You should try restarting the syslog daemon to see if it starts to log to the correct file.

sudo service rsyslog restart

Once you have messages going to the auth.log it should start working.


I've had the same (annoying) problem. You have to manually change your audio-device settings in VLC's preferences. See the screenshot below:

To find your sound-card, use the following command in the terminal.

sudo aplay -l


How do I change the disk size with mkdosfs

If you bought a drive advertised to be able to hold 256 GB but that can only hold up 8 GB, you should return it and get a refund from the seller because they didn't sell the promised product. If the seller and/or manufacturer were willing to defraud you based on the size of the drive, who knows what other defects or dormant faults the drive has. I wouldn't trust it with anything even in the first 8 GB.

For a technical solution, instead of fumbling around with file system tools you should instead repartition the drive so that it's partition(s) only cover(s) the first 8 GB (or whatever size is working), then format the resulting partition(s) with whatever file system(s) you like. The respective file system tools will create file systems that span the entire target partition by default.

You can use your favourite partition manager (e. g. Gnome Disks, KDE Partition Manager, GParted) to repartition the drive. I'll give you two command-line based examples below because they're easy to reproduce. Let's assume that the drive in question has the kernel name /dev/sdz.

Using fdisk

Start fdisk and point it to the drive:

sudo fdisk /dev/sdz

Replace the partition table with a new one (menu option o).
Create a new partition (n),

make it a primary partition (p),
make it the first partition (1),
choose the first sector at the suggested offset of 1 MiB (2048 or no entry),
choose the desired size of 8 GiB (= 8192 MiB) minus the 1 MiB from above (+8191M),

(optionally) print the resulting partition table to verify you did as intended (p),
(optionally) set the partition type to "W95 FAT32 (LBA)"1 (t, then c)
write the new partition table to the device (w),
ask the Linux kernel to reread the partition table:

sudo partprobe /dev/sdz

Using sfdisk

If you don't want to go through a bunch of menus you can also use sfdisk to specify a partition table (set size_gb to the desired size in GiB):

size_gb=8

sudo sfdisk /dev/sdz <<EOF
unit: sectors
: start=2048, size=$((($size_gb << 21) - (1 << 11))), Id=c
EOF

Like with fdisk you need to ask the kernel to reread the partition table:

sudo partprobe /dev/sdz

1 The default partition type for new partitions created with fdisk is "Linux" but both types should be fine. All major operating systems (Linux, Windows and OS X) will recognise the partition content correctly with either partition type. There are some corner cases with third-party tools that choose to expect a particular partition type for whatever reason.


It does nothing because there is no GUI calendar application installed.Install evolution (GUI for evolution-data-server calendar).

sudo apt-get install evolution

After that it will work.


It is a bug, I experience too. I hope it is this one:
https://bugs.launchpad.net/ubuntu/+source/network-manager/+bug/1418077
(as this is reported to be fixed in vivid)

A list of open bugs related to ofono can be found here:
https://bugs.launchpad.net/ubuntu/+source/ofono/+bugs?orderby=-importance&memo=75&start=0&direction=backwards

Generally for reporting bugs with the phone, a good starting point is here:
https://wiki.ubuntu.com/Avengers

The phone/OS might still be a little rough on the edges, but it is getting better with each update.


`nslookup` fails—but works if I specify the default DNS server. Isn't it the same?

There are two ways:

Quick simple hack is to add the entry into /etc/hosts like so

91.189.88.149    ca.archive.ubuntu.com

But that should only be a temporary solution.
Fix your resolv.conf file:
Why does my resolv.conf file get regenerated every time?
and How do I get resolvconf to regenerate resolv.conf after I change /etc/network/interfaces?

When fixing your resolv.conf file, make sure that your router (local DNS server) is specified as the first one, then add a backup like google (8.8.8.8) or openDNS or comcast or your other favorite DNS provider.


database import error using pgadmin 4 v4.28 in ubuntu20.4

If this is already on the same machine, rather than upload again, you should be able to import it directly into PostgreSQL:
psql -U {username} {database} < data_dump.sql

Be sure to change {username} and {database} for your needs.


Is it possible to update Ubuntu-phone dailys without wiping userdata?

Yes. The ubuntu-system image includes an Over The Air (OTA) update mechanism which doesn't delete user data. Go to System Settings and you'll find an "Updates" option.


How to sync other files than the ubuntu one folder in Windows?

From the UbuntuOne for Windows FAQ:

What folders on my computer can I sync with my personal cloud?
All files and folders placed within the “Ubuntu One” folder will be synchronized. We will expand this functionality in the future to match the Ubuntu desktop where you can enable any folder in your home directory for sync.

Right now you can not sync any folders outside of the UbuntuOne folder on Windows, but the developers are working on it.


How would I use Deja Dup on a password protected SMB share?

Here it is how it works for me:

In Deja Dup open Storage tab and choose Windows Share from drop-down list.
In Server enter ip address of your samba server.
In Folder enter path to path to directory where you want to store your backup.
In Username enter your samba username.
In Domain Name enter domain in which your samba server resides.

The only problem is that Deja Dup wants password every time it makes a backup. I guess solution is to mount samba share using fstab.

Hope it helps.


pwgen   generates random, meaningless but pronounceable passwords. These passwords contain either only lowercase letters, or upper and lower case mixed, or digits thrown in. Uppercase letters and digits are placed in a way that eases remembering their position when memorizing only the word. .

Install pwgen  with the button below:

e.g.

sudo apt-get install pwgen
pwgen


installing ubuntu with full disk encryption including encrpyted boot on i-USB Pendrive ii-A regular HDD

It's extremely useful to have an "on-the-go" Ubuntu running on USB with full disk encryption. Imagine you can boot up on almost every computer with your USB, and work in your own personalized environment anywhere, without carrying a notebook. I managed to install Ubuntu 16.04 in a USB HDD this way:

Download the latest Ubuntu installer.
Make a bootable pendrive. I use LiLi on Windows and dd command on Linux. You can google it.
Boot up from Ubuntu pendrive. The Ubuntu installer detects the internal HDD and offers to install Ubuntu and keep the other OS, or make a clean install, optionally with encryption. However, this window only shows the internal HDD. If you want to install to USB, you have to select the "Other" option. But it is really hard to setup an encrypted install manually.
I did the following: take out my internal HDD from my notebook, and boot up Ubuntu installer again. If the USB drive is connected, but the internal HDD is taken out, the installer will display the USB drive as primary drive and offers to make a clear install with encryption. You can also choose to overwrite your disk before install if you want.
Start the installation with your preferred options. Same as usual from now on.

I tested my USB Ubuntu on 5 different computer from old to "new" and it works like a charm. No problem with drivers, not a single error or question window when I boot up on a different PC.


Check out here: Can I reorder an application search result?

The user had a similar problem (possible dupe?) and the top answer should solve your problem, or at least help you along the way to solving it!


Blender/GPU issue, system not running AMD proprietary drivers

You have to do a little post-install in order to Blender see your GPU. Add your user to video and render groups.
sudo usermod -a -G video $USERNAME
sudo usermod -a -G render $USERNAME


Compiling on Ubuntu (10 or 11) 32 bits for Debian 6 64 bits

It depends. In such cases usually dependencies may be an issue. If You install x64 system, by default it loads x64 libraries. And it may lack x32 libraries. However, usually it is no problem to apt-get necessary 32 bit libs.
I would reccomend to write very simple program like Hello World, compile it for x32 as You wish and try to run it on Debian x64.
In my opinion this is the right point to begin.

Regards


How do I run similar commands with files in ten separate folders?

You can use a shell loop for this. I'll show the code first but please read the caveats below before you use it.

#!/bin/bash

for i in {001..010}; do
    gd2e.py -mkTreeS myKinTree
    rm /myKinTree/ppp_0.tree
    cp /home/user/GipsyX-1.1/share/gd2e/DefaultTreeSeries/myKinTree/ppp_0.tree  /myKinTree/
    rinex2staDb.py "y2015/d${i}/hyde${i}0.15d.Z"
    rnxEditGde.py -data "y2015/d${i}/hyde${i}0.15d.Z" -rate 30
    gd2e.py -drEditedFile data.dr.gz -recList HYDE -staDb fromRnx.sta_db -HighRate -trees myKinTree/
done

You may well need to modify this script. You should look it over to ensure that each place you want values from 001 to 010 plugged in, there is an ${i}, and that there are no ${i}s anywhere else. I also recommend backing up all files that would be affected by running it.

You mentioned that you need to run commands "In each dXXX folder" but you're using paths that themselves have prefixes like y2015/d001/. So I have assumed that you actually do not want to cd into each directory--doing so would keep those paths from working.

You can save that in a file script. (You'll probably want to call it something meaningful, but I don't know a good name because I don't know the wider context in which you're running these commands.) Then make the script executable with chmod +x script and run it with ./script.

This uses a for loop (with brace expansion) and parameter expansion. I've written ${i} rather than $i because in some places in the script, such as hyde${i}0.15d.Z, writing $i instead would attempt to expand a different (presumably unset) variable $i0. The braces in ${i}, which is a simple usage of parameter expansion, don't mean the same thing as the braces in {001..010}, which is a range for brace expansion.


PC freezes after long period of inactivity (~> 30 min)

Its a bug,
ubuntu 12.04 completely freezes frequently
You can also look at ubuntu 12.04 freezes


I have the same problem with Sony WF-1000XM3. They are quite silent on Ubuntu 20.04. Latest Sony firmware update added ability to control volume directly on earphones and it helps. Unfortunately you lose possibility to use other functions on one of earphones.


How to recover files after deleted my Ubuntu partition?

I would recommend Recovery using TestDisk.

Boot Ubuntu from Live USB drive or CD, , run

sudo apt-get install testdisk

TestDisk is used to recover missing partitions and repair a corrupted one. It served me well in recent past to recover entire Hard disk , so i am suggesting it.

After installing ,open Terminal and run sudo testdisk to get this

Select the create to create new log file ,select the Hard disk you want to recover , Proceed upon selecting the Disk

Then select the Intel option , Enter to proceed further.

Analyse to search for Lost Partition

Then it will list the Current Partition Structure , select the Quick search option to list the Deleted partition .

If Found Nothing then select the Deeper search option to list the deleted partitions. It will probably list all the partitions created since the Disk was First used. You have to be extremely careful here.

For more in-depth instructions refer this Step-By-Step guide .If found proper listing of partitions , select the Write option and Reboot to see the changes. Best of Luck .

Also refer below options before trying this above , here

How to recover deleted files?

Mitch's answer here for RAW data recovery

Ubuntu help page on Data Recovery


How to delete empathy chats - cannot find log file

Those are stored in ./.local/share/Empathy/logs/ if stored locally (at least on older Ubuntu versions is was; have not used it a lot after I installed 14.10). If they are stored remotely this is probably the method to use (kudos to Corbin052198@ubuntuforums):

Open the Empathy Buddy List.
Right-click on a user name, and click on 'Previous Conversations'.
Somewhere under the menus is an option to delete all chat history.
Select which accounts you want to clear the history of (or chose all of them) and click Clear.


Why doesn't resolv.conf remember dns addresses?

If you are running an Ubuntu system prior to 12.04 that hasn't yet been upgraded to 12.04 or later, or if you have removed the resolvconf package then install the resolvconf package.

sudo apt-get install resolvconf

If resolvconf was already installed, ensure that /etc/resolv.conf is a symbolic link to ../run/resolvconf/resolv.conf.

sudo dpkg-reconfigure resolvconf

Once you have installed the dnsmasq package (not to be confused with the dnsmasq-base package) you do not need to edit /etc/resolv.conf. The dnsmasq initscript causes (via resolvconf) '127.0.0.1' to be added to resolv.conf when dnsmasq starts, provided the value of IGNORE_RESOLVCONF is not set to yes in /etc/default/dnsmasq.

Doubters, please read /etc/init.d/dnsmasq.

P.S. In Ubuntu 12.04 there is a complicating factor. NetworkManager by default starts a dnsmasq process which listens exclusively on 127.0.0.1. This conflicts with the "standalone" dnsmasq process; only one of the two can start. This is a known bug, #959037, which was fixed in Ubuntu 12.10 (by moving NM-dnsmasq's listen address to 127.0.1.1). If you are still running Ubuntu 12.04 and you want to run standalone dnsmasq then you should either disable the NetworkManager-controlled dnsmasq (by commenting out "dns=dnsmasq" in /etc/NetworkManager/NetworkManager.conf) or configure the standalone dnsmasq not to listen on 127.0.0.1.


The problem originally stems from running SSH with X forwarding (SSH -X) when connecting to the server. This sets $DISPLAY which blocks GPU detection.

Once I realised this it became apparent that due to restrictions in Ubuntu (and probably other distros), BOINC has to be run as the logged-in (via X) user.

Assuming the user is user1:

sudo service boinc-client stop
Change BOINC_USER=boinc to BOINC_USER=user1 in /etc/default/boinc (some parts of the init script can be cleaned up too)
Add "sleep 10" to startup() in /etc/init.d/boinc-client to allow the user to log in (needed)
sudo chown -R user1: /etc/boinc-client/*
sudo chown -R user1: /var/lib/boinc-client
sudo service boinc-client start

BOINC now correctly detects the GPU and crunches work units accordingly.


tar -zxf filename.tgz

should do it

However, if the tarball contains sourcecode which you have to build I'm afraid you won't be able to avoid installing developer packages that will allow you to build the package from source.
Providing the link/driver you are talking about could shed some more light on what the problem is (maybe there are alternatives to install it).

Also: you can download the packages and copy over USB stick, and move them to your laptop and install them with dpkg -i packagename.deb so internet is not necessary, but very helpful.


/var/log/syslog constantly logging errors, growing at 1 MB/s

You have the latest hardware - Skylake came out Q3-2015, Z170 board as well. The 4.2.0 kernel came out at the same time, so development for it was before board and CPU were widely available. Mint 17.3 is based on Ubuntu Trusty, which is even older.

Try with a Live CD of Ubuntu Xenial to see if your hardware is better supported by kernel 4.4.0. If you want to have the latest hardware, you better run the latest Linux on it for best support.

Even the current beta of 16.04 probably is a better fit for your system, with less issues.

EDIT: To have a quick fix for the issue at hand, do sudo echo "disable" > /sys/firmware/acpi/interrupts/gpe6F. This should temporarily disable the GPE and get rid of the messages. You probably need a BIOS update to fix the issue.


Is there a way to schedule aptd to check for updates only at certain times?

Sure you can use Gnome Schedule to set any activity to be executed at the time you want.

It is in the official repo:

  sudo apt-get install gnome-schedule

or check it in the USC.

Then launch it and create new task that launches recurrently.

You can add a description and 'update-manager' as command, finally in advanced time and date you can set when precisely start your task.

Hope it can be helpful for other tasks too.

Obviously you had to set Update Manager to never check for updates from its own settings menu or it will not stop to pop up.


How do I install Odoo All-in-one (ERP, CRM) management software

How to install Odoo 11 All-in-one management software on Ubuntu

1. Install Odoo

Here are presented two alternative methods of Odos's installation - from the GitHib project and from the repository.

1.A Install Odoo from the repository. This should be the preferable way.

Install the dependencies, add the repository and its key, update the system and install the package:

sudo apt update && sudo apt install postgresql
wget -O - https://nightly.odoo.com/odoo.key | sudo apt-key add -
echo "deb http://nightly.odoo.com/11.0/nightly/deb/ ./" | sudo tee /etc/apt/sources.list.d/odoo.list
sudo apt update && sudo apt upgrade && sudo apt install odoo

With this configuration you can control the service by the commands:

sudo systemctl status odoo.service
sudo systemctl restart odoo.service
sudo systemctl start odoo.service
sudo systemctl stop odoo.service

The main configuration file is: /etc/odoo/odoo.conf.

1.B Install Odoo from the GitHib project. If you've followed 1.A skip this step - go to 2.

This section uses Yenthe V.G's installation scrip. I found this approach in the article: Install Odoo 11 on Ubuntu 16.04....
Download odoo_install.sh:

wget https://raw.githubusercontent.com/Yenthe666/InstallScript/11.0/odoo_install.sh

Edit odoo_install.sh and modify the parameters, under the section #fixed parameters:

OE_USER will be the username for the system user, the default one is odoo.
By default the script will create user's home directory /<odoo user>. You could leave the following values as default, but I would prefer /home/<odoo user>:

OE_HOME="/home/$OE_USER"
OE_HOME_EXT="$OE_HOME/${OE_USER}-server"

INSTALL_WKHTMLTOPDF set to False if you do not want to install Wkhtmltopdf, if you want to install it you should set it to True.
OE_PORT is the port where Odoo should run on, for example 8069.
OE_VERSION is the Odoo version to install, for example 11.0 for Odoo V11.
IS_ENTERPRISE will install the Enterprise version on top of 11.0 if you set it to True, set it to False if you want the community version of Odoo 11.
OE_SUPERADMIN is the master password for this Odoo installation. The default pass is admin.

Make odoo_install.sh executable and execute it as root:

chmod +x odoo_install.sh && sudo ./odoo_install.sh

You could control the application by the commands:

sudo /etc/init.d/odoo-server restart
sudo /etc/init.d/odoo-server start
sudo /etc/init.d/odoo-server stop

The configuration file is: /etc/odoo-server.conf.

2. Proceed the installation of ODOO through a supported web browser

3. Reverse proxy

In order to access your Odoo application only by using your domain name, without the port number in the URL, or through HTTPS, you need to set up a reverse proxy:

To use Apache as Reverse proxy - follow step 7 from the article Install Odoo 11 on Ubuntu 16.04 with Apache as a Reverse Proxy.
To use Nginx as Reverse proxy - follow the Section HTTPS from the Odoo's  documentation.
stunnel4 also could be applicable...


Using Thunar (XFCE): https://bbs.archlinux.org/viewtopic.php?id=194464

Using Dolphin (KDE): http://ubuntuforums.org/showthread.php?t=1882254

Please post what file manager you are using.

EDIT: Script #1's lines appear to have $s before them. Remove those.


You can use the dd command.  You can save the disc as ISO, and then you can mount and play.  just press Ctrl+Alt+T on your keyboard to open Terminal. When it opens, run the command(s) below:

sudo dd if=/dev/sr0 of=~/<file_name>.iso


How to fix "PKG_PROG_PKG_CONFIG: command not found" error?

The PKG_PROG_PKG_CONFIG variable refers to a macro pkg.m4 that is provided as part of the pkg-config package, so the first thing to check is that pkg-config is installed and that the macro file is in the default location (and is readable, of course)

dpkg -l pkg-config

ls -l /usr/share/aclocal/pkg.m4

If that checks out, then the question becomes why is aclocal not finding it? You can check where aclocal is configured to look for third-party m4 files using the --print-ac-dir switch i.e.

aclocal --print-ac-dir

If that's not the same as the location above, it suggests there is a non-standard version of automake on your system - if you can't resolve that, then a possible workaround is to set or export the ACLOCAL_PATH environment variable before running the autogen.sh script e.g.

ACLOCAL_PATH=/usr/share/aclocal ./autogen.sh

or

export ACLOCAL_PATH=/usr/share/aclocal
./autogen.sh
./configure

See the macro search path section of the GNU automake manual.


Low graphics error, asking for some command to fix it

You can easily solve this problem after your installation.  If you are connected to the internet when you perform your install you will get all updated packages.

Once you boot into Ubuntu you can go to system settings and then click additional drivers this works most of the time with video cards.

If you post your video card model we can look and see if it will work with Ubuntu.


realised what was happening. this was made out of a computer that was dissassembled (i was bored ok) and reassambeled without its laptop screen ( using a monitor) but the motherboard was still trying to output some visuals to that laptop screen which is why most of my programs like wine and steam wont show but will show in dash bar.

with this considered ill give ubuntu another chance

p.s. bios button is f2 grumpy mumble


How do I restore a browser session in Firefox?

I believe you are referring to Firefox. You can simply click History in the toolbar then Restore Previous session, or to make this permanent, go to Edit->Preferences (Or tools->options, I am not sure about your version), and under General, select to "Show my windows and tabs from last time".


How to know which sdb is a USB pendrive?

Using find and awk

#!/bin/bash

# your code ...

# The name of your MAXimum 1 drive in /media/$USER
maximum1="MAXimum 1"

if [ -z "$(find /media/$USER/ -maxdepth 1 ! -path /media/$USER/ -type d |\
    awk '! /'"$maximum1"'/')" ]
then
    echo "Hey, the only USB device is $maximum1"
else
    echo "Hey, no USB pendrive in my I/O."
fi

# your code ...

Example

% ls -laog /media/$USER

total 24
drwxr-x---+ 3  4096 Aug 20 15:16 .
drwxr-xr-x  5  4096 Aug 18 08:43 ..
drwxr-xr-x  8 16384 Jan  1  1970 STORE N GO

% maximum1="STORE N GO"; if [ -z "$(find /media/$USER/ -maxdepth 1 ! -path /media/$USER/ -type d | awk '! /'"$maximum1"'/')" ]; then echo "Hey, the only USB device is $maximum1"; else echo "Hey, no USB pendrive in my I/O."; fi
Hey, the only USB device is STORE N GO

% maximum1="NOT STORE N GO"; if [ -z "$(find /media/$USER/ -maxdepth 1 ! -path /media/$USER/ -type d | awk '! /'"$maximum1"'/')" ]; then echo "Hey, the only USB device is $maximum1"; else echo "Hey, no USB pendrive in my I/O."; fi
Hey, no USB pendrive in my I/O.


How to create partition from running onepartition?

You can resize easily the partition with the ubuntu live cd.

You just select Try without installing then you run the tool gparted and resize your partition to which size you want.
Then you can make another partition with the free space.

To recover data lost during installation I don't know any tool.


Can I share my home directory between Ubuntu and another Linux OS?

There will definitely be complications unless you choose separate users for Ubuntu and SUSE. If it's the same username, you will have problems with your user configurations being overwritten, conflicting and what not, even if you are using "more or less" the same programs.


Probably this is due Compiz setting of the current user - for some reason they are mixed. We can experience similar issues when tring to tweak our desktop by using the package compizconfig-settings-manager.

An easy way to examine whether this is the issue is to login as another user - probably the icons will look as normal.

If you are delete all Compiz settings and logout/login, Ubuntu will create them with their default values. Another way is to copy the configuration files from another user's home directory.

You can use the following commands to find all directories related to Compiz and respectively to delete them (where ~ stands for the path to the current user's home):

find ~ -type d -name "*compiz*" -ls
find ~ -type d -name "*compiz*" -delete


Ubuntu Server HWE Kernel future releases

Look at the kernel in the current releases of Ubuntu.
The same kernel will be in HWE three months later.
Kernel         Release               20.04 HWE
5.8         20.10 (Oct 2020)     20.04.2 (Jan 2021)
5.11        21.04 (Apr 2021)     20.04.3 (Jul 2021)

However, this applies only to the most recent LTS release of Ubuntu. Older LTS HWE ceases when a newer LTS becomes available.
Release   Original Kernel  Highest HWE Kernel
16.04 LTS     4.4               4.15
18.04 LTS     4.15              5.4
20.04 LTS     5.4               5.8 (HWE still active until 22.04)


Xubuntu 16.04 freezes during intensive computation

Do you have disk activity during those times? (ie. being ram hungry as you describe, it's page faulting regularly and needing to go to swap)

You may find altering the swappiness value may improve things a little (ie. the level of which it uses swap; normally 60(%). I'd suggest reducing to 10-30 but adjust for your hardware & requirements).

If you're not familiar with swappiness; refer

How do I configure swappiness?

The gui slows when the system is overloaded; esp. if the page needed by a gui process isn't there (page-fault) and it has to wait for it to be reloaded from swap.

Yes you can have swap on ssd; pro's & con's (mostly pros in your case). I'd suggest a better choice maybe offloading/moving your python-processing to another [remote] machine you control from your device, or if you don't have another box, try and limit yourself to terminal apps that use less resources whilst your large python job(s) are running. The python job is your problem, not Xubuntu


How to make a Snap application (ksnip) appear in "open with other application" context menu?

The nautilus right-click menu only picks up applications that are set to launch with an argument, the file name. The .desktop file that comes with the snap is not properly configured in that respect.
• Copy the supplied .desktop file, /var/lib/snapd/desktop/applications/ksnip_ksnip.desktop, to your private ~/.local/share/applications folder.
• Edit your new ~/.local/share/applications/ksnip_ksnip.desktop with a text editor, and add %U after the command to execute the program, so it looks like:
Exec=env BAMF_DESKTOP_FILE_HINT=/var/lib/snapd/desktop/applications/ksnip_ksnip.desktop /snap/bin/ksnip %U

• Wait a little and try the right-click menu option of Files again. You may need to exit and restart Files. It should now be listed among your programs.


How to get best quality audio using youtube-dl?

All informations are described in the man page:

From man youtube-dl

--audio-quality QUALITY
  ffmpeg/avconv audio quality specification, insert a value between 0
  (better) and 9 (worse) for VBR or a specific bitrate like 128K (default 5)

-f, --format FORMAT
 video format code, specify the order of preference using slashes, as in -f
 22/17/18 . Instead of format codes, you can select by extension for the
 extensions aac, m4a, mp3, mp4, ogg, wav, webm. You can also use the special
 names "best", "bestvideo", "bestaudio", "worst".


How can I wait in the .profile script until all devices are mounted?

How about running a script as a daemon?

#!/bin/sh
while true; do
    if mountpoint -q /media/rene/DEVICE_NAME; then
        export device_mounted=yes
    else
        unset device_mounted
    fi
    sleep 30
done

Edit:

With the clarification in your edited question, we can simplify the script a bit:

#!/bin/sh
while true; do
    if mountpoint -q /media/rene/DEVICE_NAME; then
        export device_mounted=yes
        break
    fi
    sleep 30
done

Save that somewhere as e.g. device-check.sh and make the script executable:

chmod +x /path/to/device-check.sh

Then add this line in ~/.profile:

/path/to/device-check.sh &

The trailing & character is essential. It makes the script start as a separate process, allowing the login process to continue.

After this the script starts at login and checks every 30th second if the device is mounted. If/when the script finds that the device is mounted, it sets the environment variable and ends.


Yes edit /etc/default/keyboard to set the global settings or ~/.dmrc for per-user settings.

Example /etc/default/keyboard:

 XKBMODEL="pc105"
 XKBLAYOUT="fr,us"
 XKBVARIANT="oss"
 XKBOPTIONS="compose:ralt,terminate:ctrl_alt_bksp"

Example ~/.dmrc:

 [Desktop]
 Language=de_DE.UTF-8   # change to your default lang
 Layout=de   nodeadkeys # change to your keyboard layout

In either case, will need to also run:

 sudo udevadm trigger --subsystem-match=input --action=change


Temporary fix until Oracle fix it:

sudo add-apt-repository ppa:olivier-berten/misc
sudo apt-get update
sudo apt-get install mysql-workbench-gpl


I think it is possible. Here is a community tutorial on Linux Mint about doing so .

The caveat is that you may have problems depending on the level of customization you had, as well as package conflicts and other such problems. The comments on those articles suggest that the procedure mostly works, with some known definite issues.

The procedure, in this case, is simply to update entries in /etc/apt/sources.list to use the newer release (perhaps from a newer version of the derived distro), and run:

sudo apt-get update
sudo apt-get dist-upgrade

Oddly enough, the tutorial lists sudo apt-get upgrade as a step again after the dist-upgrade (to what end I do not know).

This really depends on how much customization the derivative does. For example, Ubuntu is often said to be based on Debian, but there is only a loose correlation or connection between Ubuntu and Debian releases.


How to build .deb package that adds a GUI program to session startup?

Autostart an application for all users
To autostart an application, either which user logs is, you can store a .desktop file in /etc/xdg/autostart.
Automatically start up an application from a launcher in/etc/xdg/autostart will also:

give individual users the opportunity to unset autostart. The .desktop file will be automatically copied from /etc/xdg/autostart to ~/.config/autostart if the user disables autostart from Startup Applications. The local autostart .desktop file will then overrule the one in /etc/xdg/autostart
have the advantage that the application autostarts by default for newly created users.


If it's only for web, you can change the scroll speed in FireFox:

Edit menu > Preferences > Advanced tab > Browsing group: disable smooth scrolling

Fine-tuning:

Type enter about:config in the address bar
Find and change mousewheel.withnokey.sysnumlines to FALSE
Then change the mousewheel.withnokey.numlines from 1 to whatever you want.
For Firefox versions 73.3.1 and later: - change the mousewheel.min_line_scroll_amount from 1 to whatever you want.

And a more general, system-wide solution:

For touchpads, some drivers allow customizing scroll sensitivity, like GPointingDeviceSettings (GSynaptics successor).
For mice, currently Gnome offers no way for a user to adjust a mouse wheel speed. It's a known wanted feature, triaged as WishList. A solution would be to use some hacks, or really dig deep into a mess of configuration files, and possibly some recompiles. Not fun if you need to adjust the value until you find a comfortable one.


Install the "32-Bit / 64-Bit Multiarch" version. It works on my system flawlessly. Do not install the 64bit only version.

http://www.teamviewer.com/en/download/linux.aspx

After installing it, to install any extra dependencies, run this command in a terminal

sudo apt-get install -f

After installation has completed, go to terminal and type teamviewer without Sudo user and it will open up Teaviewer GUI.


Unable to install ubuntu desktop guest using KVM

So it turns out that the Ubuntu 10.10 desktop installer requires at least 512MB memory (according to some forum posts, I was unable to find an official system requirements page) and the 256MB I was giving the VM just wasn't cutting it.


How to create a complete recovery Image for my new netbook

dd --help

will show all the options you have. The commands below use if for input file and of for output file.

  Backup

A full hard disc copy can be created with any of these 3 commands:

dd if=/dev/hdx of=/dev/hdy
dd if=/dev/hdx of=/path/to/image
dd if=/dev/hdx | gzip > /path/to/image.gz

Where the x in hdx is the disc your want to copy and the y in hdy is the destination disc. The 1st one is basically copying the disc over to another disc. The last 2 make a file and the last one also zips the file.

  Restore

dd if=/path/to/image of=/dev/hdx
gzip -dc /path/to/image.gz | dd of=/dev/hdx

Where the x in hdx is the disc your want to restore the copy to. The 1st one restores the file  (backup option 2). The 2nd one restores the zip file (backup option 3).

dd does not make understand empty space and space filled with data but if you use the gzip version the file will be a lot smaller (it can be 10 times smaller).

Alternatives:

In the repositories there is also partimage

Partimage does not support ext4 or btrfs filesystems though and ntfs is in beta and thus experimental.

FSArchiver   is a system tool that allows you to save the contents of a file-system to a compressed archive file. The file-system can be restored on a partition which has a different size and it can be restored on a different file-system. Unlike tar/dar, FSArchiver also creates the file-system when it extracts the data to partitions. Everything is checksummed in the archive in order to protect the data. If the archive is corrupt, you just loose the current file, not the whole archive. As always ... ntfs support is considered experimental.

FSArchiver Quickstart
Comparison chart between partimage and fsarchiver. The latter does support ext4.


Annoying brightness thing on Dell Laptop

Ok, I solved the problem. It was really in the kernel...

In grub I booted with the 4.15.0-20-generic and the screen dim was gone.

Thanks!!


Setting Up Dell XPS 14 Ultrabook for Dual Boot

The most basic thing you need to do are disabling the UEFI,Intel Rapid Start (if any),and Secure boot.and also there is similiar case to you here

Installing Ubuntu Alongside a Pre-Installed Windows with UEFI

just jump directly to the top answer.it will help,a lot


Difference between systemctl and service commands

The service command is a wrapper script that allows system administrators to start, stop, and check the status of services without worrying too much about the actual init system being used. Prior to systemd's introduction, it was a wrapper for /etc/init.d scripts and Upstart's initctl command, and now it is a wrapper for these two and systemctl as well.

Use the source, Luke!

It checks for Upstart:

# Operate against system upstart, not session
unset UPSTART_SESSION
if [ -r "/etc/init/${SERVICE}.conf" ] && which initctl >/dev/null \
   && initctl version 2>/dev/null | grep -q upstart \
   && initctl status ${SERVICE} 2>/dev/null 1>/dev/null
then
   # Upstart configuration exists for this job and we're running on upstart

If that doesn't work, it looks for systemd:

if [ -d /run/systemd/system ]; then
   is_systemd=1
fi

...

# When this machine is running systemd, standard service calls are turned into
# systemctl calls.
if [ -n "$is_systemd" ]
then

And if that fails as well, it falls back to System V /etc/init.d scripts:

run_via_sysvinit() {
   # Otherwise, use the traditional sysvinit
   if [ -x "${SERVICEDIR}/${SERVICE}" ]; then
      exec env -i LANG="$LANG" LANGUAGE="$LANGUAGE" LC_CTYPE="$LC_CTYPE" LC_NUMERIC="$LC_NUMERIC" LC_TIME="$LC_TIME" LC_COLLATE="$LC_COLLATE" LC_MONETARY="$LC_MONETARY" LC_MESSAGES="$LC_MESSAGES" LC_PAPER="$LC_PAPER" LC_NAME="$LC_NAME" LC_ADDRESS="$LC_ADDRESS" LC_TELEPHONE="$LC_TELEPHONE" LC_MEASUREMENT="$LC_MEASUREMENT" LC_IDENTIFICATION="$LC_IDENTIFICATION" LC_ALL="$LC_ALL" PATH="$PATH" TERM="$TERM" "$SERVICEDIR/$SERVICE" ${ACTION} ${OPTIONS}
   else
      echo "${SERVICE}: unrecognized service" >&2
      exit 1
   fi
}

...
run_via_sysvinit

Since the service command is a fairly simple wrapper, it only supports a limited subset of actions compared to what the actual init system might provide.

For portability over various versions of Ubuntu, users can reliably use the service command to start, stop, restart or examine the status of a service. For more complex tasks, however, the actual command being used, be that initctl or systemctl or the /etc/init.d script might have to be used directly.

Further, being a wrapper, the service script in some cases also does more than the direct equivalent command might do. For example:

It always executes /etc/init.d scripts in a clean environment. (Note the long env command invocation in the run_via_sysvinit function above.)
It maps restart on Upstart systems to a combination of stop/start, since a plain initctl restart will error out if the service isn't running already.
It stops sockets when stopping systemd services which have associated sockets:

case "${ACTION}" in
  restart|status)
     exec systemctl $sctl_args ${ACTION} ${UNIT}
  ;;
  start|stop)
     # Follow the principle of least surprise for SysV people:
     # When running "service foo stop" and foo happens to be a service that
     # has one or more .socket files, we also stop the .socket units.
     # Users who need more control will use systemctl directly.

Upstart services were enabled directly in the service configuration file (or disabled via overrides), and System V scripts were enabled or disabled with the update-rc.d command (which managed symlinks in the /etc/rc* directories), so the service command was never involved in enabling or disabling services on boot.


Can’t get .desktop file to run python script

Try changing
Exec=/script.py
to
Exec=python3 /script.py

I have several Java programs that I run via .desktop files. Some even get executed on boot... Sorry so short, posting via my phone.


getting daily data consumption value from vnstat in JSON

vnstat has options to output in machine-readable formats. From man vnstat:

--json mode
  Show database content for selected interface or  all  interfaces
  in  json format. All traffic values in the output are in KiB. An
  optional mode parameter can be used for limiting the  output  to
  only  selected  information.   Everything  is  shown by default.
  Setting mode to 'h' will output only hours, 'd' days, 'm' months
  and 't' the top 10.

--xml mode
  Show database content for selected interface or  all  interfaces
  in  xml  format. All traffic values in the output are in KiB. An
  optional mode parameter can be used for limiting the  output  to
  only  selected  information.   Everything  is  shown by default.
  Setting mode to 'h' will output only hours, 'd' days, 'm' months
  and 't' the top 10.

Just do vnstat -i wlp2s0 --json d and parse it in Python to get whichever field you need. The -d is not needed, and will be ignored, since the --json option takes the mode argument.


"cannot determine current directory" while building Haskell in 13.04

Note that I would usually just do sudo apt-get install haskell-platform, which should just sort everything out. However it hasn't been packaged for 13.04 yet.

Get these dependencies, if you don't already have them:

sudo apt-get install -y libgmp3-dev freeglut3 freeglut3-dev

The Haskell platform seems to be looking for a libgmp.so.3, but the libgmp package only supplies libgmp.so, libgmp.so.10 and libgmp.so.10.0.5. The fix:

sudo ln -s /usr/lib/x86_64-linux-gnu/libgmp.so.10 /usr/lib/libgmp.so.3

(Disclaimer: This worked for me. Not sure if it's a sensible thing to do)


use rbenv

Install dependencies

sudo apt-get update
sudo apt-get install git-core curl zlib1g-dev build-essential libssl-dev libreadline-dev libyaml-dev libsqlite3-dev sqlite3 libxml2-dev libxslt1-dev libcurl4-openssl-dev python-software-properties libffi-dev

Setup rbenv

cd
git clone https://github.com/rbenv/rbenv.git ~/.rbenv
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bashrc
echo 'eval "$(rbenv init -)"' >> ~/.bashrc
exec $SHELL

git clone https://github.com/rbenv/ruby-build.git ~/.rbenv/plugins/ruby-build
echo 'export PATH="$HOME/.rbenv/plugins/ruby-build/bin:$PATH"' >> ~/.bashrc
exec $SHELL

git clone https://github.com/rbenv/rbenv-gem-rehash.git ~/.rbenv/plugins/rbenv-gem-rehash

rbenv install 2.1.0
rbenv global 2.1.0
ruby -v

use rbenv install -l to list all avilable ruby version

ref : gorails


Ubuntu Mate Raspberry Pi alongside Xenial on a Thinkpad?

You can't run any software for a Raspberry Pi on a Thinkpad because of the different CPU instruction sets (ARM vs. Intel-x86-compatible).

However, you can

set up a virtual machine that emulates a suitable ARM CPU on any architecture,
allow the virtual machine to access the SD card,
install Ubuntu for Raspberry Pi onto the SD card from inside the VM,
modify and configure the system inside the VM to your liking,
shut down the VM, disconnect the SD card, and
finally use the SD card as boot medium for a Raspberry Pi.


Blank screen ... no BIOS loading screen either

if you don't see a BIOS loading screen i doubt it is ubuntu's fault.

I never heared anything about a Nvidia driver destroying the firmware.

Maybe your BIOS is set to some sort of "Quick Boot mode" and "Show Logo = Off" mode?
You may try to press
 DEL or F2 according to your Bios.

Also check the Inputsource of your screen.


Unable to boot Ubuntu 12.04 LTS due to timeout=-1

Use a Live-CD/USB, and increase the timeout value to a positive number.

It may also be possible to mount your boot/root partition from OS X and make the change there.

For future reference, changes in /boot/grub/grub.cfg do not persist; you should edit /etc/grub/default instead.


Is it possible to set apt rather than snap to be the default?

The Ubuntu software store is an adapted version of Gnome software, packed as a snap. It should list both snap and APT packages if software is available in two formats. It lists the snap version first. There is –at least not a user exposed– possibility to prioritize APT packages in the listing, or not display one or the other.
To work around, you could revert to the Gnome software center. Install it with the command:
sudo apt install gnome-software

As such, only APT packages will be exposed. You can include snap packages, and eventually if you would be using it, flatpak by installing plugins:
sudo apt install gnome-software-plugin-snap
sudo apt install gnome-software-plugin-flatpak

Both software centers can co-exist, but you could remove the default Ubuntu software store with the command
snap remove snap-store


I have almost the same problem in my some years old MaxData laptop (nVidia GeForce Go 7400). Vertical stripes, mostly red, visible especially in BIOS / text mode screen, less in higher resolutions (1024x768). There are always about 5 stripes each 8 pixels apart, then a gap, then again stripes and so on. Additionaly when in text mode about 1/3 of all symbols are randomly changed so it looks like polnish (or any other weird language). It is always 2 characters are right, two may be changed,...
Because Windows as well as Ubuntu refuse to run with nVidia drivers (xorg works with software rendering), I suppose it is a problem with the graphics card. Maybe once it became too hot, I don't know. You said you swapped the GPU, do you mean the whole card or just the processor? Cause I could also imagine the video memory is responsible for this. Anyway, after months I finally gave up researching as it works good enough to do some programming, office, internet and even videos and 2d games, so I can live with it.


I recommend first to comment out or remove those 2 PPA which are not part the official repositories and are the ones giving you an error.

First install ppa-purge which is in the proposed repositories in case you don't see it:

If you don't have the proposed repositories enabled, you will not be able to do it with the error you have right now, so for the moment you will need to do the following:

Open the DASH and type sources, it should show you Software Sources. Open it and go to the Other Software tab. It should look something like the following image:

Start removing/disabling any PPA you do not need apart from the ones that gave you an error which were:

http://archive.canonical.com/commercial-ppa-uploaders/skype/ubuntu/dists/quantal/main/binary-amd64/Packages

http://archive.canonical.com/commercial-ppa-uploaders/skype/ubuntu/dists/quantal/main/binary-i386/Packages

http://ppa.launchpad.net/cooperjona/stormcloud/ubuntu/dists/quantal/main/binary-amd64/Packages

http://ppa.launchpad.net/cooperjona/stormcloud/ubuntu/dists/quantal/main/binary-i386/Packages

If you click on any of this links you will get as 404 error which means the source moved to another planet (It is gone!!). So look for this in your Other Software tab and remove them. After that remember to activate the Proposed repository and simply close Software Sources.
Now go to a terminal and: sudo apt-get update.

It should work now, if not, look at the error message and remove any following PPA that gives you trouble.


How to keep keyboard settings in the initial login screen? 17.04

I suggest that you open /etc/default/keyboard for editing and change the line starting with XKBLAYOUT to:

XKBLAYOUT="us+dvorak"

(I assume that there is currently something else.)

After next reboot, the Dvorak layout will hopefully be effective on the login screen.


Which bash profile file should I use for each scenario?

My suggestion.
Scenario 1:
Put your command in ~/.bashrc like this: [[ "$TERM" == "xterm"* ]] && run-command (test if terminal is xterm)
Scenario 2:
Put your command in ~/.bash_login (remember to source ~/.bashrc if you still want to run that)
Scenario 3:
Put your command in ~/.bashrc like this: [[ $- == *"i"* ]] && run-command (test if shell is interactive)
I use these options in my .bashrc, for more or less the same purposes you want, from what I understand.


How do I fix my wireless network that frequently disconnects and is inconsistent? (14.04)

When I first installed 14.04 I was having the same issue and have never had this problem with Ubuntu before. Updating the kernels eventually seemed to fixed the issue for me. You can make sure you are completely up to date by executing the following commands:

sudo apt-get update
sudo apt-get dist-upgrade


Add space to the previously assigned ubuntu

Well if you have a partition for ubuntu, then simply use Gparted from the ubuntu software center, it's very easy to work with.
If you don't have ubuntu in a partition then you have the same problem as me and I'm also searching for a solution.


Onboard wifi Adapter not working on Lenovo300 i5 skylake

I followed this:
Qualcomm Atheros Device [168c:0042] (rev 30) Wi-Fi driver installation

Specifically the post by Jeremy31 that starts with:

  You do not need Windows drivers and ndiswrapper

  This has been recently fixed upstream, follow the instructions to
  install the backported modules and needed firmware

Worked like a charm. :) Thank you!


Ubuntu 16.04, how can I share an unmounted disk/partition with windows machines in same lan?

In order to use the files, a partition must be mounted by some software.

You can mount the partition locally and then share the files and directories using samba (see this answer for a graphical setup).

It is also possible to share the partition on the network, and then mount it remotely, for instance using iSCSI.

In any case, the partition will be mounted either locally or remotely.


So turns out this is a result of deciding to encrypt my home directories, and placing the auth-sock there... This means when I fully detach from screen, my running programs lose access to my home directory, which breaks ssh-agent. It doesn't kill the ssh-agent process like deleting the socket normally does, and it doesn't remove the socket because it's in an encrypted directory that the machine can no longer access. This also manifests other oddities like my cron daemon not being able to run scripts in my home directory if I'm not logged in.


How can build relation between Rabbitmq-Server (as buffer for request interface) for my owm locla charm( process the requests)

If you want to write a charm, a good place to start is with the official documentation:

https://jujucharms.com/docs/stable/charms-deploying

Specifically in your case, you will need to add a requirement to your charm's metadata.yaml file to indicate that it needs to access the RabbitMQ interface of the rabbit charm.

 requires:
  amqp:
    interface: rabbitmq

You will then need to create hook files to manage the connection between your charm and rabbit. I would suggest also looking at the source for the rabbit charm, which will give you a better idea of what information it is possible to transfer using this service


dpkg-deb, how can I specify the architecture

never mind. Found the solution.
In the DEBIAN/control file, you need to provide the architecture as follows:
Version: ppc64el
and it runs fine on my Power machine.


Unable to boot or install ubuntu on an Alienware M17x R3 laptop

I had the same problem with my HP tx2000, I downloaded the alternate installer and it worked. it should let you at least install ubuntu.

If you still get a black or flickering screen after the installation, try changing the boot options:

If the menu doesn't appear and boots straight into Ubuntu, restart and press the Shift key until the menu appears.
Select the Ubuntu default kernel (usually the first option) and press the E key to edit.
Go to the end of the line that contains the kernel (starts with linux/boot/vmlinuz) by pressing End.
type nomodeset
Press Ctrl+X to boot

If that doesn't work, try using the option acpi=off.

Once you boot into Ubuntu, make sure you have internet connection. Ubuntu will detect and show you in a window the hardware that requires restricted (i.e not open source) drivers. It will then download and install them.


How to get a working UEFI / GRUB Boot - install process goes wrong

Additionally. This solution helped me. The key is the sda1(in my case) in which efi boot resides. Have to check it in /etc/fstab in your linux distro:

Identifying if an Ubuntu has been installed in UEFI mode

An Ubuntu installed in UEFI mode can be detected the following way:
its /etc/fstab file contains an UEFI partition (mount point: /boot/efi)
it uses the grub-efi bootloader (not grub-pc)
from the installed Ubuntu, open a terminal (Ctrl+Alt+T) then type the following command:

[ -d /sys/firmware/efi ] && echo "Installed in UEFI mode" || echo "Installed in Legacy mode"

If it shows: "installed in uefi mode" then you're home. Just few another steps.

Boot repair install:

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

sudo apt-get update

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

Note: Do not follow this procedure if your computer is already booting correctly. Use this procedure only if you believe you've accidentally installed Ubuntu in BIOS/CSM/legacy mode and you want it to boot in UEFI/UEFI mode.

Start Boot-Repair, click on "Advanced options", go to the "GRUB location" tab.

If you do not see a "Separate /boot/efi partition" line, this means that your PC does not have any UEFI partition.

In this case, exit Boot-Repair, then create an UEFI partition (see the "Creating an UEFI partition" paragraph above).

If you see a "Separate /boot/efi partition" line, tick it then click the "Apply" button.

Boot repair will ask to fire some commands during the installation. Fire them. Should go ok. If not perhaps wrong partition for grub is chosen.

Also like it has been written in this post the uncheck box "secure boot" in "Grub Options" TAB

Boot Repair UI view

Hope this helps in future threads. The key is to install /repair grub using this boot/efi separate partition. In other cases commands which boot-repair asks for don't work at all.

Usefull resources

Comprehensive guide to UEFI idea
Link 1


The "green screen" isn't Ubuntu specific.  My desktop's onboard graphics card died once, and it resulted in a green screen freezing everything.  It then subsequently hard crashed.

It sounds a lot like a dying graphics card.  The only thing you can really do is get a compatible graphics card for your system (or a replacement motherboard if it's an onboard integrated card) and see if the new graphics card being the only one running resolves the issues.

Note if the machine is a laptop, you'll have to contact the manufacturer of the laptop for parts and service.


http://en.wikipedia.org/wiki/Category:Free_mathematics_software

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

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

there is pretty much everything you can get for free here.


Remove script file from /etc/profile.d/ when can't login

In recovery mode, unless you use the root shell with networking option, you need to manually mount / for writing:

mount -rw -o remount /


Why is there no +mac download for 32 bit systems or for GNOME?

The +mac installers are for 64-bit only, since they deal with a problem with UEFI (only 64-bit supports UEFI now). So, there is no separate image for 32-bit. They still exist for 64-bit systems, and be located at an appropriate folder in http://cdimages.ubuntu.com, depending on the flavour. Right now, it seems only Lubuntu and the main Ubuntu images have them. This might because the only older Macs need it, and only these two flavours target them.

What is different about the Mac ISO image?


How to create a persistent USB Installation from MAC?

this is the solution for your problem...

http://studyblast.wordpress.com/2011/08/14/guide-mac-os-x-lion-how-to-boot-a-linux-live-system-from-a-usb-drive-how-to-update-any-ocz-ssds-firmware/

copy the file in a usb flash drive in fat32 create the folder efi inside efi create folder boot and inside efi/boot put 2 files the linux distro renamed boot.iso and the file bootx64.efi...reboot holding option and select usb device:done!


std::thread run time error "Enable multithreading to use std::thread: Operation not permitted"

gcc 4.8 had a bug related to this. You could try the workaround mentioned in the bug report: Add the flags

-Wl,--no-as-needed

to the compilation.


Bionic Beaver settings menu items missing

What has happened is that you have entered the "Details" section of Gnome Control Center. Since, Gnome Control Center now remembers where you last were, you're seeing this section every time you open it directly.

To get out of this section, simply click the "<" button next to details, and it will take you back to the list of configuration panels.


CS:GO will not launch on Ubuntu 16.04 with Radeon HD 7640G

Your card does not appear to be compatible with the AMD GPU PRO driver, so using it is likely why it didn't work. You should be fine using the default open source driver AMD GPU (not pro) that is available with the fresh install. So in short do after fresh install update your system sudo apt update and sudo apt upgrade. You can also use more up-to-date mesa package if you want, google for "ubuntu install mesa ppa" and look at obiaf or padako. Personally I didn't install either of these and I'm using AMDGPU driver (not pro) with RX 480, getting around 80fps on 1600x900 display (I'm stuck with an old monitor at the moment) but I've had it running at 1080p and 4k nicely before on a 4k TV that quit after 2 months (cheapie 4k tv so I'm saving to buy something a bit better).


How can I install lightdm-webkit2-greeter?

Well, that OBS repo is perplexing to me as well. I would build from source:

sudo apt-get update
sudo apt-get install python3-whither
sudo apt-get install liblightdm-gobject-dev
sudo apt-get install python3-gi
git clone https://github.com/Antergos/web-greeter.git /tmp/greeter
cd /tmp/greeter
sudo make install


How can I use Ubuntu Server 12.04.2 LTS as a mail server to be able to retrieve emails using MS outlook as the client?

You can use Mail Transfer Agent (MTA). Here is a nice guide: https://help.ubuntu.com/community/MailServer

Just saw, there is another good post on it on this forum: how-to-set-up-a-mail-server-correctly


Why is guake no longer displaying command prompt before $

In the Guake options, check that the 'Default interpreter' is . Also maybe check what your user shell is: 'finger ' should give it to you.


Open Update manager

click setting on lower left corner of the window..

go to updates tab

on the right bottom corner select from drop down -> "For any new version"

then close and then reopen Update Manager.

It should show you the option to upgrade.

If after performing these step it still does not work then type :

update manager -d

Link for more details : OMGUbuntu : how to upgrade from Ubuntu 12.04 to 12.10


This is what worked for me.

The following is the line in my fstab file.

//192.168.2.2/MVP /mnt/movies1 cifs username=media,password=yourpassword,defaults  0 0

The following is the mount command I used.

sudo mount //192.168.2.2/MVP

I hope this helps!


How to burn an ISO file larger 4.7 GB onto a DVD

It's just a matter of media.

If the DVD ISO you have to write onto the media is bigger than 4.7 GB, you can use double-layer DVD if your writer is able to support this kind of DVD.

Then you can put almost the double of 4.7 GB on a single double-layer DVD.
Of course, if the ISO size exceeds the size limit of a double-layer DVD, you cannot do anything more with a DVD.


screen turned upside down itself in ubuntu budgie 18.04.2 LTS

Your laptop has an accelerometer and if you tilt your laptop your screen orientation will follow.

This is standard - it is mainly for screens that can change its orientation.

You can disable this for your laptop by adding the rotation-lock applet from budgie-desktop-settings to your panel and activating it.

You don't need to permanently run the applet - you can remove it afterward if you want.


Cannot detect partitions during Ubuntu 18.04 install (dualboot with Windows 10)

Looking at the Ubuntu page for installing in UEFI mode here, I have disabled FastBoot and Intel Smart Response Technology in Windows. After that, the installation continued as expected.


dpkg: warning: 'tar' not found in PATH or not executable

I just solved it. I don't know how sustainable my solution is.

I copied tar from another machine's /bin/tar, then i CHMOD'ed it to 755 on my destination machine's /bin/tar.

now reinstalling tar via apt-get works flawlessly:

root@devubuntu:/usr/bin# sudo chmod 755 /bin/tar
root@devubuntu:/usr/bin# sudo apt-get install --reinstall tar
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
  xfonts-encodings php-console-table xfonts-utils libmcrypt4 libxfont1 xfonts-base php5-mcrypt
Use 'apt-get autoremove' to remove them.
0 upgraded, 0 newly installed, 1 reinstalled, 0 to remove and 7 not upgraded.
Need to get 0 B/218 kB of archives.
After this operation, 0 B of additional disk space will be used.
(Reading database ... 335218 files and directories currently installed.)
Preparing to replace tar 1.26-4ubuntu1 (using .../tar_1.26-4ubuntu1_amd64.deb) ...
Unpacking replacement tar ...
Processing triggers for man-db ...
Setting up tar (1.26-4ubuntu1) ...

when i use virtualmins "Re-Check Configuration" I now get:

    All commands needed to create and restore backups are installed.

  The selected package management and update systems are installed OK.

  .. your system is ready for use by Virtualmin.

please notice, that

  Note: root's PATH should usually contain /usr/local/sbin, /usr/sbin and /sbin.

is just a general information and NOT an actual error message! when I got this message, /usr/local/sbin, /usr/sbin and /sbin were already contained in my $PATH variable. so do not let it confuse you.


You can make changes to other partitions. But you can not make changes to your Ubuntu partition while running Ubuntu. You need a live cd/USB and boot from them and then you can make changes to your Ubuntu partition.


I have not used them, but here are programs available on Ubuntu that can edit .srt files:

Gaupol
Gnome Subtitles
Subtitle Editor
Subtitle Composer (for KDE)

You can install them with the following commands:

sudo apt install gaupol
sudo apt install gnome-subtitles
sudo apt install subtitleeditor
sudo apt install subtitlecomposer


If you are looking to use rsync to back up files on a regular base you probably want to make some changes. --delete will remove the file you have deleted which means if you accidentally delete all your files and then  rsync -av --delete /home /mnt- runs it will remove all of your backups. If all you want to do is to make a copy then this will work, and it will probably save you from a failed disk but you should think about what are you trying to protect your self from.
I would suggest taking a look at this post on stack overflow if you are using rsync as your regular backup tool Use rsync for backup without overwrite.

I realize there are many articles out there suggesting to do what you are doing, howtogeek linux.com and while this works great as a one time backup and is even ok if you want to run your backups manually when you know your computer is in a state you are ok with. It is risky to do it automatically. I would suggest using the built-in tool for backups (just search for backup) as it handles the case of deleting or overwriting files by mistake and you can set it up to run weekly/monthly etc and can set how long you want to keep backups for. but if you are just trying to protect from a disk failure what you have is probably ok.


Yeah, you'd think something like this would work:

menuentry "Boot Windoze" {
  search -f "--set-root /Winblows.iso"
  drivemap "/Winblows.iso" '(hd32)'
  drivemap '--hook' ''
  set root='(hd32)'
  chainloader +1
}

But Windows will just balk at that.

If you happen to have at least 4GB RAM, you can opt to load the whole DVD iso in memdisk and boot off that. To do that, download SysLinux and extract the memdisk file into your boot directory. Then you need to add code to Grub2 something like this

menuentry "Boot Windoze" {
  search -f "--set-root /Winblows.iso"
  insmod memdisk
  linux16 /boot/memdisk iso
  initrd16 /Winblows.iso
}

However, I'm not going to even test the code, as putting 3+ GB of data into RAM is just plain wrong (from an idealogical standpoint). No, I really wanted what you want, but in the end I put the Windows install on a partition on a USB using the Windows 7 USB/DVD download tool and chainloaded to that. Sorry there doesn't seem to be any other way that I can see.


How can i move an encrypted home directory to another partition?

I am assuming you want to keep your data encrypted on the new partition.

First close all running applications, we don't want files being updated during the copy.
Copy the encrypted data to the new partition:

ecryptfs-umount-private
chown $USER /new_mount_point/$USER
rsync -avP $HOME/.Private $HOME/.ecryptfs /new_mount_point/$USER
editor /etc/passwd # Change the user's home dir to point to the new location

Log-off
Log-in

If you want to move/copy an encrypted home you only need to copy/move ~/.Private and the encryption keys (~/.ecryptfs). If you want to copy/move to an unencrypted location just copy everything except .Private and .ecryptfs.


Why can I see multiple desktops on my laptop display?

Have you installed drivers for your display? Driver software would probably work. To install them, you will need to access the laptop manufacturer's website. Through the manufacturer's website, you will be able to locate driver software, then download the correct drivers for Linux. Ubuntu will most-likely not be an option.


How to customize the ubuntu gnome 3 desktop?

A bit easier, or if you don't wanna move the files.

Open the chosen file in the file manager.  It should open with Image Viewer/eog.  Both the Image menu and the right-click context menu have an option called, "Set as Desktop Background."


I am kinda in the same situation... hunting online, I see many users have got the same problem resolved by running a scan on their systems for malwares (they are working on windows systems). Not sure if malware attack possible on linux? If so, try running some anti-malware programs.


How to balance CPU cores loading for one process

If you wish to optimize the CPU usage you can try to install cpulimit package. It allows to limit the usage of CPU and point the application to use specific core. But all the settings are done by hand, it doesn't have any configuration file. Here is a small example of using it.


Yes there is an ugly hack, which needs to be in place so that it shuts down your discrete graphics card on boot and will disable it on Ubuntu. Which I think should be fine as it will totally chill your system

Step 1. goto terminal (alt+ctrl+t) and type:

sudo gedit /etc/rc.local

Step 2. add the following lines before exit 0:

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

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

So your rc.local would look something like this:

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

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

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

exit 0

Step 3: Save and exit gedit, then type:

sudo reboot

Enter your password when required.

Basically what you did was, you switched to Integrated (IGD) graphics. Then switched off the other one.


Why isn't boot-repair in the official Ubuntu repositories?

According to a Launchpad bug page, it needs a sponsor to upload it to the Ubuntu and Debian repositories. I read down the thread a bit and, while its rather old, it seems the developer still has no sponsor.


17.04 Display scaling reverting to 1 after resume from suspend?

For anyone else being frustrated by this bug, here's a quick perl script to watch for changes in the scale_factor value and reset to whatever the value is when the script was first run:

#!/usr/bin/perl -w
use strict;

my $dconf_line = `dconf read /com/ubuntu/user-interface/scale-factor`;
my ($scale_factor) = $dconf_line =~ m/DP1\': (\d+)/;

if ($scale_factor) {
    print STDOUT "Current value of scale_factor: $scale_factor ...\n\n";
} else {
    die "Error: cannot find scale_factor value in dconf\n(value of /com/ubuntu/user-interface/scale-factor was $dconf_line\n\n";
}

open(my $fh, "-|", "dconf watch /com/ubuntu/user-interface/scale-factor");

while (<$fh>) {
    if (m/DP1\': (?!$scale_factor)/) {
        `dconf write /com/ubuntu/user-interface/scale-factor "{'DP1': $scale_factor}"`;
        my $date = `date`;
        print STDOUT "$date -- scaling factor adjusted\n\n";
    }
}

Just leave the script running, and it'll catch and reset any attempts to change away from the value.

Works for me on 17.04 with unity, but it's possible that with the switch to gnome in 17.10 the value is stored in a different dconf registry key -- if so, just replace all instances of the key location in the script with the appropriate one and it should work.

Hope this helps ...


Unable to Dual Boot/Install Aspire V3-112P with Ubuntu 16.04

It took me few days to finally find the solution.

Step - 1: Disable Secure Boot.
In Aspire V3-112P the option to disable Secure Boot is blocked. You need to set a password for booting form Security (BIOS) to be able to bring the option to disable Secure Boot.

Step - 2: Download and install Ubuntu 64 bit only.

After restarting, it will boot directly to Win 10 without giving any option for booting into Ubuntu.

Step - 3: Download boot-repair-disk and use it to fix the booting. If successfull you will see the boot menu for Ubuntu and Win 10.

Enjoy Ubuntu 16.04...


It's caused by those files requiring other files to be installed/removed in order to be installed, but Ubuntu doesn't allow this by default.

To fix this you should run sudo apt-get dist-upgrade

I had this issue earlier, and it resolved itself automatically one day for some reason. :/


First, install in ubuntu :

sudo apt-get install libgtk2.0-0 ia32-libs libjpeg62:i386

Then in terminal :

sudo ln -s /usr/lib/x86_64-linux-gnu/libgnome-keyring.so.0 /usr/lib/libgnome-keyring.so.0
sudo ln -s /usr/lib/x86_64-linux-gnu/libgnome-keyring.so.0.2.0 /usr/lib/libgnome-keyring.so.0.2.0

Finally download v2.6, (not the last version, but adobe decided to stop devel for linux...)

http://airdownload.adobe.com/air/lin/download/2.6/AdobeAIRInstaller.bin

sudo ./AdobeAIRInstaller.bin


Installing lib32nss-mdns should help you to resolve the issue

Open terminal and try sudo apt-get install lib32nss-mdns


Adding lxd containers on Windows 10 hyper V host networking issue

You need to Tick 'Enable Mac Address Spoofing' un 'Advanced Features' in the network adapter settings

https://www.technibble.com/forums/threads/start-using-containers-on-ubuntu.74887/

This has been plaguing me for years.


How to grep for groups of n digits, but no more than n?

There are two ways to interpret this question; I'll address both cases. You might want to display lines:

that contain a sequence of four digits that is itself not part of any longer sequence of digits, or
that contains a four-digit sequence but no longer sequence of digits (not even separately).

For example, (1) would display 1234a56789, but (2) wouldn't.

If you want to display all lines that contain a sequence of four digits that is itself not part of any longer sequence of digits, one way is:

grep -P '(?<!\d)\d{4}(?!\d)' file

This uses Perl regular expressions, which Ubuntu's grep (GNU grep) supports via -P. It won't match text like 12345, nor will it match the 1234 or 2345 that are part of it. But it will match the 1234 in 1234a56789.

In Perl regular expressions:

\d means any digit (it's a short way to say [0-9] or [[:digit:]]).
x{4} matches x 4 times. ({ } syntax isn't specific to Perl regular expressions; it's in extended regular expressions via grep -E as well.) So \d{4} is the same as \d\d\d\d.
(?<!\d) is a zero-width negative look-behind assertion. It means "unless preceded by \d."
(?!\d) is a zero-width negative look-ahead assertion. It means "unless followed by \d."

(?<!\d) and (?!\d) don't match text outside the sequence of four digits; instead,  they will (when used together) prevent a sequence of four digits from itself being matched if it is part of a longer sequence of digits.

Using just the look-behind or just the look-ahead is insufficient because the rightmost or leftmost four-digit subsequence would still be matched.

One benefit of using look-behind and look-ahead assertions is that your pattern matches only the four-digit sequences themselves, and not the surrounding text. This is helpful when using color highlighting (with the --color option).

ek@Io:~$ grep -P '(?&lt!\d)\d{4}(?!\d)' &lt&lt&lt 12345abc789d0123e4
12345abc789d0123e4

By default in Ubuntu, each user has alias grep='grep --color=auto' in their ~.bashrc file. So you get color highlighting automatically when you run a simple command starting with grep (this is when aliases are expanded) and standard output is a terminal (this is what --color=auto checks for). Matches are typically highlighted in a shade of red (close to vermilion), but I've shown it in italicized bold. Here's a screenshot:

And you can even make grep print only matching text, and not the whole line, with -o:

ek@Io:~$ grep -oP '(?<!\d)\d{4}(?!\d)' <<< 12345abc789d0123e4
0123

Alternative Way, Without Look-Behind and Look-Ahead Assertions

However, if you:

need a command that will also run on systems where grep doesn't support -P or otherwise don't want to use a Perl regular expression, and
don't need to match the four digits specifically--which is usually the case if your goal is simply to display lines containing matches, and
are okay with a solution that is a bit less elegant

...then you can achieve this with an extended regular expression instead:

grep -E '(^|[^0-9])[0-9]{4}($|[^0-9])' file

This matches four digits and the non-digit character--or beginning or end of the line--surrounding them. Specifically:

[0-9] matches any digit (like [[:digit:]], or \d in Perl regular expressions) and {4} means "four times." So [0-9]{4} matches a four-digit sequence.
[^0-9] matches characters not in the range of 0 through 9. It is equivalent to [^[:digit:]] (or \D, in Perl regular expressions).
^, when it doesn't appear in [ ] brackets, matches the beginning of a line. Similarly, $ matches the end of a line.
| means or and parentheses are for grouping (as in algebra). So (^|[^0-9]) matches the beginning of the line or a non-digit character, while ($|[^0-9]) matches the end of the line or a non-digit character.

So matches occur only in lines containing a four-digit sequence ([0-9]{4}) that is simultaneously:

at the beginning of the line or preceded by a non-digit ((^|[^0-9])), and
at the end of the line or followed by a non-digit (($|[^0-9])).

If, on the other hand, you want to display all lines that contain a four-digit sequence, but do not contain any sequence of more than four digits (even one that is separate from another sequence of only four digits), then conceptually your goal is to find lines that match one pattern but not another.

Therefore, even if you know how to do it with a single pattern, I'd suggest using something like matt's second suggestion, greping for the two patterns separately.

You don't strongly benefit from any of the advanced features of Perl regular expressions when doing that, so you might prefer not to use them. But in keeping with the above style, here's a shortening of matt's solution using \d (and braces) in place of [0-9]:

grep -P '\d{4}' file | grep -Pv '\d{5}'

Since it uses [0-9], matt's way is more portable--it will work on systems where grep doesn't support Perl regular expressions. If you use [0-9] (or [[:digit:]]) instead of \d, but continue to use { }, you get the portability of matt's way a bit more concisely:

grep -E '[0-9]{4}' file | grep -Ev '[0-9]{5}'

Alternative Way, With a Single Pattern

If you really do prefer a grep command that

uses a single regular expression (not two greps separated by a pipe, as above)
to display lines that contain at least one sequence of four digits,
but no sequences of five (or more) digits,
and you don't mind matching the whole line, not just the digits (you probably don't mind this)

...then you can use:

grep -Px '(\d{0,4}\D)*\d{4}(\D\d{0,4})*' file

The -x flag makes grep display only lines where the entire line matches (rather than any line containing a match).

I've used a Perl regular expression because I think the brevity of \d and \D substantially increase clarity in this case. But if you need something portable to systems where grep doesn't support -P, you can replace them with [0-9] and [^0-9] (or with [[:digit:]] and [^[:digit]]):

grep -Ex '([0-9]{0,4}[^0-9])*[0-9]{4}([^0-9][0-9]{0,4})*' file

The way these regular expressions work is:

In the middle, \d{4} or [0-9]{4} matches one sequence of four digits. We may have more than one of these, but we need to have at least one.
On the left, (\d{0,4}\D)* or ([0-9]{0,4}[^0-9])* matches zero or more (*) instances of not more than four digits followed by a non-digit. Zero digits (i.e., nothing) is one possibility for "not more than four digits." This matches (a) the empty string or (b) any string ending in a non-digit and not containing any sequences of more than four digits.

Since the text immediately to the left of the central \d{4} (or [0-9]{4}) must either be empty or end with a non-digit, this prevents the central \d{4} from matching four digits that have a another (fifth) digit just to the left of them.
On the right, (\D\d{0,4})* or ([^0-9][0-9]{0,4})* matches zero or more (*) instances of a non-digit followed by not more than four digits (which, like before, could be four, three, two, one, or even none at all). This matches (a) the empty string or (b) any string beginning in a non-digit and not containing any sequences of more than four digits.

Since the text immediately to the right of the central \d{4} (or [0-9]{4}) must either be empty or start with a non-digit, this prevents the central \d{4} from matching four digits that have another (fifth) digit just to the right of them.

This ensures a four-digit sequence is present somewhere, and that no sequence of five or more digits is present anywhere.

It is not bad or wrong to do it this way. But perhaps the most important reason to consider this alternative is that it clarifies the benefit of using grep -P '\d{4}' file | grep -Pv '\d{5}' (or similar) instead, as suggested above and in matt's answer.

With that way, it's clear your goal is to select lines that contain one thing but not another. Plus the syntax is simpler (so it may be more quickly understood by many readers/maintainers).