Extending Ubuntu home partition using Gparted in dual boot

Make sure that you have a good backup of your important Ubuntu files, as this procedure can corrupt or lose data.

Keep these things in mind:

always start the entire procedure with issuing a swapoff on any mounted swap partitions, and end the entire procedure with issuing a swapon on that same swap partition
a move is done by pointing the mouse pointer at the center of a partition and dragging it left/right with the hand cursor
a resize is done by dragging the left/right side of a partition to the left/right with the directional arrow cursor
if any partition can't be moved/resized graphically, you may have to manually enter the specific required numeric data (don't do this unless I instruct you to)
you begin any move/resize by right-clicking on the partition in the lower pane of the main window, and selecting the desired action from the popup menu, then finishing that action in the new move/resize window

Do the following...

Note: if the procedure doesn't work exactly as I outline, STOP immediately and DO NOT continue.

boot to a Ubuntu Live DVD/USB, in “Try Ubuntu” mode
start gparted
move /dev/sda9 partition all the way left

note: if you wish to resize /dev/sda9, now is the time to do it

did you remember to swapoff /dev/sda10?
move /dev/sda10 partition all the way left
move /dev/sda11 partition all the way left
resize the right side of /dev/sda11 all the way right
click the Apply icon


Can't Mount Windows 7 Share on Ubuntu 11.10

I ran into this problem after upgrading from Ubuntu 10.x.  installing smbfs with

sudo apt-get install smbfs

fixed it.  I was connecting to a network drive, though, not a window$ box.

Good luck


(OP Solved Problem)

  Yes, after I change to use xCHM, it can copy


How do I put a clock on the desktop background on Ubuntu 19.04, gnome

Install conky by running sudo apt install conky-all

Create the folder conky in ~/.config. Then, in ~/.config/conky, create an empty plain text file called conky.conf.

Open a plain text editor, paste the following content into conky.conf and save the file:

conky.config = {

    background = false,
    update_interval = 1,
    double_buffer = true,
    no_buffers = true,
    text_buffer_size = 2048,
    own_window = true,
    own_window_class = 'conky',
    own_window_argb_visual = true,
    own_window_argb_value = 80,
    own_window_hints = 'undecorated,below,sticky,skip_taskbar,skip_pager',
    own_window_colour = '#252525',
    own_window_type = 'desktop',
    background = false,
    minimum_width = 250,
    gap_x = 100,
    gap_y = 200,
    draw_shades = false,
    draw_outline = false,
    draw_borders = false,
    override_utf8_locale = true,
    use_xft = true,
    font = 'Noto:size=8',
    xftalpha = 0.5,
    uppercase = false
};

conky.text = [[
${voffset 5}${offset 15}${font Noto:size=36}${color white}${time %e}
${goto 25}${font Noto:size=18}${color white}${voffset -30}${time %b}${color white}${offset 10}${time %Y}
${font Noto:size=12}${color white}${voffset 5}${goto 20}${time %A}${goto 153}${color white}${time %H}:${time %M}
]];
-- https://store.kde.org/p/1197154/

Open a terminal and run conky -c ~/.config/conky/conky.conf and minimize all your open windows. Somewhere on your screen you'll see the following image:

Note that you want to make some changes:

modify own_window_colour = '252525' to any other hex color you want. There's no need to include #.
gap_x = 100 positions the conky window 100px from the left of the screen. Change as per your needs.
gap_y = 200 positions the conky window 200px from the bottom of the screen. Change as per your needs.
in the section "conky.txt", you can change the text color to your preference using hex colors as described above or color names as found in /usr/share/X11/rgb.txt.
you can play with font and font size, voffset and what you want in terms of time formats (as described in man date).
the line own_window_type = 'desktop', helps keep conky visible in Ubuntu 19.10 when minimizing all other open windows (aka Show Desktop) using Ctrl+Meta+D.

Once, you're happy, you can get conky to run on startup by adding it to your distro's autostart.

Credit: code is based on Conky Modern.


You can run it from the command prompt but you need to know the directory it was installed. The default path is in /usr/local/MATLAB_VERSION where MATLAB_VERSION is the Matlab version you have installed.

To run it just type:

/usr/local/MATLAB_VERSION/bin/matlab &

You can also create shortcut to your Desktop. You need to create a file using

gedit Desktop/matlab.desktop

with the following contents

 [Desktop Entry]

 Name=Matlab 2014a
 Comment=Start MATLAB - The Language of Technical Computing
 Version=R2014a
 Exec=/opt/matlab/R2014a/bin/matlab -desktop
 #Icon=/opt/matlab/R2014a/X11/icons/matlab_logo.svg
 Terminal=false
 Type=Application

and make it executable using:

 chmod +x Desktop/matlab.desktop

You need to also replace above the path with the correct location from your installation. The Icon location is also optional.

If you want Matlab to be accessible in the dash search you need to also copy the matlab.desktop file from my answer to /usr/share/applications folder:

sudo cp Desktop/matlab.desktop /usr/share/applications


How can I monitor the TBW on my Samsung SSD?

FULL DISCLOSURE: The scipt/commands present in this answer are not my own, but rather the work of J. D. G. Leaver. They were sourced from a blog post on his website.

NB:

This will only report accurate numbers for Samsung SSDs
You need to have smartctl installed

Method 1:
Here's a handy little script that will allow you to monitor the TBW of your SSD, along with some other information:
#!/bin/bash

#######################################
# Variables                           #
#######################################

SSD_DEVICE="/dev/sda"

ON_TIME_TAG="Power_On_Hours"
WEAR_COUNT_TAG="Wear_Leveling_Count"
LBAS_WRITTEN_TAG="Total_LBAs_Written"
LBA_SIZE=512 # Value in bytes

BYTES_PER_MB=1048576
BYTES_PER_GB=1073741824
BYTES_PER_TB=1099511627776

#######################################
# Get total data written...           #
#######################################

# Get SMART attributes
SMART_INFO=$(sudo /usr/sbin/smartctl -A "$SSD_DEVICE")

# Extract required attributes
ON_TIME=$(echo "$SMART_INFO" | grep "$ON_TIME_TAG" | awk '{print $10}')
WEAR_COUNT=$(echo "$SMART_INFO" | grep "$WEAR_COUNT_TAG" | awk '{print $4}' | sed 's/^0*//')
LBAS_WRITTEN=$(echo "$SMART_INFO" | grep "$LBAS_WRITTEN_TAG" | awk '{print $10}')

# Convert LBAs -> bytes
BYTES_WRITTEN=$(echo "$LBAS_WRITTEN * $LBA_SIZE" | bc)
MB_WRITTEN=$(echo "scale=3; $BYTES_WRITTEN / $BYTES_PER_MB" | bc)
GB_WRITTEN=$(echo "scale=3; $BYTES_WRITTEN / $BYTES_PER_GB" | bc)
TB_WRITTEN=$(echo "scale=3; $BYTES_WRITTEN / $BYTES_PER_TB" | bc)

# Output results...
echo "------------------------------"
echo " SSD Status:   $SSD_DEVICE"
echo "------------------------------"
echo " On time:      $(echo $ON_TIME | sed ':a;s/\B[0-9]\{3\}\>/,&/;ta') hr"
echo "------------------------------"
echo " Data written:"
echo "           MB: $(echo $MB_WRITTEN | sed ':a;s/\B[0-9]\{3\}\>/,&/;ta')"
echo "           GB: $(echo $GB_WRITTEN | sed ':a;s/\B[0-9]\{3\}\>/,&/;ta')"
echo "           TB: $(echo $TB_WRITTEN | sed ':a;s/\B[0-9]\{3\}\>/,&/;ta')"
echo "------------------------------"
echo " Mean write rate:"
echo "        MB/hr: $(echo "scale=3; $MB_WRITTEN / $ON_TIME" | bc | sed ':a;s/\B[0-9]\{3\}\>/,&/;ta')"
echo "------------------------------"
echo " Drive health: ${WEAR_COUNT} %"
echo "------------------------------"

Here's the a sample of the output:
------------------------------
 SSD Status:   /dev/sda
------------------------------
 On time:      2 hr
------------------------------
 Data written:
           MB: 25,098.917
           GB: 24.510
           TB: .023
------------------------------
 Mean write rate:
        MB/hr: 12,549.458
------------------------------
 Drive health: 100 %
------------------------------

This data is accurate, as I only just installed my new 850 Pro.

Method 2:
Alternatively, here's a one-liner to get the TBW only:
echo "GB Written: $(echo "scale=3; $(sudo /usr/sbin/smartctl -A /dev/sda | grep "Total_LBAs_Written" | awk '{print $10}') * 512 / 1073741824" | bc | sed ':a;s/\B[0-9]\{3\}\>/,&/;ta')"


Allow any user to use shutdown with my own shell

On a system which has DBus and ConsoleKit installed you can use the following command to shut down the system without super-admin privileges (i.e. without granting sudo rights to the user):

dbus-send --system --print-reply --dest="org.freedesktop.ConsoleKit" /org/freedesktop/ConsoleKit/Manager org.freedesktop.ConsoleKit.Manager.Stop


How to update code::blocks to the latest version

Here you got two possible actions.

Keep updating your system , once Ubuntu have build the new code blocks , It will place it in upcoming updates . so doing regular update will give you i.e by the Ubuntu updates .
If you hate waiting , then you can get the packages from the codeblock site and then you can install by your own .

If you like action 2 then here you go .

open your terminal and type this

wget http://space.dl.sourceforge.net/project/codeblocks.berlios/codeblocks-10.05-1-debian-i386.tar.bz2
tar -xvf codeblocks-10.05-1-debian-i386.tar.bz2
cd codeblocks-10.05-1-debian-i386
./configure
 make
sudo make install

hope that helps .

PS:If you faced any problems while installation then report us back . we will help you .

Hope that helps.


override css in a gnome shell extension with a shell theme

Given the CSS you provided, I was able to force the styling by using the important rule.
#dashtopanelScrollview .app-well-app:hover .overview-icon,
#dashtopanelScrollview .app-well-app:focus .overview-icon {
    background: red!important;
}

#dashtopanelScrollview .app-well-app:hover > :first-child,
#dashtopanelScrollview .app-well-app:focus > :first-child {
    background-color: red!important;
}


Installing Ubuntu 16.04 on macbook 12 retina 2015

people have been trying to find a solution since the MacBook 12' was released last year, but from my searches no one seems to have solved the problem yet.

The link below gives an idea of where things are at the moment:

https://bugzilla.kernel.org/show_bug.cgi?id=99891

Hope this helps!!!


What is the purpose of the php-cli package?

I must be blind, sorry: php-cli depends on php7.2-cli, which was automatically installed when I installed the php package. I missed that when I filtered the packages using "php-".

So the answer is: no, there is no point in installing php-cli after php, as nothing new would be added. In theory, it might be useful if I ever uninstall php or libapache2-mod-php7.2, as the CLI part would still be kept.


Keyboard Shortcut to change font color in Libre Office Impress

Styles in Impress are like paragraph styles in that they only apply to entire paragraphs. Also, it is not possible to create new Drawing Styles, and Presentation Styles only apply to shapes such as text boxes created with the "insert text box" option. In short, styles are recommended in Writer, but in Impress, direct formatting is best in most cases.

So, here is a macro solution. Add the following Basic code to a module in your Standard library.

Sub colorBlack
    colorText(RGB(0,0,0))
End Sub

Sub colorRed
    colorText(RGB(255,0,0))
End Sub

Sub colorText(color As Long)
    oSel = ThisComponent.getCurrentController().getSelection()
    oCurs = oSel.getText().createTextCursorByRange(oSel)
    oCurs.CharColor = color
End Sub

Then go to Tools -> Customize -> Keyboard. Under Category, expand My Macros and the Standard library to find the module with colorBlack and colorRed. Then choose which shortcut keys to use and press Modify to assign them.


So you want to reinstall Windows.
Check your firmware (BIOS) for this:
Did you (re)enable Secure boot?
Did you (re)enable UEFI boot?
Is the installation media UEFI bootable?
Windows 8.1 requires all these things or it will not install.


Looks like you created a folder miguel in the media and you have taken ownership of it. Instead, let's create a group, add users to that group, and set the permissions.

sudo groupadd -g 10000 [samba_group]
sudo adduser migeul [samba_group]
sudo chown root:[samba_group] -R /media/migeul
sudo chgrp [samba_group] /media/migeul
sudo chmod 775 -R /media/migeul

This will create a group and attach it to the folder to be shared. You add the users to that group for access. Set the permissions to 775 which gives the owner and the group read-write-execute access while others only read. Set's it recursively.

Verify that you have total access to the folder. With samba, setting the permissions are a little bit different than file permissions with a ubuntu user. What I mean is that verify the permissions after you take ownership because they could result in a samba error later on down the road. Where nobody can access the drive.

Create a samba account that matches your Linux username precisely.

sudo smbpasswd -a miguel
sudo smbpasswd -e migeul

That will prompt you to create a password for the username miguel. Please note that this is only for SMB shares not for the user in the Operating System.

Afterward, open up the samba config and when sharing the drive make sure you type in writable = yes, browsable = yes, read only = no and add your group to it as well. Also, verify the location you are sharing from. Use the place that it is mounted to.

[migeul]
comment = Migeuls folder
path = /media/migeul
browsable = yes
writable = yes
guest ok = no
read only = no
valid users = @[samba_group]

After you reconfig the /etc/samba/smb.conf file, reload it.

sudo smbd reload

These pages go more in-depth with setting up samba shares.

https://help.ubuntu.com/community/Samba/SambaServerGuide
https://www.techrepublic.com/article/how-to-set-up-samba-shares-for-groups/

You may also need to set your umask as well. To do that open up /etc/profile using sudo nano /etc/profile and at the bottom type in umask 002. Use Control+O to save and Control+X to exit. Best to reboot the server using sudo reboot and the new mask permissions will take place. That setting re-asserts the same permissions for the users.


Fn+F2 LCD/CRT display toggle stopped working in 11.04

It is possible that your computer's BIOS is converting the Fn+F2 key press into Win+P or similar.  Many of the Unity shortcuts make use of this key, which might explain what you are seeing.

That is the key sequence used to bring up the screen configuration dialog on modern versions of Windows, and Microsoft has suggested that manufacturers make the BIOS map their old Fn based shortcuts to the new key sequence.  A more technical description of this can be found here.

If this is what you are seeing, then there isn't much that can be done: the key sequence remapping is being done at such a low level that Linux can't distinguish the key press from you actually typing Win+P.  It will probably require Unity to catch this key sequence and do the display toggle itself.

I've filed a bug report about this here:

https://bugs.launchpad.net/unity/+bug/778277


Could not open lock file /var/lock/aptitude No such file or directory

To fix this:

sudo mkdir /run/lock

Aptitude should now run without issue.


You need to add a "z" option to your tar command: tar -xzvf....

You can use "tar tvzf" to get a list of files in the archive and check that the file you want is named exactly as you expect. You can also use wildcards in the name of the file you want to extract, which might be easier than trying to get all the backslashes exactly correct.


How should I go about getting a wireless connection for my desktop when I have no access to ethernet?

0bda:b812 Realtek Semiconductor Corp. 802.11ac NIC

Your device is covered by the driver 88x2bu. With your phone tethered, please open a terminal and do:
sudo apt update
sudo apt install build-essential git dkms
git clone https://github.com/morrownr/88x2bu.git
cd 88x2bu
./install-driver.sh

Detach your tethered phone, reboot and your wireless should be working.


I receive updates for Ubuntu base after every boot

This is OK. Ubuntu is a very good OS, and developers create some small patches fixing minor bugs very often. This is good, you have nothing to worry about. Just download it.


I can't watch the flash video (e.g. youtube) with a fresh install of Ubuntu 12.04

The easiest way to install flash in firefox is to install the restricted extras packages. This can be done by typing in the terminal:

sudo apt-get update && sudo apt-get install ubuntu-restricted-extras


How do I get wireless working on an ASUS Notebook U56E?

For 12.04 and 11.10
I had the same problem with the same computer enter these commands and it will be solved.
sudo modprobe -r iwlagn
sudo modprobe iwlagn bt_coex_active=0

If it worked you need to make it permanent.
To make the change permanent:
gksu gedit /etc/modprobe.d/iwl.conf

Copy/paste this line into the new file:
options iwlagn bt_coex_active=0

Save and quit.
After you do this you will experience very slow internet connection but it can be solved by making iwlag not use n and it can be done with these commands.
sudo rmmod -f iwlagn
sudo modprobe iwlagn 11n_disable=1

if you see it made a difference once again you must make it perminent..
gksu gedit /etc/modprobe.d/iwlagn-disable11n.conf
options iwlagn 11n_disable=1

Save and quit.
And thats all
Thank you WBMachinery for this.
Bug report:

https://bugs.launchpad.net/ubuntu/+source/linux/+bug/876147


UEFI Firmware Setting not opening itself and Grub menu is not opening in startup to boot directly in Ubuntu

Almost similar thing happened to me. Running only one command in windows solved this issue for me. Please try doing what is mentioned at the end of this article : Click Here

  Note: If after installing Ubuntu, you boot directly in Windows, check in UEFI settings for changing the boot order. If you see no option to set the boot to Ubuntu, you need to fix it from within Windows. When you are in Windows desktop, hover the mouse in left corner, right click and select administrator’s command prompt. Then run the following command:

  bcdedit /set "{bootmgr}" path \EFI\ubuntu\grubx64.efi


How can I get my graphics card to be recognized in System Info?

it means that it cannot acquire the information because glxinfo is not installed on the system.

Install it by clicking here:

Or by typing:

sudo apt-get install mesa-utils

This is bug 914631.

After installing mesa-util it's providing information about graphic. In my case (Probook 4530s) "Intel® Sandybridge Mobile", while experience index still the same: Standard.


Wikipedia has a concise and properly cited explanation:

  The name vi is derived from the shortest unambiguous abbreviation for the command visual in ex; the command in question switches the line editor ex to visual mode.

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

Note that this does not mean that the full name of the text editor "vi" is still "visual" or, even, that "vi" currently stands for "visual" - the name of the editor is just "vi".  The above quote just explains how the name originally came into being.

As Ben Voigt helpfully points out, the people (and websites) claiming that it stands for "Visual Instrument" are confusing it with another product unrelated to the text editor.


XCompose with GTK results in strange behavior for own mapping

There were duplicated lines in the ~/.XCompose file I used which resulted in this strange behavior. Now, having only unique definitions and removed the redundant defintions, everything works.
Content of ~/.profile:
...
export GTK_IM_MODULE="xim"


Launcher still missing after installing nVidia driver

like you can still use nautilus (right click on the desktop, create folders and stuff) just the unity desktop is missing?

give us the output of:

lspci -nnk | grep -i VGA -A2

[ its probably just the missing of linux-headers-generic , remove all the drivers, install it, and get the drivers with additional drivers (jockey) again. but to be sure i need to know your output ]

~spheniscida


Upstart job fails to respawn and hangs when tried to stop/restart it

If facefeatures is not a script, then I believe its a problem of upstart not knowing what process to watch. Do start it with exec and not with script stanza:

description "Start face services recognition and monitors it"
version "1.0"
start on runlevel[5]
stop on runlevel[06]
normal exit 0 TERM STOP
expect fork
respawn
exec /home/verstand/facefeatures
post-stop script
    if [ ! $EXIT_STATUS && ! $EXIT_SIGNAL ]
    then
        exec sudo -u $USER "/sbin/shutdown -r now"
    fi
end script

When stopping the service your programm will receive a TERM, if it does no react on that signal it will get killed after five seconds.


Unity not working with amdgpu-pro in 16.04 LTS

I fixed this easily by deleting the amdgpu-pro drivers altogether and updating my kernel to 4.6-generic. Unity and my graphics intensive applications now work perfectly.


This will unfortunately not answer your question in any way, but it will hopefully increase your knowledge of how Ubuntu works a lot. No offence if you knew these things already. But if not, then I cannot let you not knowing those tips. The comments section is too small for this explanation.

Installing a program

I have the impression that you downloaded the packages from http://packages.ubuntu.com and then installed them. Is that correct ? If yes, you have to know that downloading something from the web to install it is very common for Windows but very rare for Ubuntu.

Usually, you should use the Software Center or a command in the terminal containing "apt-get".

Ubuntu versions names

The version number is for instance 10.04, 12.04 or 12.10. The first part indicates the year and the second indicates the month of release. For instance 12.04 came out in April 2012.

"LTS" means Long Term Support. There is an LTS version of Ubuntu every 2 years : 10.04 and 12.04 are the latest ones.

64bits and 32bits are related to your processor.

Have fun with Ubuntu and your video games ! I hope you'll get another answer that actually answers your question.


How to remove packages from the apt cache that are not currently installed?

Use apt-get clean command.According to man page it cleans downloaded packages which are not longer needed. Also in Synaptic on the low left click Status button and then on up left you will see not installed.Select it and you will do what you want.


According to this WineHQ page, you need to run a command.

Open a terminal and run:

wine reg add 'HKCU\Software\Valve\Steam' /v DWriteEnable /t REG_DWORD /d 00000000

Steam should now run.


As xangua said:

  If you aim to have the latest version of all your programs, maybe Ubuntu > is not the Linux distro for you.

Compile the latest versions themselves or search for a matching PPA.

I think , adding a PPA is an efficient way. In any case, this is a good compromise.

Eg: GCC 5.x:

ppa:ubuntu-toolchain-r/test

sudo apt-add-repository ppa:ubuntu-toolchain-r/test

ppa:nicola-onorata/toolchain

sudo apt-add-repository ppa:nicola-onorata/toolchain

Or Git 2.4.x

ppa:git-core/ppa

sudo apt-add-repository ppa:git-core/ppa

After adding a PPA, run

sudo apt-get update
sudo apt-get upgrade

And finally a word:

You should add (vivid)-proposed only if you know what you're doing. More infos here.


Resize VM partition without erasing data

It doesn't look like you actually have the empty space available - the "extended" partition usually covers all remaining disk space. It's possible that you do ; particularly if you created the disk image at 10GB and then it was resized to 20GB.

So, presuming you do have the empty space, you need to :

Make sure you have backups!
Resize the extended partition to fill the new upper sector limit

Use fdisk for this
Be careful! fdisk can wreck your partition table
A method for doing that is here : resize/grow partition without losing data
The method can be summarized as

Remove the existing partitions (2 and 5)
Recreate them with exactly the same starting sector numbers
For partition 2, allow it to consume the whole disk
For partition 5, use the exact starting sector and size it has now

Enrol a new LVM partition in the root volume group

Create a new Linux LVM partition in the extended space, allow it to consume remaining disk space
Make this a "physical volume" with pvcreate /dev/sdaX where X is the new partition
List the volume groups

vgdisplay

Extend the server volume group (replace name with name from previous step as required)

vgextend server-vg /dev/sdaX

Show the logical volumes

lvdisplay

Extend the root fs volume

lvextend /dev/server-vg/root /dev/sdaX

Resize the root FS to fit the new space

Depends on the FS you're using... e.g. for ext based FS
resize2fs /dev/server-vg/root

References :

https://www.rootusers.com/how-to-increase-the-size-of-a-linux-lvm-by-expanding-the-virtual-machine-disk/

http://litwol.com/content/fdisk-resizegrow-physical-partition-without-losing-data-linodecom


From the Fusion Drive Wikipedia page.

Apple's Fusion Drive design incorporates proprietary features with limited documentation.

Like Intel RST or Windows FastBoot, until the owner (Apple) shares their proprietary technology, it's closed and unusable by Linux. We don't know how you can mount the RAID, since Apple has not disclosed how.
Without documentation, it's unlikely to be reverse-engineered. Even if it were reverse-engineered, there's no assurance that an open solution could be shared without getting lawyers involved for a few years.
Your disk, for the foreseeable future, is readable only by certain Apple-produced hardware running OSX.
(Remember, this is Apple's decision. Not ours. Complain to them.)
Solution: You can install Ubuntu in a Virtual Machine on top of the OSX host. The Ubuntu VM would be able to read the files, since the host (OSX) is doing the REAL file access.
Solution: You can use an OSX system to copy the data onto a ordinary non-Fusion drive that Ubuntu can read natively.


Ubuntu Mate 17.04 cannot change color scheme

There is no facility to support that feature in GTK3, so it was dropped.


SSD from Windows drive to external drive under Ubuntu

If you connect your SSD with USB to your computer you are limited by the USB bandwidth.

A Samsung 840 SSD can do ca. 500MB/sec read, the USB 2.0 has a theoretical limit of only  60MB/sec but practically it can only do about 30MB/sec. This is likely your problem, USB2 is just too slow.

With an USB3 port (and USB3 cable and USB3 capable casing) you should be able to utilize most of the speed of your SSD even externally. (or with an eSATA port, or something other which is faster than USB2.)

Also if your drive is formated to NTFS it will be significantly slower on linux than on windows, because the linux NTFS driver is a slower one. This is because the NTFS file system is proprietary, and Microsoft didn't release the specifications of it, so the guys who wrote the linux driver had to reverse-engineer the file system.  If you swtich to a linux native file system, like ext4, you will likely get better performance.


Dell XPS 15 9560: After booting from live USB, screen is stuck on distro logo.

I'd give a safe bet that is is something to do with the NVidia graphics.  Start looking in the drivers and grub direction.  I've had this problem before.  Here's a decent place to start, may not fix your problem, but the same concepts should lead you down the road to fixing your issue.
 https://ask.fedoraproject.org/en/question/33891/optimus-laptop-how-to-disable-nvidia-card/

I remember being able to get things to boot by using modeset something or other.  There is also a way to disable the nvidia card, and use the intel instead.  Keep booting that way till you can get the nvidia stuff figured out.


Unable to mount external HDD due to unknown filesystem

Try the syntax

sudo mount -t ext4 /dev/sdb1 /mnt

assuming the filesystem is ext4


You probably need to look at what echo -ne '\r' does.

Here is an example:

echo -ne 'Downloading 1%\r'
sleep 1

echo -ne 'Downloading 100%\r'
sleep 1

echo -ne '\n'


How to drop (remove) rows that are present in less than 10% of the column in a text file?

You can do that with this awk command, where file is your initial file, and cleaned_file is the resulting file:
awk '{nzeros=0; for(col=2; col<=NF; col++) {if($col == 0) {nzeros++}} {if(nzeros < 0.9 * (NF - 1)) {print $0}}}' file > cleaned_file

Explanation:

nzeros=0: We initialize a variable where we store the number of zeros for each row.

for(col=2; col<=NF; col++) {if($col == 0) {nzeros++}}: For every row, we loop from the second column (col=2 - the first column is the bacteria type) til its end (col<=NF - NF is the number of fields, that is the total number of columns). If a column's value is 0 (if($col == 0)), we increase the value of nzeros by 1 (nzeros++).

if(nzeros < 0.9 * (NF - 1)) {print $0}}: If the number of zeros is less than 90% (0.9) of the total number of columns minus the first one if(nzeros < 0.9 * (NF - 1)), we print that row (print $0 - $0 means the whole row in awk).

The output for your sample is:
                       type test    test    test    test    test    test    test    test    test    test    test    test    control control control control control control control control control control control control control control control control
Aeriscardovia_aeriphila 0   0   0.00786 0.00471 0   0   0   0.00118 0.00645 0.00918 0.01208 0   0.00153 0   0   0   0   0.00923 0   0.01527 0   0.00719 0.00423 0.00177 0   0.00468 0.0047  0.01937
Bifidobacterium_adolescentis    0.06235 0.05427 0.78772 0.11693 0.03352 0.17129 0.23957 0.25833 0.16216 0.18002 2.27324 0.23361 0.38109 0   0.59227 0   0.46423 1.06198 0.20985 0   0.26431 0.7178  0   0   0.04301 0.27795 0.06356 0.54188
Bifidobacterium_angulatum   0   0   0   0.02457 0   0.03637 0   0   0   0   0   0   0   0   0.03184 0   0   0   0   0   0   0   0   0   0.00368 0   0   0


Grep for contents between two markers with newlines

AWK script

AWK is probably the answer using the /start/,/stop/ pattern like this:

/<schedule>/,/<\/schedule>/ {
    print;
}
/<run>/,/<\/run>/ {
    print;
}

This will print everything in the schedule and run tags (including the tags) and will preserve new lines. Adapt it to print what you need. To run it:

cat myfile.txt | awk -f script.awk

XSLT style sheet

Here's an XSLT version that should do something very similar. Run it using xsltproc, which should be installed by default.

<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

<xsl:template match="schedule">
    <xsl:value-of select="." />
</xsl:template>

<xsl:template match="run">
    <xsl:value-of select="." />
</xsl:template>

</xsl:stylesheet>


Grub only in shell mode, wrong root and prefix set

Apparently OP has already fixed their problem but for anyone still finding this:
I had a very similar problem where my $prefix variable was pointing to the wrong directory. I worked around it by moving the grub.cfg file to the path defined in $prefix. On pop-os that path is /EFI/ubuntu on the efi partition.
On the booted system enter this command into a terminal:
sudo cp -r /boot/efi/EFI/pop /boot/efi/EFI/ubuntu

or alternatively
sudo cp -r /boot/efi/grub /boot/efi/EFI/ubuntu

What this does:
When grub boots, it searches for a grub.cfg file at the defined path ($prefix). On pop-os this path is usually /EFI/ubuntu on the partition grub was loaded from. When you boot your system the efi partition automatically gets mounted to /boot/efi. So / for grub is the same as /boot/efi/ for your os. Moving the file to /boot/efi/EFI/ubuntu enables grub to find it at the path /EFI/ubuntu.
I hope this makes sense. This is just how I understood it, I may be wrong.
Note: When i did ls -la / in grub it displayed the EFI folder as efi, which really confused me. But apparently grub does not really care about capitalization that much.


I would go to this site and download Ubuntu mate from here. Just follow the directions to find what you need:
https://ubuntu-mate.org/download/index.html


how to instal leveldb in ubuntu 14.04 Lts

Firstly, you need to get the compiler, therefore install with:

sudo apt-get install g++

or better:

sudo apt install build-essential


Touchpad won't honor natural scrolling, mouse will

It's probably this bug.

Here is more proper workaround than OP's, until the bug is fixed:

Find out your device's name by running xinput
Create a file named 90-fix-for-LP1132063.conf within /etc/X11/xorg.conf.d/ with this content (for enabling Natural Scrolling):

Section "InputClass"
  Identifier "Enable Natural Scroll and Tap To Click"
  MatchDriver "libinput"
  MatchProduct "<(part of) device name>"
  Option "NaturalScrolling" "yes"
EndSection

I suggest setting this option, too:

  Option "Tapping" "yes"

It will enable simulating the left click via tapping the touchpad.

More libinput options are documented here:
https://www.mankier.com/4/libinput

You can subscribe to the bug and (re)move the file once the bug is fixed.

Further reading:
https://wayland.freedesktop.org/libinput/doc/latest/faq.html


I have three ideas:

You may have a

<a
href="https://bugs.launchpad.net/ubuntu/+source/network-manager/+bug/672207" rel="nofollow noreferrer">legitimate
bug.

The network manager is normally
ready long before the login screen.
On my machines, it already
establishes connections when there
isn't even anything on the screen.

Now, the bug is very probably one in
the specific driver you are using.
I.e., as suggested in your first
question, the driver not being ready
before the log in.
Problem with your keyring.

The Keyfiles: Error: [Errno 2] No such file or directory
ProcEnviron in your Bug report leads me to believe that there may be somthing wrong.

But this is quite hard to diagnose with the available information. Perhaps you should have a look at this bug report.
A hardware switch set to off.

Ubuntu has to manually switch on the
power to your wireless adapter,
which happens late. (Note, this is not a statement of fact, it's a wild guess; I've no idea why it would or if it does happen late)

Okay, this one is really far
fetched, but it's worth a try. If
your notebook has a physical switch
for the wireless network, make sure it is
set correctly. Mine has one, and it's really hard to see what it's set to. Here's some random examples from the web:

even worse:

Rather tricky to spot when these are set incorrectly. In some cases, those switches may not completely disable the wireless adapter, which could possibly explain your problem.


I guess you mean a desktop shortcut icon?

First make a new empty text file and paste this in to it

#!/bin/bash

sudo pkill X

Save it as killx.sh in to your /home and run

sudo chown root.root killx.sh

Then

sudo chmod 4755 killx.sh

To set it so your user can still execute the file, this should be able to run as root without a password (source for root sh)

To make it a click-able icon, open a text file paste

[Desktop Entry]
Name=killx
Comment=runs_killx.sh
Exec=~/killx.sh
Icon=any_you_want
Terminal=false
Type=Application
Categories=Utility;Application;

Save this to your /home as killx.desktop and make it executable

sudo chmod +x killx.desktop

Now you can put the .desktop file anywhere you like and double click it to run the commands in killx.sh.

FYI you can add an icon for it by adding the path of the icon to killx.desktop.


How to make numpad key binds such as Ctrl + Alt + 1 work in KDE?

A bug report: Bug 183458 - Numpad (keypad) keys not mapped correctly when setting Global Shortcuts / https://bugs.kde.org/show_bug.cgi?id=183458

The bug report has a workaround "Comment #17 From Pistos"


Why is git not using my pubkey with crontab?

The format for your cron file (which is what you get when you type crontab -e) is different from the system cron file.  You don't need to specify user in the user cron file, it is automatically run as you. Try:

49 16 * * * cd /path/to/backup/folder/ && /usr/local/bin/git commit -am "Updating DB backup"

I would also suggest catching stdout and stderr so that you can actually see what the commit has done, for example:

49 16 * * * cd /path/to/backup/folder/ && /usr/local/bin/git commit -am "Updating DB backup" >> /path/to/logfile 2>&1

Edited to add: Now that you've shown the output from stdout/stderr, the problem is clear.  ssh is not finding your keys, which is likely due to you setting

HOME=/

It should probably be something like

HOME=/home/me

Alternatively, you could probably just leave it unset.


You need a png icon for tex files. edit the icon file as text-x-tex.png and then put it to theme mimetypes directory.

For example, I'm using MBuntu-XL theme. So, I put the icon file on /usr/share/icons/MBuntu-XL/mimetypes/scalable/. Set file permission of the icon file for group and guest as read-only then relogin.

Good luck.


Can I add or change search tags in Unity's Dash

I don't know if you can change the name of an software(Without any programming). But in file names, you can use different languages. So, when you search them in your language, you will find them.


How can I input to a file directly from the terminal

a useful use of cat: provide input on stdin

cat > filename
enter text
hit Ctrl-D to stop

or use a heredoc

cat > filename << END
enter text
provide the terminating word to stop
END


I have figured it out from this link:
https://github.com/signalapp/Signal-Desktop/issues/4061

I just uninstalled and then reinstalled from the signal desktop site
https://signal.org/en/download/

with this code:

curl -s https://updates.signal.org/desktop/apt/keys.asc | sudo apt-key add -
echo "deb [arch=amd64] https://updates.signal.org/desktop/apt xenial main" | sudo tee -a /etc/apt/sources.list.d/signal-xenial.list
sudo apt update && sudo apt install signal-desktop


I have a problem when using "export" command

You cannot use shell builtins with sudo. Only command corresponding to valid files will be executed through sudo. The correct syntax for sudo is : sudo [options] [filename]

Export is an inside (builtin) command of the Bash shell and possibly some other too.

Also, note that there is no sense to do the action of export via sudo, it has to be done under your user id to be applicable to your shell and its child processes.

If you switch to the root user to do this, you will have to do the rest of your operation as root : this is not recommended. Because if you exit the root shell, the assignement done by export will be lost.


How is the Ubuntu update process secured against "man in the middle" attacks?

Debian (antecedent of Ubuntu) already introduced SecureApt or apt-secure and Ubuntu implements this. As far as I understand, this SecureApt is a way to ensure package integrity using md5sum checking.

When apt-get update is run a file called packages.gz that contains md5sum hashes of packages in the repository is downloaded (securely??) and then when installing a package from the repo the downloaded package is md5sum checked against the packages.gz md5sum and installed only if it matches.

Therefore tampering or manipulation of a packaged should result in a "no match" md5sum comparison.

This does not explain how packages updates which cannot be known at the time of system install or "package.gz" file transmission will be verified, however.

Update

I found some more information here in the Ubuntu help page on SecureApt:

About the updated process and its safety/security implications:

There is a release file which contains the md5sums of packages (maybe this file is or contains the packages.gz mentioned earlier).
This release file is transmitted rather safely by using gpg key signing.
The release file is updated each time packages are updated. This explains how updates will be possible safely. (1. gpg signed release file transmitted with md5hashes of packages, 2. (update)packges transmitted and checked with the trusty md5sums of the relaese file)


Understanding various update and upgrade commands

APT (Advanced Packaging Tool) is a management system for software packages. Usually used as root/sudo user. The usual command is apt-get, but with Ubuntu 14.04, there's also the apt tool: What is the difference between apt and apt-get?

1. sudo apt-get update:

  update
       update is used to resynchronize the package index files from their sources. The indexes of available packages are
       fetched from the location(s) specified in /etc/apt/sources.list. For example, when using a Debian archive, this
       command retrieves and scans the Packages.gz files, so that information about new and updated packages is available.
       An update should always be performed before an upgrade or dist-upgrade. Please be aware that the overall progress
       meter will be incorrect as the size of the package files cannot be known in advance.

After changing /etc/apt/sources.list or /etc/apt/preferences or adding/removing repositories, you have to run this command to make apt aware of your changes.
Run this command periodically to make sure your source list is up-to-date. This is the equivalent of "Reload" in Synaptic.
apt update is equivalent.

2. sudo apt-get upgrade:

 upgrade
       upgrade is used to install the newest versions of all packages currently installed on the system from the sources
       enumerated in /etc/apt/sources.list. Packages currently installed with new versions available are retrieved and
       upgraded; under no circumstances are currently installed packages removed, or packages not already installed
       retrieved and installed. New versions of currently installed packages that cannot be upgraded without changing the
       install status of another package will be left at their current version. An update must be performed first so that
       apt-get knows that new versions of packages are available.

This command upgrades all installed packages. This is the equivalent of "Mark all upgrades" in Synaptic.

3. sudo apt-get dist-upgrade:

dist-upgrade
       dist-upgrade in addition to performing the function of upgrade, also intelligently handles changing dependencies with
       new versions of packages; apt-get has a "smart" conflict resolution system, and it will attempt to upgrade the most
       important packages at the expense of less important ones if necessary. The dist-upgrade command may therefore remove
       some packages. The /etc/apt/sources.list file contains a list of locations from which to retrieve desired package
       files. See also apt_preferences(5) for a mechanism for overriding the general settings for individual packages.

It tells APT to use "smart" conflict resolution system, and it will attempt to upgrade the most important packages at the expense of less important ones if necessary.
apt-get dist-upgrade does not perform distribution upgrade. visit this for upgrading.
apt full-upgrade is equivalent.

4. sudo apt-get dselect-upgrade:

dselect-upgrade
       dselect-upgrade is used in conjunction with the traditional Debian packaging front-end, dselect(1).  dselect-upgrade
       follows the changes made by dselect(1) to the Status field of available packages, and performs the actions necessary
       to realize that state (for instance, the removal of old and the installation of new packages).

Visit man-page of dpkg in order to get information through --get-selections, --set-selections and --clear-selections.

5. sudo do-release-upgrade:

Upgrade  the  operating system to the **latest release** from the command-line.  This is the preferred command if the machine
   has no graphic environment or if the machine is to be upgraded over a remote connection.

Use -d, --devel-release to check if upgrading to the latest devel release is possible
Recommended to visit Community Upgrade Help.

Note: All Information is provided with use of manpages, and community help as a reference/source.


How do I debug a program which I set to start at login, but it doesn't?

Take a look at ~/.xsession-errors - if the app produces some error messages, they will appear in this file.


re-installing ubuntu after windows 10 install

Your Ubuntu partition has been deleted. You may be able to recover it, but the problem is that Windows is hogging all four of your disk's primary partitions. (Side note: Based on the absence of an obvious EFI System Partition (ESP), I'm inferring that this is a BIOS-mode installation with a Master Boot Record (MBR) partition table.) To fix the problem, you should first be aware of some risks and take some precautions.

Basically, your Linux filesystems are probably intact in the unallocated section of the disk; however, any attempt to recover those filesystems runs a risk of accidentally overwriting at least some of the data. The best way to protect yourself from such an accident is to first back up the disk. To do this, you'll need a disk that's at least a little bit larger than your current one. Boot to an Ubuntu live image, mount the target disk, and then use dd to copy the original disk:

sudo dd if=/dev/sda of=/path/to/lots/of/space/sda.img

This backs up /dev/sda to /path/to/lots/of/space/sda.img. (Note that it's conceivable that your current disk will become /dev/sdb or something else if you boot with a backup disk attached. Double-check this detail. Also, of course, you should adjust the of= value to point to wherever you've mounted your backup disk.) With a backup in place, you can try to recover your data from the original disk with greatly reduced risk -- if something goes badly wrong, you can restore the original by swapping the if= and of= parameters in dd.

The usual tool for recovering lost partitions is TestDisk. You can use it to see if it can find your Linux partitions. If so, TestDisk should be able to restore them; however, I'm not sure if it will be able to overcome the fact that Windows is now hogging all four of your primary partition slots. If TestDisk can't convert at least one partition from primary to logical form, you can do so with my FixParts program, which is part of the gdisk package in Ubuntu. Read the FixParts documentation to learn how to do this. Alternatively, you can delete one partition, if you can find one that's empty or that contains data of no value. Be aware that converting from primary to logical form can be risky because Windows will boot only from primary partitions, so if you convert the wrong partition from primary to logical form, you won't be able to boot Windows.

If TestDisk can't recover an entire partition, you may be able to recover individual files with PhotoRec. This process will be much more tedious, though. The last time I checked, PhotoRec didn't recover complete filenames or directory structures, so you'll spend a lot of time looking at files to figure out what they are and rename them appropriately.

As a side note, you're probably in this mess because you used logical partitions before, and Windows partitioning tools have long-standing bugs related to logical partitions, which frequently cause logical partitions to go missing or be damaged. This is one of the reasons I greatly prefer EFI-mode dual-boot installations, because they use GPT rather than MBR partitions, which don't cause so many problems.


getting a nfsmount error when PXE booting

Hello,

To fix your issue, you have two options....

Option 1 - Mount the Ubuntu Desktop cdrom/iso within your PXE server

As crazy it might sounds,  making the cdrom available on the pxe server will prevent the nfsmount error... If you look in the txt.cfg config file, you will see that in the append line, there is a element file=/cdrom/......  This is causing the issue

Option 2 -  Update your txt.cfg file  using the following information

Replace this section (and update your ip accordingly!!!)

label ubuntudesktop
   menu label Ubuntu Desktop 18.04 Live
   kernel casper/vmlinuz
   append nfsroot=192.168.1.150:/var/www/html/desktop/bionic netboot=nfs ro
   file=/cdrom/preseed/ubuntu.seed boot=casper initrd=/casper/initrd.lz
   systemd.mask=tmp.mount --

with

label ubuntudesktop
   menu label Ubuntu Desktop 18.04 Live
   kernel casper/vmlinuz
   append nfsroot = 192.168.1.193:/var/www/html/desktop/bionic netboot=nfs ro
   boot=casper initrd=/casper/initrd systemd.mask=tmp.mount --

In the second option, we have simply removed the element file=/cdrom/xxxxxx

Hope this help

Till next time

See ya


How to install Ubuntu in a external hard drive?

What you are asking is already possible with a HDD (Hard Drive) or SSD (Solid State Drive). You can simply insert any hard drive or SDD, install Ubuntu on it and be able to insert that same drive in other computers and it will work perfectly. Linux in general is actually not dependent of the hardware you install it in. If you install Ubuntu on an AMD computer with 4 GB of RAM and an Asus motherboard, then take the hard drive out and insert it into an Intel computer with 2 GB of RAM and an Intel motherboard, it will work without any problems.

The only exceptions are the proprietary drivers that are needed for some hardware, mainly Nvidia, Ati, Broadcom and Mac OS Computers. But you can remedy this by installing the drivers the first time you get to one of this scenarios. You won't need to do it a second time.

Now if you wish to create an installer on a Flash Drive, well you can use what karel says on his answer or as an alternative you can use the tool that comes by default with Ubuntu called Startup Disk creator. For this particular case where you want to either install Ubuntu on a HDD/SDD or a Flash Drive, you would need to execute the Disk Creator from the terminal with an additional parameter:

usb-creator-gtk --allow-system-internal

This will show you all the drives on the system (All storage devices).

What I would suggest would be to simply make a LiveUSB using the Startup Disk Creator, run the LiveUSB and either insert another Flash Drive or HDD/SDD and install the system on that unit. This way you have a LiveUSB that installs Ubuntu (Portable) and a Flash Drive / HDD / SDD that has Ubuntu already installed and is also portable.


You can check the syslog by entering this command in your terminal:

less /var/log/syslog

or, if you want to explore the result in your favorite text editor (Geany in this example) :

geany /var/log/syslog

(but you'll have to save the result elsewhere).

dmesg returns me the same message (systemd-logind[1114]: Failed to start unit user@112.service: Unknown unit: user@112.service), but I don't have  Ubuntu restarting on its own, so I suppose it will be unnecessary to search in this direction...


It seems one of the posts I read was true. Some how the available SWT built in with the installed Eclipse is corrupted.

I downloaded the latest release, following http://www.eclipse.org/swt/eclipse.php.


stuck in violet screen or black screen with dash

I have had this issue when Ubuntu automatically does a check disk.  Sometimes it doesn't actually display that it is doing it.  It appears like it is hanging, but if I let it go it completes after a while and let me log in.  If I reset it before it finishes, it just tries again on next boot, so I have to let it finish the first time.

Have you tried leaving for say 20-30 mins? See if it is doing a check in background.

If so, can you log in after pressing ctl-alt-F1 ?

If you can, log in via command line and type dmesg. See if it sheds any light.


Can you install Ubuntu to another partition from Windows?

UNetbootin Frugal Installer
You can make a Frugal install of Ubuntu to your hard drive that can be used to make a Full install to it.
Full details are given on this page:
https://github.com/unetbootin/unetbootin/wiki/installmodes
See: Making a full, standard hard disk install if you can't use a Live USB on that page.
I think it is working with UNetbootin Windows 681, but not sure if it works with GRUB.
If you try it please let us know your results.


If you are 1000% certain that you are typing the correct password and if you are 1000% certain that your keyboard is not the problem, the only other explanation that seems logical is that the password in /etc/passwd is indeed not the password you are entering at login.

I've done this a few times in the past myself:  trying to log in to the wrong machine.... in your case, perhaps you are booting a different OS than the one you think you are.

If you are 1000% certain that the above is not the case, you'll need to boot from LiveCD and change the /etc/passwd and /etc/shadow file pair or encrypted password for your account.  Alternately, you can run John the Ripper against /etc/shadow to see if the password there matches what you are using to login.

I'm assuming that your laptop only has one account.  Looking to the future, it's always a good idea to have at least a backup guest account on any system as a possible back door in case you get locked out of your main account.

Another possibility would be if you have ssh running on your laptop.  From another machine in your LAN you could figure out what IP is assigned to your laptop and then ssh in that way.  Of course this won't help if your passwd file is corrupted or not the same as the OS instance you want to log into.


How can I group windows to be raised as one?

Introduction

The following script allows selecting two windows, and while both windows are open, it will raise both windows when user focuses either one. For instance, if one links widows A and B , witching to either A or B will make both raise above other widows.

To stop the script you can use killall link_windows.py in terminal , or close and reopen one of the windows. You can also cancel execution by pressing close button X on either of the window-selection popup dialogs.

Potential tweaks:

multiple instances of the script can be used to group pairs of two windows. For example, if we have windows A,B,C,and D we can link A and B together, and link C and D together.
multiple windows can be grouped under one single window. For example, if I link window B to A, C to A, and D to A , that means if I always switch to A , I can raise all 4 windows at the same time.

Usage

Run the script as:

python link_windows.py

The script is compatible with Python 3 , so it can also run as

python3 link_windows.py

There are two command line options:

--quiet or -q , allows silencing down the GUI windows. With this option you can just click with mouse on any two windows , and the script will begin linking those.
--help or -h, prints the usage and description information.

The -h option produces the following information:

$ python3 link_windows.py  -h
usage: link_windows.py [-h] [--quiet]

Linker for two X11 windows.Allows raising two user selected windows together

optional arguments:
  -h, --help  show this help message and exit
  -q, --quiet  Blocks GUI dialogs.

Additional technical information can be viewed via pydoc ./link_windows.py , where ./ signifies that you must be in the same directory as the script.

Simple usage process for two windows:

A popup will appear asking you to select a window #1 , press OK or hit Enter. The mouse pointer will turn in to a cross. Click on one of the windows you want to link.
A second popup will appear asking you to select window #2,press OK or hit Enter. Again, the mouse pointer will turn into a cross.Click on the other window you want to link. After that execution will begin.
Whenever you focus either window, the script will raise the other window up, but return focus to the one originally selected ( note - with a quarter of a second delay for best performance  ) , thus creating feel that windows are linked together.

If you select the same window both times, the script will quit. If at any moment you click close button of popup dialog , the script will quit.

Script source

Also available as GitHub Gist

#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Author: Sergiy Kolodyazhnyy
Date:  August 2nd, 2016
Written for: https://askubuntu.com/q/805515/295286
Tested on Ubuntu 16.04 LTS
"""
import gi
gi.require_version('Gdk', '3.0')
gi.require_version('Gtk', '3.0')
from gi.repository import Gdk, Gtk
import time
import subprocess
import sys
import argparse

def run_cmd(cmdlist):
    """ Reusable function for running shell commands"""
    try:
        stdout = subprocess.check_output(cmdlist)
    except subprocess.CalledProcessError:
        sys.exit(1)
    else:
        if stdout:
            return stdout

def focus_windows_in_order(first, second, scr):
    """Raise two user-defined windows above others.
       Takes two XID integers and screen object.
       Window with first XID will have the focus"""

    first_obj = None
    second_obj = None

    for window in scr.get_window_stack():
        if window.get_xid() == first:
            first_obj = window
        if window.get_xid() == second:
            second_obj = window

    # When this  function is called first_obj is alread
    # raised. Therefore we must raise second one, and switch
    # back to first
    second_obj.focus(int(time.time()))
    second_obj.get_update_area()
    # time.sleep(0.25)
    first_obj.focus(int(time.time()))
    first_obj.get_update_area()

def get_user_window():
    """Select two windows via mouse. Returns integer value of window's id"""
    window_id = None
    while not window_id:
        for line in run_cmd(['xwininfo', '-int']).decode().split('\n'):
            if 'Window id:' in line:
                window_id = line.split()[3]
    return int(window_id)

def main():
    """ Main function. This is where polling for window stack is done"""

    # Parse command line arguments
    arg_parser = argparse.ArgumentParser(
        description="""Linker for two X11 windows.Allows raising """ +
                    """two user selected windows together""")
    arg_parser.add_argument(
                '-q','--quiet', action='store_true',
                help='Blocks GUI dialogs.',
                required=False)
    args = arg_parser.parse_args()

    # Obtain list of two user windows
    user_windows = [None, None]
    if not args.quiet:
        run_cmd(['zenity', '--info', '--text="select first window"'])
    user_windows[0] = get_user_window()
    if not args.quiet:
        run_cmd(['zenity', '--info', '--text="select second window"'])
    user_windows[1] = get_user_window()

    if user_windows[0] == user_windows[1]:
        run_cmd(
            ['zenity', '--error', '--text="Same window selected. Exiting"'])
        sys.exit(1)

    screen = Gdk.Screen.get_default()
    flag = False

    # begin watching for changes in window stack
    while True:

        window_stack = [window.get_xid()
                        for window in screen.get_window_stack()]

        if user_windows[0] in window_stack and user_windows[1] in window_stack:

            active_xid = screen.get_active_window().get_xid()
            if active_xid not in user_windows:
                flag = True

            if flag and active_xid == user_windows[0]:
                focus_windows_in_order(
                    user_windows[0], user_windows[1], screen)
                flag = False

            elif flag and active_xid == user_windows[1]:
                focus_windows_in_order(
                    user_windows[1], user_windows[0], screen)
                flag = False

        else:
            break

        time.sleep(0.15)

if __name__ == "__main__":
    main()

Notes：

When running from command line, popup dialogs produce the following message: Gtk-Message: GtkDialog mapped without a transient parent. This is discouraged. These can be ignored.
Consult How can I edit/create new launcher items in Unity by hand? for creating a launcher or desktop shortcut for this script , if you desire to launch it with double-click
In order to link this script to a keyboard shortcut for easy access, consult  How to add keyboard shortcuts?


Problem running multiple MySQL instances

Never mind, I found the answer here. The problem was with AppArmor.


How to get .NET 2.0 SP2 running in wine?

This looks quite a bit like the winetricks bug 70. The issue reports the root cause being in a wine bug, but I didn't go in to more detail in my investigations. If this is indeed the case, you might want to add additional information there and follow the bug for new changes in the bug status.


How do I get Unity working on an Asus UL50V?


Error during update 'Unable to connect to 192.168.43.1:8000'

It looks like apt is configured to use a proxy since 192.168.*.* is a private IP range.

Use the next command to list all files in /etc/apt that contains 192.168.43.1:

grep -rlF 192.168.43.1 /etc/apt

It possibly prints /etc/apt/apt.conf. Open that file. Find a line that contains the proxy configuration and remove it:

Acquire::http::Proxy "http://192.168.43.1:8000/";

Save it and try updating again:

sudo apt-get update


This is the o/p of dmesg with a ATI 6370HD discrete 1G graphics card.
"Detected VRAM RAM=1024M, BAR=256M", check for this line.

sourajit@sourajit:~$ sudo dmesg | grep drm
[    6.126816] [drm] Initialized drm 1.1.0 20060810
[    6.541907] [drm] radeon defaulting to kernel modesetting.
[    6.541910] [drm] radeon kernel modesetting enabled.
[    6.542102] [drm] initializing kernel modesetting (CEDAR 0x1002:0x68E4 0x17AA:0x397A).
[    6.542142] [drm] register mmio base: 0xE0600000
[    6.542143] [drm] register mmio size: 131072
[    7.406572] [drm] Detected VRAM RAM=1024M, BAR=256M
[    7.406576] [drm] RAM width 64bits DDR
[    7.406654] [drm] radeon: 1024M of VRAM memory ready
[    7.406655] [drm] radeon: 512M of GTT memory ready.


winkey assigned as Multi key instead of Super

To answer my own question.
I run sudo dpkg-reconfigure keyboard-configuration and on the choice Compose key, I choose No compose key.

I had previously chosen Left Logo key which had caused the Super been substituted by Multi Key when assigning shortcuts.


Why 's my HP Laptop's HDMI turning off when I close my laptop lid?

I just tested it the average user way:

in the settings window (gnome-control-center), choose the "power" management settings
in the on "When the lid is closed" section, choose "Do nothing"

Works fine here, on a Thinkpad T430S.


How to correctly install bumblebee 3.1 with nvidia-experimental-310

Edit /etc/bumblebee/bumblebee.conf and set Driver=nvidia and KernelDriver=nvidia-experimental-310 (instead of KernelDriver=nvidia). This is due to the ubuntu-x-swat/x-updates PPA changing the driver name.

Then sudo service bumblebeed restart.


It looks like you got most of your answer somewhere else. So editing files in /sys/, specifically debugfs, this doesn't work because it's a pseudo-filesystem. The best way is to echo >> to files and do it as root since you are talking to the kernel directly. I can't tell if the code that implements the sched_features accepts that value. The scheduler is quite complex.


Network configuration timed out in Ubuntu Core 16 for Wifi adapter on RPI3

I met the same issue when I run ubuntu core 16.04 on RPI3.
Creating wireless config file method mentioned by Riccardo Magrini.

$: sudo vi /etc/network/interfaces.d/wlan0

does not work perfectly. Because wlan0 interface can obtain IP config
and I can ssh to RPI3 from local network.
But default gateway is missing.
Even if try dhcpclient wlan0, the default gateway does not apply.

My solution is:

setup the cable interface (eth0)
SSH to RPI to get a terminal
do

$sudo snap refresh

wait RPI3 reboot and connect it via SSH again.
reconfig wlan0 inerface

$sudo console-conf

unplug network cable, and reboot.


Add gradeints to GIMP 2.8 in Ubuntu 12.04 lTS

In your home directory:
Press Ctrl + H to see all the hidden files.

You will see the .gimp-2.8 folder here.
Copy your gradient files (.ggr extension) to the gradients folder in .gimp folder.

Using Terminal:

cd /path/to/your/gradient_folder/
cp * ~/.gimp-2.8/gradients


Creative Sound Blaster ZxR ACM Headset jack not working still?

I bench tested this card recently and managed to get the ACM to work after reading some Reddit posts. What you need to do is go to the shell and open up alsamixer. Select your Sound Blaster card and change the output to "headphones." If you listen carefully you'll hear an audible click-noise from the sound card, and the ACM headphone jack will magically come to life. Your stereo and/or surround sound speakers will fall silent.
I'm no expert when it comes to HiFi, but I think the clicking noise is actually a mechanical-relay switch that physically transfers the channel to the ACM's headphone jack; probably a choice by Creative's engineers to minimize any possible feedback interference from other connected speakers.
As I understand it, the kernel driver is written to support the entire Sound Blaster-Z family of products. I'd gamble that it probably doesn't hook up some product-specific features to Pulseaudio.
All that said, I could be completely wrong. Regardless, from my own recent testing of the ZxR, it seems like it's a great product minus the hiccup with the headphone jack. Sound is crystal clear with hardly any background hiss. I've decided to keep mine and install it on my main PC once I've upgraded it to Ubuntu 20.04. Good luck with yours!


This is the socket file that the server creates on start-up. You need to restart the server, not reload the configuration. Type

pg_ctl restart

This will shut-down the running cluster, then start it again.


You are talking about empathy. Thats the chat program included in Ubuntu.

sudo apt-get remove empathy


How to repair a damaged .doc (word) file

You might be able to salvage some of the text. Try running this command in a terminal:

strings foo.doc > output.txt

Then open output.txt in a text editor to see the results. (Note that this particular command will only work with .doc files, and not the newer .docx format.)

To filter only strings of at least ten characters:

strings -n10 foo.doc > output.txt


virtualbox(ubuntu 20.04) on host macOS stopped connecting to internet


Ubuntu 12.04 postfix/dovecot server can send email but can't receive any

It may be a case of blocked ports.

What is the output of /var/log/mail.log

If you are using a firewall maybe you should check any rules considering the ports in question.

For iptables a sudo iptables -L should output the current rules. If the ports are closed you can tell iptables to incoming traffic using:

sudo iptables -A INPUT -p tcp --dport PORT_NUMBER_HERE -j ACCEPT

For a complete HowTo about iptables check here

Also this is a very good tutorial on setting a mail server on Ubuntu 12.04 using Postfix, Dovecot and MySQL for virtual user mailboxes (personally tested on production server)


Upgrade to Xubuntu 11.04 Breaks Wireless

Delete the connection and redo it. Of course not sure it will work, but ........


SSTP connection established, but doesn't work

Add this route using the command line or the VPN Connection Settings:

route add -net 10.10.99.24 netmask 255.255.255.255 metric 1 gw 192.168.0.3


I would start by installing the missing library:

Open a terminal and type:

sudo apt-get install libharfbuzz0b


How can I lock my screen and keep my youtube playlist going?

Run sudo apt-get install gnome-screensaver, and then gnome-screensaver-command -l to lock your screen but keep processes running. Or, run sleep 1 && xset dpms force off to sleep your screen and do the same.  You can set them as a shortcut on "Keyboard". YES!


How to recover from uninstall of ubuntu-desktop?

'ubuntu-desktop' and several other key packages

As it may be possible to reinstall all removed packages this is a time consuming process, even more so as we obviously don't exactly know what packages and how many were removed.

It is safe to reinstall Ubuntu and keep all private data from your home when you take care not to choose "Erase" during the installation process. By choosing "Upgrade" as depicted below all you data in your /home are kept untouched. However you will have to reinstall additional packages that are not installed by default and you will also have to reinstall customizations you may have made outside your HOME directory.

As always it may still be wise to backup your data before you do so.


LibreOffice Writer inserts picture only on first page

Try changing the image's anchor:

There are various options available - to paragraph/character generally works:

Anchoring images
You can anchor images as a character or to a page, paragraph, or
character. The method you choose depends on what you are trying to
achieve.
To Page The image keeps the same position in relation to the page margins. It does not move as you add or delete text or other graphics.
This method is useful when the image does not need to be visually
associated with a particular piece of text. It is often used when
producing newsletters or other documents that are very layout
intensive, or for placing logos in letterheads.
To Paragraph The image is associated with a paragraph and moves with the paragraph. It may be placed in the margin or another
location. This method is useful as an alternative to a table for
placing icons beside paragraphs.
To Character The image is associated with a character but is not in the text sequence. It moves with the paragraph but may be placed in
the margin or another location. This method is similar to anchoring to
a paragraph but cannot be used with drawing objects.
As Character The image is placed in the document like any other character and, therefore, affects the height of the text line and the
line break. The graphic moves with the paragraph as you add or delete
text before the paragraph. This method is useful for keeping images in
sequence in a procedure (by anchoring them as a character in a blank
paragraph) or for adding a small (inline) icon in sequence in a
sentence.
To Frame If the image has been placed in a frame, you can anchor the graphic in a fixed position inside the frame. The frame can then
be anchored to the page, a paragraph, or a character, as required.

Source


Yes it is possible. see here How to Install Ubuntu on separate hard drive in a dual boot?
and http://www.linuxbsdos.com/2012/07/23/dual-boot-ubuntu-12-04-and-windows-7-on-a-computer-with-2-hard-drives/


You have to give each key an unique name. You are having a problem as you new key has the same name as the old key.

See http://bodhizazen.com/Tutorials/SSH_keys#Generate


First we need to install Apache 2. Either via a terminal or via the
software center.

Go to the software center. Search for Apache 2 and then install it.
Type sudo apt-get install apache2 in a terminal.
Reboot with sudo reboot

Look in /var/www/ place all of your html/css etc, files here.
Open a web-browser and go to http://localhost/FileName

If you need more information about web server, ssh, or webdesign try these links:

Ubuntu help regarding Apache 2.
What's the best way of handling permissions for apache2's user www-data in /var/www?.
If you need to access the web server via a network use ssh, how to set up a ubuntu server to be (securely) available from internet?.


Wired or Wireless cant connect to İnternet with Acer aspire 5750G

Its possible that Windows-8 on exit/power-off disables a soft-key that prevents WiFi. Then , under Ubuntu, you are unable to access that soft-key toggle.

It is sometimes in BIOS, but may be more under OS control.

Needs more detail, to better answer.


Convenient way to use gpg on Ubuntu Touch

gpg is available in the terminal app by default on Ubuntu touch so you shouldn't have to change your process. I use it to store my password for websites.

E.g. http://www.softwareontheside.info/2016/05/using-gpg-as-last-pass-alternative.html


Problem with downloading applications from Ubuntu Software Center

As regards the problem with Ubuntu Software, I think it can be fixed if you make sure you have the latest version of all packages. Open a terminal window with Ctrl+Alt+T and run these commands:

sudo apt update
sudo apt upgrade


"Can't alloc filename" when executing mdb-export on a mounted file

Not an answer, but too long for a comment.

This is where the error comes from:

mdb->f->filename = (char *) mdb_find_file(filename);
if (!mdb->f->filename) {.
    fprintf(stderr, "Can't alloc filename\n");

So let's see what mdb_find_file does...

Seeing the beginning of the function, this is probably what fails:

while (dir[i]) {
    if (!strlen(dir[i])) continue;
    tmpfname = g_strconcat(dir[i++], "/", file_name, NULL);
    if (!stat(tmpfname, &status)) {
        g_strfreev(dir);
        return tmpfname;
    }
    g_free(tmpfname);
}
g_strfreev(dir);
return NULL;

The function returns NULL, hence the fail later.

It looks like it's telling us that it can't find the filename.

Did you try using the full path? Did you try using the UNC path? Did you try using the smb:// path?


Cursor jumps accros the screen at random times

Had the same thing.  Cleaned my touchscreen and now it's all good.


I had large text all tuned for a media centre that's a distance away.

Today I opened Nautilus to find same thing, icon's huge, text tiny, no matter what I set Universal Access or zoom to.

After a full restart it's back to responding.

I've NEVER run into this in any version previous to 14.04. Perhaps due to a recent update?

Anyhow, try Universal Access settings if you haven't yet. If no effect, restart and try again.


The question is too general since you did not provide the Internal error detail's
However you could try to download ubuntu images from the virtualboxes website.
http://virtualboxes.org/images/ubuntu/


How do I share my Ubuntu's Internet connection with a LAN (via hardware router)

Here's how I did it:

Equipment:

Ubuntu 11.04 Desktop on 1st Gen. eeePC
Linksys WRT120N Wireless N Router
Huawei E620 USB Broadband Modem
Ethernet cable

Hardware Setup:

Huawei plugged into eeePC
Ethernet cable plugged into Ethernet port
other end of Ethernet cable plugged into the Internet port of The Linksys

Ubuntu Setup:

connect the Huawei to the Internet
disconnect the wired connection (Auto Eth0) in network tray icon
create new wired connection (Edit Connections... > Add, enter a name) and select Shared To Other Computers  from IPv4 settings tab.
connect to this new wired connection
note down the settings for this connection under Connection Information, and the DNS servers for the Huawei connection

Linksys Setup:

connect a computer on the receiving side to the Linksys (wired or wireless)
open a browser in this computer, navigate to Linksys (192.168.1.1 is default, user and password should be both admin)
Change Internet Connection Type to Static IP
Under Internet IP Address I put the number that came after the eeePC's IP address for this connection (again, not the IP for the Huawei connection), this was just a guess as I'm pretty clueless about how this works.  So, my Ubuntu machine had an IP of 10.42.43.1, and I gave the Linksys 10.42.43.2
Subnet Mask should be same as the eeePC, 255.255.255.0
Default Gateway should be the eeePC's IP address, 10.42.43.1 in my case.
DNS 1 (etc.) should be the same as the Primary DNS (etc.) used by the eeePC in the Huawei connection.
Click Save Settings.

And now all machines on my LAN can connect to the eeePC's Internet via the linksys router.  All is well.


Does systemd try to mount my luks keyfile?

The thing is that systemd-generator-crypttab will parse the file and check for devices that it could mount.

To disable this behavior alltogether, pass luks.crypttab=no to the kernel command line in /etc/default/grub and run sudo update-grub. Obviously this will disable intended behavior of that generator, too. It is, however, possible to do this in this case since it's mounting the root partition.


Acer Aspire One D257 Laptop doesn't restart

Thanks to Neo Cambell for posting the hyperlink to   http://www.expertcore.org/viewtopic.php?f=20&t=3009

Thanks to Saman for the fix

I did the following and it worked

Type the command:
sudo nano /etc/default/grub
Find GRUB_CMDLINE_LINUX=”” and change it to GRUB_CMDLINE_LINUX=”reboot=efi”
Press Ctrl-O to save and then Ctrl-X to exit.
Type the command:
sudo update-grub
Shutdown system.
Reboot and then attempt restart.


On 32-bit, it's how the kernel is hardwired when compiled. It includes a line in /usr/src/linux-source-3.2.0/debian.master/config/i386/config.common.i386 that reads:

CONFIG_NR_CPUS=8

which sets CPUs to 8. If you ensure you use the 64-bit (AMD64) CD, you will get up to 256 cores. If you use 32-bit(i386) version without hyper-threading, you get 8 working cores out of the total of 16, which is still a waste. So, I guess you need to use the 64-bit version if at all possible. You can try to file a bug complaining about the low limit.

I may file one later, but I'll post if I will.


I used to start Navicat from Bash till I figured out the solution.
To add Navicat to the menu, create a Launcher item in /usr/share/applications. Change the Exec line to match the path where you unzipped navicat.
 The solution has nothing to do with wine.

[Desktop Entry]
Name=Navicat
Comment=Database Admin Tool
Exec=/bin/sh  "/opt/navicat/start_navicat"
Icon=/path/to/icon
Terminal=false
Type=Application
Categories=Wine;
StartupNotify=true


How do I get a SB X-Fi Xtreme Audio CA0110 working?

Development on ALSA's ctxfi driver generally is very plodding due to lack of open data sheets (so putting pressure on Creative to provide them without the mandatory NDA may help here). You may have better luck with a very recent ALSA snapshot at https://wiki.ubuntu.com/Audio/InstallingLinuxAlsaDriverModules or OSSv4.2 at http://www.4front-tech.com/developer/sources/testing/gpl/oss-v4.2-buildrc3-src-gpl.txt. Be aware that choosing the latter route requires significant time investment (but is possible).


How to install ubuntu 14.04 along side windows 8.1 using doss partition

Option 1:

Using "gparted" (Live ubuntu (sudo apt-get install gparted)) (or any disk partitioning tool), clear out one of the NTFS partitions to 'not partitioned', (hopefully that space is at least 18GB), and then proceed to the installation, Linux is usually installed on EXT4 partition and it is not for NTFS partitions. (Remember setting about 1GB of swapspace.) As long as GRUB detects windows, they won't work in each other's way.

Notes:

From the "wubi" tag: "A way to dual boot Ubuntu and Windows without partitioning. Wubi will be discontinued as of Ubuntu 13.04 (Raring Ringtail). Please, consider using a regular install."

Back up data before partitioning that disk.

Option 2:

Get a version of Ubuntu that supports wubi (13.04) then go and install.


Indicators showing the wrong color icons

It's possible that the theme is using a smaller set of icons because of the thickness of the bar, or the icon theme got changed for the theme,if changing themes does not work try changing the icon theme for the theme or changing out individual icons in that theme. So here is an example using the default "Ambiance" theme.

So your icons look similar to this, worse in your case.

We need to locate where the icons and themes are located.

/usr/share/icons is one place that icons are located.

/usr/share/themes is where the themes are located, it will be /usr/share/themes/Ambiance for our example
In /usr/share/themes/Ambiance/index.theme it will list what icon theme it is using. In this case it is using ubuntu-mono-dark

Next with that information navigate to usr/share/icons/ubuntu-mono-dark/status

This is where the status icons are, so then you need to select what pixel size your theme is using, from 16, 22, and 24. since your theme turned ugly it may be possible that it is using the 16 pixel icons.

But since you have a wired icon I don't think this is the case, For example the 16 folder does not contain nm-device-wired.svg an will use a different, most likely the wireless icon for the network.

You can then use gksudo Nautilus to be able to change the icons, in the folders.

Since it seems that all your icons are dark, I would suggest changing the icon theme from usr/share/themes/Ambiance/index.theme first. For example I changed ubuntu-mono-dark to ubuntu-mono-light to see what would happen, and it didn't take effect when just loging out then back in, so I had to change the theme to something else then back again for It to take effect, and It then looked like this-
So you can then change that to any icon theme you have in usr/share/icons

Hopefully this will give you the basics so you can make your icons look however you want.


simple paranoid question about sudo and passwd

From the manual:

The passwd command changes passwords for user accounts. A normal user may only change the password for their own account, while the superuser may change the password for any account.  passwd also changes the account or associated password validity period.

Not supplying a username will set the current account’s password. Non-sudo accounts can only change their own.


grub does not display activity during boot

Grub is a boot loader, i.e. the software that is launched when the computer starts and whose role is to boot an another operating system. So, unless I have misunderstood, what you want is not seeing the messages from Grub, but instead you want to see the messages from Ubuntu itself during the boot process.

Generally speaking, what you have to do is to remove the "quiet" Linux command line option. However in recent versions of Ubuntu, this is not enough because the splash screen has not been designed to display activity. Therefore, you also need to prevent the splash screen from starting up, and you can do that simply removing the "splash" command line option.

In other words, you should edit some configuration so that your /proc/cmdline changes from:

BOOT_IMAGE=/boot/vmlinuz-... root=... ro quiet splash ...

to:

BOOT_IMAGE=/boot/vmlinuz-... root=... ro ...

To do that, you need to set GRUB_CMDLINE_LINUX_DEFAULT in /etc/default/grub to an empty string:

GRUB_CMDLINE_LINUX_DEFAULT=

We are almost there: now you need to remove the so called gfxpayload and vt_handoff. While these two options improve the boot experience, they will also prevent your messages from being displayed. AFAIK, there are no options in /etc/default/grub that you can tweak for that, so you are forced to open /etc/grub.d/40_custom and add the following at the bottom of the file:

function gfxmode {
    set gfxpayload=
    set vt_handoff=
}

Simple, but effective.


Upgrade from 12.10 to 13.04 - Unity not loading

I am also facing the same issue.
I went through many websites, and found that unity --replace might help. Try this if it recovers for you, its not recovering for me.


Try running gwibber from the command-line. You can do that by starting a terminal (Menu > Accessories > Terminal) and then typing gwibber and hitting enter. If it's crashing on startup, it'll probably tell you why.

If Gwibber isn't working for you, you can always try Tweetdeck. It's closed source, but functional.


Does upgrade affect Ubuntu or Kernel version?

No. When you're running dist-upgrade it will only upgrade your system according to the current software repository. That being said it will not upgrade 13.10 to 14.04. The do the full distribution upgrade, you will need to change your software repositories to 14.04.
If you run "sudo apt-get linux-generic", it will only upgrade the kernel. If you run "sudo apt-get upgrade" however it will upgrade all packages that have an update & it may include the kernel as well.
Technically speaking, yes, the kernel (Linux) is the operating system. That is why the upgrade option for apt-get is dist-upgrade which stands for "distribution upgrade". Kernel (Linux) + all applications make up the distribution. If you upgrade from Linux kernel version 3.12.x to 3.13.x, you have technically upgraded the "operating system", but you haven't upgraded your "distribution" which might still be Ubuntu 13.10 (and not Ubuntu 14.04).


Internal microphone not listed in sound settings

My microphone stopped working when I upgraded to 12.04 LTS.

I installed Pulse Audio Volume Control. One way to do this is:

sudo apt-get update
sudo apt-get install pavucontrol

Then:
Under the "Configuration" tab, selected "Analog Stereo Duplex".
Under the "Input Device" tab, pushed the mute button (which unmutes if muted).

Now my microphone works.


The problem turned out to be related to the Asus BIOS firmware. I needed to change options that were already the correct ones to the "wrong" values (non-CSM) and then back to the correct (CSM) ones in order for the laptop to understand I would like to boot the USB Flash drive in non-UEFI mode so that Ubuntu will also install Grub in that mode.
After that it was the same as this answer in that I could ignore the "this won't work without an EFI System Partition" warning.


From this discussion, if it applies to you as well (first part):

  The permissions are:

drwxr-xr-x  2 root root   4096 Mar  6 13:58 .config

  Only folder in ~/ owned by root I might add.

  that being the case

sudo chown -vR matt:users /home/matt/.config

  Your user should own .config within your home folder


Unable to configure/setup 5.1 audio with 12.04

I've had a similar problem on the DX79SI HDA, the gnome-settings applet on the toolbar seems to do nothing but screw up the sound.

I find alsamixer does a much better job. It's not a fix but for me at least it's a workaround so I can have some way to watch 5.1 surround sound movies.


CronJob to copy a directory on a remote server

Use following command to edit your cron job:

crontab -e

Then add following to the end of that:

0 0 * * * lftp -u username,password -e "your command;quit" ftp.site.com

Obviously you must install lftp package beforehand.


MongoDB 3.0.2 won't start after upgrading to Ubuntu 16.04

remove upstart-sysv you can start mongo by a systemd unit.
check your mongod.config configuration file. It shouldn't have processManagement.fork: true
check your mongo dbpath and log folders mongodb user (in service file) that you run your script with should have permission to access these files.
if still have problems check your mongod.log file (you specified it in config file) you can find more detailed errors there.


Nvidia X Server Settings don't save screen position settings

There are many possible reasons why a screen configuration does not "survive" a restart. In most cases, there are local sources like the monitors.xml file that simply overrule previously made settings.

Finding out what it is exactly, can be time-consuming, so my approach would be the practical solution: simply overrule whatever happens on log in by a simple command or small (xrandr) script. In this case, it is probably done by the command:

xrandr --output VGA-0 --pos 0x0 && xrandr --output DVI-I-0 --pos 1366x0

which arranges the screens from left to right, which you should always do.

Add the command to startup (log in)

Choose Dash > Startup Applications > Add, add the command:

/bin/bash -c "sleep 15 && xrandr --output VGA-0 --pos 0x0 && xrandr --output DVI-I-0 --pos 1366x0"

Explanation:

postioning a screen can be done with the command:

xrandr --output VGA-0 --pos 0x0

to position e.g the left screen, then:
Always arrange the screens from left to right
The sleep 15 is to make sure the command runs when the desktop is "ready", and possible local settings do not overrule the command.


Disclaimer: doing as described will disable swap encryption.

To repair this situation as I suspect you might have encrypted your swap file boot from you installation usb or disk and select Try Ubuntu, then:

Mount your root partition:

sudo mount -t ext4 /dev/sdaX /mnt

Chroot into that mount:

sudo chroot /mnt

BACKUP YOUR DATA USING A TOOL LIKE RSYNC
Fix the encrypted swapfile:

Remove the swap file entry in the /etc/crypttab with sudo nano /etc/crypttab, may look something like this:

cryptswap1 /swapfile /dev/urandom swap,cipher=aes-cbc-essiv:sha256,size=256

Remove Mount point for swap in /etc/fstab too.
Make new swap:

 sudo swapoff /swapfile
 sudo rm -rf /swapfile
 sudo dd if=/dev/zero of=/swapfile bs=1024M count=<put_half_the_size_of_RAM>
 sudo mkswap /swapfile
 sudo chmod 600 /swapfile
 sudo swapon  /swapfile

Add mount for swap at boot:

/swapfile      none   swap    sw    0    0

Disengage the mount:

exit
sudo umount /mnt

Now shutdown and reboot, if you see any errors run fsck /dev/sdaX.

Notes

X is the partition number for you root file mount /.
For the dd command if your RAM is 8G use count=4 to run that command. To increase your swap file size use this dd command:

sudo dd if=/dev/zero of=/swapfile bs=1M count=1024 oflag=append conv=notrunc


What are the IOMMU Groups that come with the kernel 3.6?

IOMMU Groups,are new featurs to kernel 3.6 which improve the isolation of PCI and PCIe devices using I/O virtualisation technologies such as AMD-Vi and Intel's VT-d.

The IOMMU Groups feature is also the basis for the VFIO (Virtual Function I/O) userspace driver framework (1, 2, 3); mainly intended for KVM, this feature is designed to pass through PCI and PCIe devices to guests, allowing them to access these devices at low latency and high data throughput levels, and without any risk to the host.

Details on VFIO are available in the documentation and in this article.


Move running program to background in bash

To my best of knowledge you could run it and then append an & after it like this: myprogram &

I may be very wrong here however.

[EDIT]: Taking a closer look to this, if you run the above, the application will close when you close the terminal. If you would like the application to run in the background, then, as far as I know, the application needs to be written in such a way that supports daemon behavior.

[EDIT 2]: nohup command & appears to be closer to what you want to achieve. Nohup will allow an application to run, and will both ignore its input and redirect its output to a file called nohup.out in the current directory.


I solved the issue by downloading the drivers off:

http://www.intel.com/content/www/us/en/support/network-and-i-o/wireless-networking/000005511.html

Then copying the *.ucode files to /lib/firmware.


There are a few programs from different mainboard manufacturers with functionality to increase power output on USB ports, but I wasn't able to find an equivalent for Linux. The closest I could find was some program to charge iPads with no clear reference what it really does. I assume that this functionality is not currently implemented in the Linux kernel or nobody tried solving this problem before, coming up with a popular solution. Somebody please correct me if I'm wrong.


How to keep internet connection alive until a given time?

If you except no output, simply put ping www.google.som into your cron with frequency set to 5 minutes.

Open cron file with crontab -e (in terminal)

and add new entry

*/5 17-23 * * * ping -c1 www.google.com

Where:

*/5 means every minute divisible by 5

17-23 hours

* every day of month

* every month

* every day of week

Save and you are done.


I don't use a mac but saw this articles that should help:

From an askubuntu answer:

use of the xautomation package, or
use of the autokey-gtk package.

Please see if it flies for you.


Can I remove the "round square" around an application icon on the launcher?

I may have found a solution that might work, if you wanted to make your desktop more like Windows 7 (as always, make a backup of everything, and be sure you know how to revert the changes you made, just in case):

To move the Unity Launcher to the bottom of the screen

sudo add-apt-repository ppa:paullo612/unityshell-rotated
sudo apt-get update && sudo apt-get install unityshell-rotated libnux-1.0-0 compizconfig-settings-manager

Then enable Ubuntu Unity Plugin Rotated and disable Ubuntu Unity Plugin in ccsm.

To remove the square backlight

Next, open the new plugin, go to "experimental", and set the launcher opacity to 0.
Find the backlight mode option and set it to always off.

If it still doesn't look the way you want it to, follow the rest of the instructions from here and see how that turns out.


How to connect four computers together without using any external device?

Be aware that your network cards support both straight and crossover cable. If not you will need  crossover Ethernet cables.

Then, once all the devices are connected :

Enable forwarding

First activate the IPv4 forwarding on your devices.

To enable it on the fly you can use :

echo 1 > /proc/sys/net/ipv4/ip_forward

To enable it permantly, edit the file /etc/sysctl.confand uncomment the line with net.ipv4.ip_forward = 1. Then reload the conf : sysctl -p /etc/sysctl.conf.

Define IP and Routes

Then, configure the IP and routes of your devices.

To perform that you can edit directly the file /etc/network/interfaces.

Example :

auto eth0
iface eth0 inet static
        address 192.168.1.1 # c1, configure the same subnet in the c2 interface that is connected to the c1 device
        netmask 255.255.255.0
        up route add -net 192.168.2.0 netmask 255.255.255.0 gw 192.168.1.1

If all of your devices are in the same subnet, you does not need to describre routes.

Debug/Confirm

If this does not work, check the Firewall and edit it if required :

sudo iptables -L

Hope this answer help.

Edit

Since C2 is directly connected to both subnetworks you just have to set a route to the third network.

You can specify multiple interfaces in /etc/network/intefaces

auto  [interface1]
iface [interface1] inet static
        address 192.168.1.2 # The same subnet that is configure for C1
        netmask 255.255.255.0
        # You don't need specific route for this interface because there is no another network behind C1

auto [interface2]
iface [interface2] inet static
        address 192.168.2.1 # C2<--->C3 subnet
        netmask 255.255.255.0
        up route add -net 192.168.3.0 netmask 255.255.255.0 gw 192.168.2.2 # Where 192.168.3.0 is the C3<-->C4 subnet and 192.168.2.2 the C3 address of the interface in the subnet C2<-->C3

I did not test this configuration but this should work. Once you finish to configure you can check the routes with ip route command.

C3 and C2 have direct route to both network. So you just have to define a route to the third network (C3 <--> C4 for C2 and C1 <--> C2 for C3). Once C2 and C3 have access to all network, you just have to defined them as default gateway for C1 and C4.


Will the new Ubuntu softwarfe for desktops work just as well if installed on a laptop?

There are currently 2 versions of the distro:

Server version, for server use, without the "useless" packages (from a server point of view), like X/Gnome/KDE etc... , and default install of all server-related packages like Apache, Bind9, etc... The installation process for the server version is CUI only (of course).
Desktop version, for everything else (from desktop to tablet to smartphone to Raspberry pi).

So don't freak out, you can take the desktop version on your laptop, it'll be fine!


Upgrade from windows 7 to 8.1 alongside Ubuntu

Insert your Ubuntu LiveDVD / USB .
after boot use try Ubuntu
when live system started
open terminal by using CTRL + ALT + T
then type sudo grub-update
then type sudo grub-install

That's it !
Update 1
mostly you will get error when using sudo grub-install on live environment so do steps bellow (on live env too):
P.S: make sure you have completely shutdown your Windows before do this
to do this from windows CMD or RUN type shutdown /r /t 0 .

Open Terminal   (CTRL + ALT + T).

mount the Ubuntu partition by sudo mount /dev/sd# /mnt replace # with your Ubuntu partition as ex. sudo mount /dev/sda2 /mnt

mount the boot partition sudo mount /dev/sd# /mnt/boot replace # with boot partition, in most cases the boot partition is "sda1"

finally use sudo grub-install --root-directory=/mnt /dev/sdX replace X with the order of disk you want to install grub on it , if you use a single hard drive  it will be sda

It's done for now see Update 2
Update 2 (can also used for grub rescue)
after you installed grub successfully from Update 1 and restart , you will get a grub command line screen do the following commands :

type ls you will get the partitions in order similar to this :
(hd0)(hd0,msdos4)(hd0,msdos3)(hd0,msdos2)(hd0,msdos1)

type ls (hd0,X) replace X with the number ,
you will get unknown file system , do it until you get file system ext2 that's our target

after we get our target partition type set root=(hd0,X) replace X with target partition number

then set prefix=(hd0,X)/boot/grub

(For x32 bit, works both for i386 and i686 systems) type insmod /boot/grub/i386-pc/linux.mod

(for x64 bit systems do step 5 too if you get Not found do this ) type /boot/grub/linux.mod

(if step 6 not working only) type ls /boot/grub to see the directories and files  check every folder to find the linux.mod file , then do the step 6 with modified path.

type normal you will find your normal grub boot-loader boot into Ubuntu

from Ubuntu terminal type sudo update-grub

then sudo grub-install /dev/sdX replace X with the device , mostly it's sda

All done ! .


permanent changes in ubuntu on USB stick without installing Ubuntu

You can find instructions here: http://www.pendrivelinux.com/creating-an-ubuntu-live-usb-from-cd/ :)

"Persistence" is what they call it when you can save your settings and data and it's not just live.

It should be possible to make the individual folders that you save encrypted and require a password, the same way as when as booting your OS from your internal hard drive.


Has the minimize speed been increased in 12.10?

The animation doesn't actually change according to the minimize-speed-threshold. Even when you change its value from 100 to 0, the animation is still normal like what you encountered, @Nirmik. What I observe though is that if the minimize-speed-threshold is set to 100 (which is the default), and the minimize-count is set to 0 (also the default), the animation is slow just like when we first run 12.10 after upgrading/installing it.

Now, the animation will actually get faster every time you minimize a window, since the minimize-count will increase, and the larger it is the faster the animation. The increase in value of minimize-count will stop up to the value of the minimize-speed-threshold.

If you click on the minimize-count, you will see a description that says:

This is used to adjust the animation speed by making it progressively faster the more it is used.

For Slow Animation, I suggest to set up the following:

minimize-count = 0
minimize-fast-duration = 1000
minimize-slow-duration = 1000
minimize-speed-threshold = 0

For Faster Animation, I suggest to lower down the value of minimize-fast-duration and the minimize-slow-duration.


How can I make it so I can run a specific program, just by typing its name in the console?

This can be crudely accomplished with an alias. You can create a permanent bash alias by adding a single line to your .bashrc file.

In the terminal run nano ~/.bashrc

Add the the following line at the bottom:

alias LightTable='/full/path/opt/LightTable/deploy/LightTable'

notice I added thee full path instead of the . so this will work in any working directory. Close and reopen the terminal or run source ~/.bashrc to reload the bashrc file.