How do I make java default to a manually installed JRE/JDK? I have Ubuntu 12.04 amd64 installed on my machine, on the previous versions of Ubuntu it was deadly easy, now there is this command update-java-alternatives with a really bad man page.

I just have my JDK unpacked on a mounted partition like /media/mydisk/jdk, how i can force the use of that JDK instead of the one that comes in the Ubuntu repository?

What is the logic behind this update-java-alternatives ?

You can do this with sudo update-alternatives :

# Adding a new alternative for "java".
sudo update-alternatives --install /usr/bin/java java /media/mydisk/jdk/bin/java 1

# Setting the new alternative as default for "java".
sudo update-alternatives --config java

You have to do this for other jdk components too. These components are appletviewer, extcheck, idlj, jar, jarsigner, java, javac, javadoc, javah, javap, javaws, jconsole, jdb, jexec, jhat, jinfo, jmap, jps, jrunscript, jsadebugd, jstack, jstat, jstatd, keytool, mozilla-javaplugin.so, native2ascii, orbd, pack200, policytool, rmic, rmid, rmiregistry, schemagen, serialver, servertool, tnameserv, unpack200, wsgen, wsimport, xjc.

For further information, you can see the man pages for update-alternatives : man update-alternatives.

The command update-java-alternatives sets alternatives for java components and it seems to use update-alternatives for this.

EDIT: The answer above targets Java 6.

For Java 7, you have to add jcmd to the Java 6 list.
For Java 8, you have to add jcmd, jjs and jdeps to the Java 6 list.
For Java 9, you have to add jcmd, jjs, jdeps and jshell to the Java 6 list.

Some of java related links are at master level and cannot be used as slave in update-alternatives --install. Used the following commands to install oracle jdk and update alternatives. Hope it helps.

update-alternatives --install /usr/bin/java java /usr/java/jdk1.7.0_45/bin/java 10000 --slave /usr/bin/appletviewer appletviewer  /usr/java/jdk1.7.0_45/bin/appletviewer --slave /usr/bin/java-rmi.cgi java-rmi.cgi  /usr/java/jdk1.7.0_45/bin/java-rmi.cgi --slave /usr/bin/jmap jmap  /usr/java/jdk1.7.0_45/bin/jmap --slave /usr/bin/jstatd jstatd  /usr/java/jdk1.7.0_45/bin/jstatd --slave /usr/bin/apt apt  /usr/java/jdk1.7.0_45/bin/apt --slave /usr/bin/javac javac  /usr/java/jdk1.7.0_45/bin/javac --slave /usr/bin/jcmd jcmd  /usr/java/jdk1.7.0_45/bin/jcmd --slave /usr/bin/jps jps  /usr/java/jdk1.7.0_45/bin/jps --slave /usr/bin/jvisualvm jvisualvm  /usr/java/jdk1.7.0_45/bin/jvisualvm --slave /usr/bin/rmic rmic  /usr/java/jdk1.7.0_45/bin/rmic --slave /usr/bin/extcheck extcheck  /usr/java/jdk1.7.0_45/bin/extcheck --slave /usr/bin/javadoc javadoc  /usr/java/jdk1.7.0_45/bin/javadoc --slave /usr/bin/jconsole jconsole  /usr/java/jdk1.7.0_45/bin/jconsole --slave /usr/bin/jrunscript jrunscript  /usr/java/jdk1.7.0_45/bin/jrunscript --slave /usr/bin/idlj idlj  /usr/java/jdk1.7.0_45/bin/idlj --slave /usr/bin/javafxpackager javafxpackager  /usr/java/jdk1.7.0_45/bin/javafxpackager --slave /usr/bin/jdb jdb  /usr/java/jdk1.7.0_45/bin/jdb --slave /usr/bin/jsadebugd jsadebugd  /usr/java/jdk1.7.0_45/bin/jsadebugd --slave /usr/bin/native2ascii native2ascii  /usr/java/jdk1.7.0_45/bin/native2ascii --slave /usr/bin/wsgen wsgen  /usr/java/jdk1.7.0_45/bin/wsgen --slave /usr/bin/jar jar  /usr/java/jdk1.7.0_45/bin/jar --slave /usr/bin/javah javah  /usr/java/jdk1.7.0_45/bin/javah --slave /usr/bin/jhat jhat  /usr/java/jdk1.7.0_45/bin/jhat --slave /usr/bin/jstack jstack  /usr/java/jdk1.7.0_45/bin/jstack --slave /usr/bin/schemagen schemagen  /usr/java/jdk1.7.0_45/bin/schemagen --slave /usr/bin/wsimport wsimport  /usr/java/jdk1.7.0_45/bin/wsimport --slave /usr/bin/jarsigner jarsigner  /usr/java/jdk1.7.0_45/bin/jarsigner --slave /usr/bin/javap javap  /usr/java/jdk1.7.0_45/bin/javap --slave /usr/bin/jinfo jinfo  /usr/java/jdk1.7.0_45/bin/jinfo --slave /usr/bin/jstat jstat  /usr/java/jdk1.7.0_45/bin/jstat --slave /usr/bin/serialver serialver  /usr/java/jdk1.7.0_45/bin/serialver --slave /usr/bin/xjc xjc  /usr/java/jdk1.7.0_45/bin/xjc
update-alternatives --install /usr/bin/policytool policytool /usr/java/jdk1.7.0_45/bin/policytool 10000
update-alternatives --install /usr/bin/servertool servertool  /usr/java/jdk1.7.0_45/bin/servertool 10000
update-alternatives --install /usr/bin/tnameserv tnameserv  /usr/java/jdk1.7.0_45/bin/tnameserv 10000
update-alternatives --install /usr/bin/keytool keytool  /usr/java/jdk1.7.0_45/bin/keytool 10000
update-alternatives --install /usr/bin/rmid rmid  /usr/java/jdk1.7.0_45/bin/rmid 10000
update-alternatives --install /usr/bin/unpack200 unpack200  /usr/java/jdk1.7.0_45/bin/unpack200  10000
update-alternatives --install /usr/bin/rmiregistry rmiregistry  /usr/java/jdk1.7.0_45/bin/rmiregistry 10000
update-alternatives --install /usr/bin/orbd orbd  /usr/java/jdk1.7.0_45/bin/orbd 10000
update-alternatives --install /usr/bin/pack200 pack200  /usr/java/jdk1.7.0_45/bin/pack200 10000

PS:
Should be executed as root/sudo.


Grub boot loader menu not showing in dual boot, but individual loader contains different OS I have Windows 8 installed on my system. To install Ubuntu from a bootable USB, I was not getting the boot from USB option. To get that I found a solution that I have to switch to Legacy Boot. So I did that and then installed Ubuntu 16.04. After a successful installation, when I restarted the system I did not get the grub boot loader menu to choose the OS. Instead it boots directly to Ubuntu. Now if I change the boot option in Boot Manager to UEFI, then it boots directly to Windows 8. So should I have to install both OSs in the same Legacy mode to get the Boot Menu at startup?

Enabling BIOS/CSM/legacy support was a mistake. For all the gory details, see my Web page on the subject.

Instead, you should have looked into overcoming your problems booting the installation medium. Chances are it was improperly prepared -- some tools don't copy the EFI-mode boot loader from the .iso file to the USB flash drive; and sometimes there are quirky incompatibilities between specific tools and specific computers. The page I just referenced includes a section on this subject, so read it for details. The short version is that Rufus and the standard Linux tool dd generally do the best job, in my experience.

Thus, one way to fix your problem is to disable the CSM in your firmware settings, re-create your installation medium, and re-install Ubuntu. This approach is overkill from a technical perspective, but is likely to be the easiest solution, given that you haven't yet used Ubuntu much. If you're averse to an "overkill" solution or if you've spent much time customizing your settings or creating Ubuntu-specific data, though, you may prefer to install an EFI boot loader for Linux to replace the BIOS-mode boot loader you've got now. The two ways to do this that are likely to be easiest are:

Boot Repair -- The Boot Repair tool can re-install GRUB to your computer. You'll have to run this tool from an EFI-mode emergency system, though; running it from your current BIOS-bootable installation will be completely pointless. Thus, you'll need to disable your CSM, or at least learn how to control your boot mode.
rEFInd -- You can install my rEFInd boot manager, which is an EFI-mode boot manager. You can install it manually from Windows, which is likely to be awkward; or you can download the USB flash drive version of rEFInd, use it to boot Ubuntu in EFI mode, and then install the Debian package or PPA to install it permanently on your hard disk. One caveat is that, if Secure Boot is active, you'll need to disable it, and if you want to re-enable it, you'll need to jump through some hoops.

Just Type a command sudo update-grub  it works I had tried that.
If you want can refer this video link
https://www.youtube.com/watch?v=j4n_8PlNt_U


Add new hard drive to mirror existing LVM drive with raid1 I have a 320GB hard drive with an LVM2 volume group that was created as part of the default installation. If I put a second 320GB hard drive into the computer, can I make the second drive mirror the first using Linux software RAID1 or something similar? I tried adding a new RAID array in the Gnome Disk Utility, but it only gave me the option of creating an array with two empty partitions.

If anyone is still reading this older question, note that raid1 is now built-in to lvm2.  To mirror an existing lv on a new drive using lvm2:

install the new drive and create lvm2 partition(s) (at least the same size as your existing drive's lvm partition(s), or those you want to mirror in any case) (use parted /dev/newdrive or use sfdisk -d /dev/sda | sfdisk /dev/sdb assuming sdb is your new drive)
initialise new partition(s) as lvm2 pv(s) (pvcreate /dev/newpartition)
extend your existing lvm2 vg(s) to the new partition(s) (vgextend /dev/myvg /dev/newpartition) and then first check and confirm that the number of extents on the new drive is the same or more (pvdisplay) Free PE on new drive should be more than Total PE of the old drive.
for each lv that you want to mirror on the new partition:

lvconvert -m1 /dev/myvg/existinglv /dev/newpartition

(ie, convert my existing (linear) lv to a raid1 mirrored lv with 1 additional mirror leg, and allocate the new PEs required for the mirror leg on the given new pv/partition)
note that you will need some additional space on the existing and new lv, because lvm2 raid1 mirror segments (the default) store their logs on the same pv/segment as the mirror leg (you will need an additional 1 PE per mirror leg on both the existing and new pv).

If you get an error like 1 extents needed, but only 0 available then it might indicate a problem creating the log, and you might need to create some free space on the existing pv, possibly by shrinking the relevant lv to allow room (lvreduce).  If you do this, you might need to resize the underlying filesystem beforehand (resize2fs)).

I achieved this by backing up all of my data onto an external drive, reinstalling Ubuntu onto a raid array, and then restoring my backup in the new file system. In particular, I followed these steps:

Backup data using instructions at this forum thread using command

sudo tar cvpzf backup.tgz --exclude=/proc --exclude=/lost+found --exclude=backup.tgz --exclude=/mnt --exclude=/sys --exclude=/dev --exclude=/etc/fstab --exclude=/etc/mtab --exclude=/boot --exclude=/media /

replacing backup.tgz in both cases with the location of the backup
Turn computer off and install two hard drives with the smaller one being at least the size of the raid array (possibly including the original hard drive)
Boot into install disk and run the installer.
Using manual partitioning, make a partition in each hard drive for each partition in the final file system. For example, if you want your /home partition to be 100 GB, make a 100GB partition in each hard drive. Set all partitions that will be part of a RAID array to RAID autodetect (0xfd).
Choose to make raid arrays, and put each partition into a raid array with the corresponding partition on the other disk.
Finish the installation as normal and reboot into the fresh Ubuntu installation.
Mount the external drive if it is not already mounted and restore the backup as described in the forum thread above using the command

sudo tar xvpfz backup.tgz -C /

Run sudo update-grub and then reboot. The new operating system should now be exactly like the original.

I prefer this method for a few reasons:

Making file system level copies instead of disk level copies seems preferable in general
It does not depend on keeping the partition structure the same
Once I figured out how to do it, the entire process took less time than the disk level copy took
It allows the installer to create the correct entries for boot devices and mounted devices, which need to change because raid partitions are referred to differently than regular partitions are.


Problem black screen with Lubuntu in Virtual Box I installed a Lubuntu 16.04 LTS (and a v.17) both architectures x86 and 64 bits.

The problem is when I shut down the Virtual Lubuntu (installed) then, sometimes runs ok but one of them, the machine shows how is starting Lubuntu, but only shows an black screen. I can't do anything. I tried several times and I got always the same problem.

It was working fine the same machine I was working since 1 month and I never get this problem...

(This is just a guess.)

After upgrading to VirtualBox 5.2.6-120293, I started getting the same «black screen».

Disabling «3D acceleration» and «2D video acceleration» (virtual machine «Settings» => «Display» tab => «Screen» sub-tab) has helped.


How do I pause/resume download and install from terminal? I mostly use terminal for installation of programs (as does mostly everybody). However, at times (particularly when I have low battery and no charger wire OR more importantly, when installer file is too big, installation is incomplete and I need to power down my system) I would like to pause the installation (while it is in downloading state) so that I won't loose already downloaded files.

How do I do this?

Ctrl+c cancels it but next time start from where you left
Ctrl+z stops process but then you can't do another process as it remains locked to the first process

Using one of the above methods is generally better than just closing the terminal, but if you just close the terminal while it's downloading packages, it should start the download right where it stopped next time you run sudo apt-get upgrade

If you want to restart the download after using Ctrl+z:

Check paused tasks by typing jobs in the terminal
To resume a process, type fg
If you have multiple tasks, then type fg 1, fg 2, etc…

Make sure, however, that you never stop it while it's installing the downloaded packages, since this will result in a lock on apt-get, which will require a computer restart or reconfiguration of apt, and you'll have to start at the beginning of the installation.
So make sure to only "pause" (close) the terminal when it's downloading, not installing.

If you would like to start another apt-get process - after pausing the first process, run sudo rm /var/lib/dpkg/lock && sudo rm /var/cache/apt/archives/lock; it won't look like it did anything, but you should be able to start another apt-get process.

To kill a command that you've paused with Ctrl+z, enter kill -9 %x into the terminal, replacing x with the number that the paused process is (see jobs). The process will remain in the list, but it will say "killed" after it instead of "stopped", indicating it is no longer active.

Sources : [ubuntu] How to pause download operation in terminal
Accidently pressed Ctrl-Z in a Linux terminal in Ubuntu Intrepid Ipex. What do I do now?
Starting, Stopping and Managing Jobs in the Ubuntu Terminal

If you want to pause the downloaded files from terminal, I hope you have downloading something url. Just copy it first. and enter this lines in that terminal

wget -m -P [download-url]

It can pulse the downloading files. Where as you want to resume to download or even after net is disconnected, want to resume the file. Simply run this in terminal:

wget -c -m -P [brokern url]

or

wget --continue [broken url]


Remember Ubuntu password but ask for sudo confirmation When I'm done with making Ubuntu remember my password and do not ask for it before risky actions...

Is there a way to get safe pop up confirmation window (without password input, just OK or cancel)?

So I will know when a pesky program runs a risky action that I don't want to proceed?

Or it is not developed since the program could just simulate a click on OK anyway?

No, there is no way to do this. If you enable sudo without a password (How to run sudo command with no password?), then any process you run can execute sudo and run code as root without any confirmation.

Let's write a small program for that:
Create /usr/local/bin/sudo:
#!/bin/sh
read -p "You sure you want to run sudo? " ans
case "$ans" in
y|Y|[yY][eE][sS]) ;;
*) exit ;;
esac
exec /bin/sudo "$@"

You could also create it in a temporary directory, add that directory to path before running that "pesky program". It's not 100% fullproff, but should handle most common cases.


Open another terminal window with the same SSH session as original window Is there a way to open a terminal window ( or tab ) with another instance of an open SSH session ?

EDIT: I have a terminal window with a remote ssh session into a server. I want to open a new tab connected to the same remote ssh session.

With File->New Tab I get another tab but I have to open another ssh session to the remote server.

Perhaps this could help: screen

It is not installed by default on Ubuntu, but is provided in the repositories.

It is very useful: ssh to a remote host and type screen to enter a screen session.

Start whatever time consuming task you like, and then press Ctrl+A followed by Ctrl+C to create a new window in the screen session.

This will spawn a new shell where you can do what you want. Create even more windows using the same command.

To switch between two windows quickly, use Ctrl+A followed by Ctrl+A again. As you can see, Ctrl+A puts screen in command mode.

Ctrl+A Ctrl+D will detach from the screen session. You can then disconnect from the host and log in again later and use screen -dr to resume your session.

To go to a specific screen window, type Ctrl+A followed by a number.

Screen will exit when all active windows are closed (or the shells within have exited).

I got this from SSH and SFTP sessions.

Edit-

tmux is an alternative to screen.
http://www.sitepoint.com/tmux-a-simple-start/

Yeah, in the terminal (menu) click on File -> New Tab

to open new tab in terminal

or are you asking for something else?


ubuntu 14.04 stuck in login loop, cannot login using any tty Ubuntu x64 on a Dell Inspiron 1525, not sure what to do, cannot login as guest or the one profile i created, even using the tty1-6. i've run boot repair and i've done a couple of the boot recovery solutions to no avail. i read many similar threads and posts from all over (re: nvidia cards, .Xauthority edits, reinstalling Unity, creating new user profiles, changing passwords, etc.) and i'm not sure how to accomplish some of the things people are suggesting. i can boot from liveusb, and see the hard drive, but i'm also trying to get some files from there, everything is backed up already from a couple of days ago, i just need maybe a handful of new ones. any suggestions on how to start trying to fix this? (note: i accessed & copied my new files via puppy linux, still wasn't able to copy from live usb, though)

Getting into recovery mode

Essentially the steps are the same as described in this answer

Boot the computer
On the grub menu select Advanced options for Ubuntu.
Select any entry that says recovery.Image
Select root shell . Image

Working around root shell

Once in the root shell, you can view the logs and attempt to gain a slight idea of what the issue might be. Logs are located in /var/log directory. The logs that you might consult are dmesg.0, kern.log, kern.log.1, syslog.

Here you can attempt to reset your own password, as well as create new user, in case your current username still fails to log in. That implies making chances to the system. However, initially root shell starts with your hard drive mounted in read-only mode. To allow changes to your system, do mount -o remount,rw /.

Changing your own password

That is fairly simple. Run passwd yourusername . You will get a prompt that asks to enter new Unix password and confirm.

Creating new user

Run useradd -m -G sudo newusername , where newusername is the new username that you want to have for new account. This command also adds the user to sudo group, so that you have admin privileges on that account.
Run passwd newusername to create password for that user
Confirm that the new username works properly by runnning su newusername

Regaining files with the new account

You can do this either from root shell or attempt to login graphically with new username first. My preference would be second choice.

change ownership of the previous home directory with sudo chown -R newuser:newuser /home/oldusername.
At this point you can either leave the directory untouched (suggested) or move files to your new directory. If you choose to move the files, continue reading. In your new directory create new directory called oldstuff. You can use mkdir ~/oldstuff for that.
You can approach this from couple different angles. If you only want stuff in the default directories, like Pictures,Downloads, and Videos, you could run something like this : find /home/olduser/Documents/ /home/olduser/Videos/ /home/olduser/Pictures /home/olduser/Desktop -type f -print0 | xargs -0 mv -t ~/oldfstuff. Beware that this command takes all the files from all those directories and stuffs them into one, thus if there's any duplicate names , they might not be moved over. Now, better way is to use rsync SOURCE DEST, for instance rsync -r /home/olduser ~/oldstuff.

LiveCD Recovery

As an alternative to the root shell recovery from grub, you can try LiveCD recovery. Basic idea is to take live media, such as installation USB or CD, mount your hard drive, bind certain folders,change root directory of the live media to the one on your hard drive, and change password or create users as described above. The process is well described on the Ubuntu documentation page.

Boot the Ubuntu Live CD.
Press Ctrl-Alt-F1
sudo mount /dev/sda1 /mnt (note sda1 is just example, you have to find which one is your Ubuntu partition with lsblk or sudo blkid. For instance , I know /dev/sda5 is my Ubuntu partition because it is TYPE="ext4")
sudo mount --bind /dev /mnt/dev
sudo mount --bind /proc /mnt/proc
sudo mount --bind /sys /mnt/sys
sudo chroot /mnt
sudo passwd yourusername
sudo useradd -m -G sudo newusername
sudo passwd newusername
When everything is done, sudo shutdown -r now to reboot back to your laptop's hard drive.

Have you try this:

 gsetting x.session Ubuntu

and then this:

 sudo apt-get install liux-efi-amd64_ linux-efi
 sudo apt-get update
 sudo apt-get upgrade
 sudo apt-get -f install
 sudo aptitude linux-efi
 sudo apt-get install --reinstall ubuntu-desktop

and it might work fine this way.


How to set default route with netplan, Ubuntu 18.04 server, 2 NIC I have two NIC, both is controled over DHCP. One have public IP, second private.

Both interfaces have static IP reserved in DHCP and both interfaces get right IP, but somethimes when reboot server I can't access from public, because default route is from private NIC.

How can I set permanently this with netplan ?

Public NIC ens18 (IP: 213.133.xxx.xxx)
Private NIC ens19 (IP: 10.10.10.xxx)

My netplan config is:

network:
  version: 2
  renderer: networkd
  ethernets:
    ens18:
      dhcp4: yes
      dhcp6: no
      nameservers:
        addresses: [8.8.8.8,8.8.4.4]
  ethernets:
    ens19:
      dhcp4: yes
      dhcp6: no

The issue is that networkd will bring up both networks, and both will have a default gateway set, and both will be at the same metric.

Netplan does not currently allow you to skip setting the route on one interface, but you can configure networkd separately to tell it to do this, by basing the config on what netplan has already generated.

I have copied the commands below. Here I am assuming that ens19 is the "secondary" interface for which you do not want a default gateway set -- note that to do this successfully, it also needs to happen before rebooting with the new interface (or you can copy part of the config, omit the MACAddress= line, etc. so that it's generic enough that a new interface will be matched).

sudo cp /run/systemd/network/10-netplan-ens19.network /etc/systemd/network
sudo vi /etc/systemd/network/10-netplan-ens19.network

Then add under [DHCP]:

UseRoutes=false            # if you don't want to apply any routes from DHCP

RouteMetric=200        # any number above 100 if you want the routes applied, but that they are less preferred.

If you don't have the file yet (ie. you have not attached the interface yet) then you could copy the contents of another interface set for DHCP, and remove MACAddress=.

In general, the file should look something like this:

[Match]
Name=interfacename

[Network]
DHCP=ipv4

[DHCP]
UseMTU=true
RouteMetric=200    # or UseRoutes=false, as you prefer.

I install server Ubuntu Server 18.04.1 LTS

$ uname -a
Linux srv02 4.15.0-34-generic #37-Ubuntu SMP Mon Aug 27 15:21:48 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux

.

# This file is generated from information provided by
# the datasource.  Changes to it will not persist across an instance.
# To disable cloud-init's network configuration capabilities, write a file
# /etc/cloud/cloud.cfg.d/99-disable-network-config.cfg with the following:
# network: {config: disabled}
network:
    ethernets:
        eth0:
            addresses: []
            dhcp4: true
            dhcp6: false
            nameservers:
                addresses:
                - 10.99.0.1
                search: []
    version: 2

Need change IP

$ sudo nano /etc/netplan/50-cloud-init.yaml

network:
    ethernets:
        eth0:
            addresses: [10.99.0.6/23]
            gateway4: 10.99.0.5
            dhcp4: false
            dhcp6: false
            nameservers:
                addresses:
                - 10.99.0.5
                search: []
    version: 2

  $ sudo netplan apply
  Invalid YAML at //etc/netplan/50-cloud-init.yaml line 9 column 0: found character that cannot start any token 9 column - addresses: [10.99.0.6/23]


My quest to find the fastest search app for Linux I miss "everything search" and "listary " of Windows - they are super quick to find and launch. Time for them to index my whole harddisk is 0.2 seconds[i guess they use the NTFS journal database]. They are automatically re-index instantly if some new files are created.

I want to locate a file in Linux by just its filename NOT its content. everything does the same in windows.

In Linux i have found two options that works for me. Time for them to index my whole harddisk using:

1st option: sudo updatedb (mlocate) 3 minutes to reindex the database.
2nd option: everything via wine ... roughly 5 minutes [it index even ext4 ].

Now I am a desktop user so i prefer a nice gui to search them quickly.

1st option : use the same everything via wine. Searching file is instant. Problem then arise with mime settings which can be fixed via https://raw.githubusercontent.com/MestreLion/wine-tools/master/wine-import-extensions
2nd option: catfish uses the power of locate. It does job but displaying file takes around 2 seconds even though all files have been indexed by updatedb.

Honourable mentions:

krunner does the job.. but i hate the fact that baloo indexing takes forever. I guess it search for content inside file as well. If only it would give us to index just the filename.
unity dash can find the files you touched. But it doesnot locate outside the files/folder which you have touched.

So my question . Does anybody knows how i can index quickly and search the indexed filename with a gui?

My first recommendation is ANGRYsearch. Superfast, fully configurable. You can find the official website here. To install, you need some dependencies (if not there already). In a terminal type:

sudo apt install python3-pyqt5

Then, download latest release from here. Unzip in a folder, and then from a terminal inside that folder type:

chmod +x install.sh
sudo ./install.sh

A second recommentation is regexxer. This is easier to install. From a terminal, just type: sudo apt-get install regexxer. Yet, I have not used this so I cannot tell how fast it is.

Why do you need Wine?
Is it not what you search (on Linux system)?

apropos - search the manual page names and descriptions

man apropos

locate - find files by name

man locate
locate "fir."

find - search for files in a directory hierarchy

man find
find / |grep "fir."

grep, egrep, fgrep, rgrep - print lines matching a pattern

grep -R "fir." /home/yourdir/*

Try to look into thisLink (maybe searchmonkey??) for more options.


File system error on Ubuntu 16.04 I get the following error when trying to open the "Music" folder on my Mp3 player when the device is connected:

"Failed to open directory "Music" -- Error when getting information for file '/media/rory/M5/Music/Emperor - Wrath Of The Tyrant': Input/output error".

(Sometimes it shows a directory to a different song or album).

When I connect the Mp3 player and type fsck in Terminal, this is what I get:

WARNING!!!  The filesystem is mounted.   If you continue you WILL
cause SEVERE filesystem damage.

What can I do in this situation? Any help would be appreciated.

It sounds to me like the drive in the MP3 player is going bad. I've seen this exact thing multiple times on various computers and devices where I work, and every single time it's been a failing drive. As the drive gets worse and worse it will eventually start intermittently showing up as read-only, exactly as you've described.

Unfortunately, it's probably time for you to get a new MP3 player. You can try to unmount the drive and fsck the drive, but most likely it will either fail or it will "fix" some errors only to have more errors appear.


Dos programs in wine I know that dosbox is not yet integrated with wine, but whenever I double click on a DOS program (with wine) it just opens dosbox and closes it in the next moment. Why does this happen?
Here is the terminal output:

tachyonsos@tachyons-desktop:~$ wine '/home/tachyonsos/Desktop/TC.EXE'
DOSBox version 0.74
Copyright 2002-2010 DOSBox Team, published under GNU GPL.
---
CONFIG:Loading primary settings from config file /home/tachyonsos/.wine/dosdevices/c:/users/tachyonsos/Temp/cfg1453.tmp
MIXER:Got different values from SDL: freq 44100, blocksize 512
ALSA:Can't subscribe to MIDI port (65:0) nor (17:0)
MIDI:Opened device:none

BTW is it a bug?

Linked QUESTION

How to run a MS-DOS application in Wine?

Top post edit
By the way, I see the issue you're talking about with the double-clicking. Just launch dosbox and run, or make sure your binary is inside of the .wine/drive_c if that's not the behaviour you want.
end edit
You say dosbox is throwing an error when you run:
tachyonsos@tachyons-desktop:~$ wine '/home/tachyonsos/Desktop/TC.EXE'
Correct your sound settings.
If that doesn't work, put it inside the ~/.wine/drive_c.

On my box, when I installed via software center it put a compiled binary in /usr/bin like this:

Configuration files are in ~/.dosbox.  The wiki tells us how to configure the file and determine our midi parameters.  To get those utilities we need sudo apt-get install pmidi.

Then we can see something like this:

So with gedit ~/.dosbox/dosbox-0.74.conf we can make this:

midiconfig=

look like this:

midiconfig=14:0

Which gives us this:

Next I added all the way at the end on the next line from where it says MOUNT lines here

mount C: /home/username/dosboxc

Now when I double click an exe it tries to load in dosbox, as it should since I installed that last.

Now I make launchers for the EXEs I want to launch with wine to include the wine command and the URL.

You don't launch things in Dosbox with shortcuts.  You load up dosbox and run them.  At least that's what I do, and it works for me.

I definitely see no bug here.

Oh, and finally since I installed it anyway:

I needed to test that the sound was working anyway.

No, it's not a bug, you can't run the DOS programs in Ubuntu using Wine because it only supports Windows or DOS.


How do I add locale to ubuntu server? I currently have those locales:

locale -a

C
en_AG
en_AG.utf8
en_AU.utf8
en_BW.utf8
en_CA.utf8
en_DK.utf8
en_GB.utf8
en_HK.utf8
en_IE.utf8
en_IN
en_IN.utf8
en_NG
en_NG.utf8
en_NZ.utf8
en_PH.utf8
en_SG.utf8
en_US.utf8
en_ZA.utf8
en_ZW.utf8
POSIX

How can I install ru_RU locale to my server?

Check which locales are supported:

locale -a

Add the locales you want (for example ru):

sudo locale-gen ru_RU
sudo locale-gen ru_RU.UTF-8

Run this update command:

sudo update-locale

Check which locales are already supported in your distribution. Open or cat the file /usr/share/i18n/SUPPORTED and copy the desired locale to be added.
on terminal enter sudo locale-gen locale_name.

For example sudo locale-gen de_DE.iso885915@euro
enter sudo update-locale
Check if the locale is installed with locale -a


Nvidia GT 540M on ASUS working on Ubuntu 11.10 optimus 100% This is a laptop ASUS K53SV-SX538V  with Nvidia Geforce GT 540M.

I have several questions about this topic:
1. Do I need to install additional drivers other than the one Ubuntu recommends during installation?
2. If so, after installing bumblebee or ironhide in Ubuntu, how I can set any program to always start with Nvidia and Intel?
3. As seen in some forums, how can I disable the Nvidia card?
4. How do people run Ubuntu if it's always throttled to 100%? I can not run 1080p movies automatically or run games, etc.

Regards, thanks.

Regarding your questions:
1. DON'T! If you do, you'll break the xorg and you'll have to revert to the original xorg.conf....

I've tried to get bumblebee/ironhide working on Asus U41SV with the same graphic card as yours and so far I've been unsucessfull :(
http://ubuntuforums.org/showthread.php?t=1657660
I've used a script to turn on/off the nvidia card, but I can't find it now... I'll recheck later!
At this moment, I am patiently waiting for better news from the optimus technologies.... :(

FYI, I know that in the ubuntu forums there is a "how to" on asus laptops, but, again, can't find it now...

cheers mate
Rita

Restricted drivers (aka nvidia proprietary ones)
That's only for the open source drivers, don't use them imho.
Install the proprietary drivers first ;)
It's throttled since without proper video driver support (as in nouveau instead of the proprietary nvidia) it doesn't always use the video card to help with the decoding (also you may just be on the default intel one :P ).


How cut a data file that have colums separated by spaces I have a data file with 2 columns

1.0000    9.9398383
1.4399    8.0000000
2.5688    7.9393838

1.0000    4.0000000
1.4399    9.0094949
2.5688    3.9932323

1.0000    8.9393993
1.4399    7.3838473
1.5688    2.8337738

I want to create a different files with this data separates by a blank line, but I dont know how to cut the file after or before the blank line, please help.

Something like this maybe?

cat data_2_cut.txt | cut -d" " -f1 >> first_column_file.txt

cat data_2_cut.txt | cut -d" " -f2 >> second_column_file.txt


How to change time display to 12h time format in Ubuntu I have installed Ubuntu 18.04 and I have the following issue:

I tried to change the date on the top panel to 12h format instead of the default 24h format but I found no editable option into settings or gnome-tweaks tool.

I hope to find help here.

There are several ways:

From GUI (Settings):

Open Settings >Details> Date & Time. Then pick either 24 hrs or am/pm
From GUI (using dconf-editor)

Open dconf Editor (not installed by default, run

sudo apt install dconf-editor

to install), and browse to org > gnome > desktop > interface > clock-format, and change the format to '12h'

From command line:

Run the command:

gsettings set org.gnome.desktop.interface clock-format '12h'

To revert:

gsettings set org.gnome.desktop.interface clock-format '24h'

Right click on the date and time located in the panel.

Change the capital R to lower-case r.


How to set the screen resolution in Ubuntu 16.04 64 bit running under VMware workstation 12 player on a Windows 7 host? I can set the screen resolution manually once I log in using the following command:

xrandr -s 1360x768

but I am not able to make it "stick". Every time I log back in, the resolution for a little while changes to 1360x768, but by the time the desktop appears, switches back to 800x600.

I have also tried other versions of the command, if that matters. For example, xrandr --output Virtual1 --mode 1360x768. It works as long as I don't exit the current session, but switches back to 800x600 when I log back in.

I have tried the following:

Placed the command in a /etc/lightdm/lightdm.conf, but this causes the entire GUI to fail to appear.
Edited ~/.xprofile to run the command to set the screen resolution, but this doesn't work.
Installed open-vm-tools and made sure it is up to date.
Disabled 3D acceleration in the VM's settings as was suggested in another answer. This made no difference at all.
Added the xrandr command into my ~/.bashrc. This causes the correct resolution to be set everytime I open up a terminal, but this solution is kludgy. I don't want to have to open a terminal to have my screen resolution properly set.

Any ideas what else could be done?

Thanks in advance!

Edit: I am using VMware Workstation 12 Player, version 12.1.1 (build-3770994)

I wrote here before, a clean install of ubuntu has no problem with resolution. But after that I found the solution while I was looking for an answer for another problem.

Follow the steps below and everything will be fixed. If you have the latest VMware Tools and open-vm-tools is not install, the skip to step 3.

1) sudo apt-get autoremove open-vm-tools

2) Install VMware Tools by following the usual method (Virtual Machine --> Reinstall VMWare Tools)

3) Reboot the VM

4) sudo apt-get install open-vm-tools-desktop

5) Reboot the VM.

Hope this helps. I know how frustrating it is to try and fix this.

Edit your VMX to include:

vga.guestBackedPrimaryAware = "FALSE"
svga.minVRAMSize = "16777216"

notes:

Tested with Xubuntu 16.04 with kernel version 4.4.0-77 in VMWare Fusion 8.5.6 at 1920x1200
This may be a problem with the combination of kernel version (4.4.0-77 in my case) and virtualHW.version (see ref. #1) and may indicate a bug (see ref. #2)
My VM is pegged at virtualHW.version = "11"

references:

https://unix.stackexchange.com/questions/301531/ubuntu-server-stopped-running-in-higher-resolution
https://github.com/vmware/open-vm-tools/issues/54


How do I change fonts and adjust their size? I've been finding fonts on the internet and installing them on my system.

What's the easiest way to change my fonts? I would prefer an easy to use graphical way, but answers with command line recommendations are also welcome.

Ubuntu 18.04 and later versions
The latest Ubuntu uses GNOME Shell. You can change the fonts using the "GNOME Tweaks" (gnome-tweak-tool) program.
Install the program using Ubuntu Software:

And change the font and font size.

13.04 - 17.04
For Unity interface users, customisation of fonts can be done using unity-tweak-tool

For 12.04:
For Unity interface users, they have their own tweak-tool. Customisation of Fonts in 12.04 can be done through myunity

You can use gnome-tweak-tool.Search it in synaptic.


Running J2ME (Java Micro Edition) Applications What's the easiest way to run J2ME (Java phone apps) on Ubuntu?

You can use MicroEmulator it is a pure Java implementation of Java ME in Java SE. You can find its homepage on Sourceforge.

I am pretty sure if you download Java development environment from Sun, it will allow you to run J2ME.


2 hard disks for 2 systems Can I have 1 hard disk for Ubuntu and another for Windows. I have to use software for both systems. I know Virtual Box can do the same thing, but it is very slow for my computer. So is it possible. If yes, how to implement? Any suggestion will be appreciated. Thank you!

Since my response was getting quite long, I felt it better to post as a new answer, rather than as another comment.

Just install them as two physical drives, and make sure you select the right one during install (i.e. so you're not overwriting the first OS with the second). What I'd do is leave one installed in your case but unplugged (the Windows installer isn't as high powered or intelligent as Ubiquity or an Ubuntu live medium), install Windows as normal to that disk, then shut down, plug in the new disk whilst leaving the first plugged in still, and boot the live installer for Ubuntu.

You'll need to choose a disk which is your "main" disk, because the bootloader needs to go on this disk. In times gone past, this was called a "master/slave" set up, I'm not sure if that still applies.

Sure you can. What you're talking about is generally called RAID, which has two main types:

RAID 0 (i.e. stripping - a file is broken into two smaller parts and one sent to each disk, which improves read time)
RAID 1 (i.e. mirroring) - where a file is copied to BOTH disks, for the sake of redundancy (often used on servers).

Most modern motherboards are capable of RAID, usually at boot there will be an option to press something like Ctrl+I to enter into a simple utility (very BIOS like) for creating a RAID array.
Once that's done, your OS would 'see' the disks as on single entity - it helps to have two identical disks e.g. of 250GB (so the array is 2x250GB = 500GB). All you'd do then is at installation use a partitioning tool like KPart or GParted to format the disks as you wanted.

Although my setup isn't current RAID (my workhorse computer is a laptop), I do dual boot. The balance I've found that works best is a tiny Ubuntu partition (or pair of partitions for / and /home) of 30GB (10+20), with all my data being on the Windows partition (which takes up the rest of my disk).

EDIT: It should be noted that technically RAID 0 has a reputation for halving the MTBF of your hard disks. However, given that that is usually thousands of hours, when I did run a RAID array, I never ran into problems. I left home (and that particular machine) behind before it finally gave out, after 5/6 years of heavy use!


Getting windows 7 to boot from external hard drive. Using Ubuntu I have Ubuntu 12.04LTS as my current operating system, and I have a Windows 7 iso on a disk. I'm using an external hard drive because my internal hard drive has become damaged. I need to get Windows to install onto my external hard drive (where Ubuntu is as well). The iso disk will not install windows to the hard drive. Can anyone help guide me through the process of getting windows on the external?

Backup your documents onto an external disk (or DVDs)
Via Gparted, make >40Go free space on your external disk (the one containing Ubuntu), and format this free space into NTFS.
Run the Windows installer and select the external disk for installation.

I found how to boot windows 7 on a external hard drive by using a program called PWBoot.

Again, the name is PWBoot.

It took me ages to find a program like this.

All you have to do is install windows Vista or windows 7 by connecting the drive on ata or ide. Then after the installation is over, you boot into windows and install the program PWBoot. From that moment on, your hard drive will be able to boot from a USB. Sweet uh?


How to disable event sounds with gsettings in Ubuntu 18.04 I have an install script that I run after fresh installations to install apps, mount network drives and make changes to several configurations to my liking. One of them is disabling the event sounds.

Up until now I have used this command to achieve that:

gsettings set org.gnome.desktop.sound event-sounds false

However, with 18.04 this command doesn't work anymore. Anyone know which schema and key to use now?

It is not possible to disable events using gsettings, instead it's saved in pulseaudio's TDB files.

Using tdbtools (apt install tdb-tools), you can update the setting in the database:

cd ~/.config/pulse

# Create a back-up in case anything bricks
cp *-stream-volumes.tdb stream-volumes.bup

# Get the entry and update it
entry=$(tdbdump *-stream-volumes.tdb | grep "sink-input-by-media-role:event" -a1 | tail -n1 | cut -d'"' -f2)
tdbtool *-stream-volumes.tdb store "sink-input-by-media-role:event" "${entry/00101/00111}"

This updates the value for the key "sink-input-by-media-role:event" to mute the system sounds (101 → 111). In my case, these are the values in both states:

On:  B\011m\01\00v\01\00\01\00\00101talsa_output.usb-FiiO_DigiHug_USB_Audio-01.analog-stereo\000N
Off: B\011m\01\00v\01\00\01\00\00111talsa_output.usb-FiiO_DigiHug_USB_Audio-01.analog-stereo\000N

Your values are most probably different, but the value needed to replace remains the same.

Go to the activities panel and type in sound.  Click on it and choose sound effects. Click OFF for alert volume (currently denoted as ON).


What is the usual boot time on Ubuntu 16.04 LTS? I've been using Ubuntu 16.04 LTS (Xenial Xerus) on my Thinkpad E450 for almost a year. My device usually takes over two minutes to boot.

I ran systemd-analyze blame, and the total boot time is 126.741 seconds with the following output:

21.159s dev-sda1.device
14.846s apparmor.service
10.659s snapd.service
8.515s plymouth-read-write.service
6.842s grub-common.service
6.698s NetworkManager-wait-online.service
5.585s networking.service
5.579s systemd-logind.service
5.369s gpu-manager.service
5.110s NetworkManager.service
4.961s bluetooth.service
4.533s ufw.service
4.198s console-setup.service
3.965s systemd-udevd.service
2.724s systemd-tmpfiles-setup.service
2.522s thermald.service
2.304s ModemManager.service
2.254s accounts-daemon.service
2.209s systemd-tmpfiles-setup-dev.service
2.044s binfmt-support.service
1.718s lightdm.service
1.696s keyboard-setup.service
1.251s systemd-modules-load.service

Is this normal?

The boot time depends on several parameters:

The HW of your computer

CPU
Disk (SSD?)
RAM

The software installed on your computer.

Please share the output of systemd-analyze blame so we'll be able to help you identify if there are some un-needed software which can be removed/updated which will reduce the boot time

It depends mainly on the BIOS system, including your motherboard, also the power of your CPU and how the installation of the OS was made.

Two minutes is inside the "normal" or acceptable booting time, but you could look for some techniques in Google for improving that time. (For example, look for how to suspend your computer when shutting down).


How can I easily cd into a flash drive from cli? Right now I am accessing all of my files from my native directories. However, I want to also use a flash drive for extra storage. In that case, what would my terminal command be to access my flash drive (for this example, assume flash drive name is "MYDRIVE")

Thank you!

It depends, but you can easily find out...

From GUI

...by right-clicking on any of the files or folders inside the drive, and choose > Properties ("Eigenschappen" in Dutch), in nautilus:

As you can see, the directory is

/media/jacob/My Passport

Note that in commands, you need to fix the (possible) space:

/media/jacob/'My Passport'

From cli

run:

lsblk | grep '<drive_name>' | awk -F'part '  '{ print $2 }'

example:

$ lsblk | grep 'My Passport' | awk -F'part ' '{ print $2 }'

outputs:

/media/jacob/My Passport

Again, note that in commands, you need to fix the (possible) space.

CD to the directory in one step

cd "$(lsblk | grep '<drive_name>' | awk -F'part ' '{ print $2 }')"

Where <drive_name> (of course) is the name of your drive.

Physical disks are named by sd(a,b,c,...)
sd = Sata disk
a = first disk
b = second disk
etc...
I hope you understood up to here now you should know which one is your harddisk
after that you should mount your Disk if it is not mounted automatically if it is mounted you can find it's mount point by type "df -h" in output search for mountpoint column of your disk you can access or cd to your Disk from it's mount point if it is not mounted you can mount it manually for mounting a disk you should:
first create a directory to mount you disk into that for example I create it on my desktop named as mount
then mount your disk in to that by
sudo mount /dev/sd.. /home/UserName/Desktop/mount
first dot (.) is for your hard disk specification and second dot is for specifying your file system or partition.


Home folder encrypted, hacker has physical access - safe to ssh to it? A computer runs Ubuntu with home folder encryption. It is switched on but not logged in. Another computer connects to it over SSH, allowing browsing of the home folder through the terminal. Can a hacker with physical access now read the home folder data?

I am just guessing but I would say no because first the hacker has to get passed the os security like your password on you computer and to do that they would need to eather know the password or atempt to crack the password to do that I would say they would need to shut the computer down and load a os from a usb so if they know the password it dosnt matter and you would not be able to ssh if they loaded a os from usb.

As for you reading your files while you are using ssh and reading files, based on this the home folder is never fully decrypted and the decypted data is never stored on the hard drive only in the RAM, a hacker might be able to get something from the ram but it would not be your whole home folder and I think to do it they would need to shut your computer down (this is what i am referring to) to do it and I dont think it would be to easy to read a raw memory dump.

so I dont think I would be to worred if they have access to your computer then there are probably easyer ways of getting the information stored on the hard drive.

Update

With the whole hard drive being decrypted when you login over ssh if the hacker could get passed os security then by loging in you would be giving the hacker access to your files.

A skilled person with physical access to the machine can install a keylogger (physical device) and access your home folder after you log in locally on that machine, again. In general: A skilled person with physical access to your machine ... what do you mean by "my machine"? It's not your machine any more.

However, what you're probably more interested in: Your home folder doesn't become accessible when you log in via SSH.

You probably should make sure that you can log in at all because in the default configuration, the authorized public keys are stored in ~/.ssh/authorized_keys which of course can't be read if your home folder isn't accessible at the time of the login attempt. If you change the configuration, you can log in via public key authentication but your home folder doesn't become accessible because your system really doesn't know your password.

If you log in via password (which you shouldn't!), you tell your system your password but afaik, your home folder still doesn't become accessible. For this to happen, you have to run:

ecryptfs-mount-private

If it does automatically become accessible, you of course don't have to run this command.

So let's assume you managed to log in and your home folder is accessible.

If we exclude very advanced abilities of the attacker, they still can't access your home folder unless they can log into the machine using some account on it.

If we don't exclude the attacker's abilities being very advanced, they can for example get your data and even your encryption key via a cold boot attack. Different attacks are possible but significantly less bad-ass (like shutting your sever down and booting an operating system which in turn boots your server's usual operating system but maintains full control over your server and can read the RAM as it wished; alternatively the attacker could change parts of your operating system to send data back to them when you make your home folder accessible the next time).

However, the attacker just installing a keylogger is way more likely then any advanced attack being carried out.


How to extract iso images to the hard disk? I have some ISO images and would like to extract them to a hard-disk. They are not OS images, I think they are music or audio books, I Don't know until they are extracted.
Thanks

If you are comfortable with the command line you can make use of the loop-back device.

All you'll need is an empty folder, so either use an existing one or create an new one:

mkdir test_folder

then run:

sudo mount -o loop,ro -t iso9660 filename.iso test_folder

If you are not sure about the filesystem type of the .iso, your system might be able to auto-detect it. This works on Ubuntu 18.04 with the Ubuntu installation ISOs for example:

sudo mount filename.iso test_folder

Now you can just cd test_folder or just ls test_folder to see the contents. No need to extract anything.

To "remove" the .iso, just type:

umount /path/to/test_folder

Wikipedia:https://en.wikipedia.org/wiki/AcetoneISO

  AcetoneISO is often referred to as the Daemon Tools equivalent for GNU/Linux.
  This mighty software can mount ISO, MDF, BIN and NRG files and burn
  ISO images to optical discs. It supports file conversion from BIN,
  MDF, NRG, DAA, IMG, DMG, CDI and other formats to ISO, as well as
  extracting content from them. You can use it to create ISO images from
  files and folders on your computer, as well as to encrypt and decrypt
  existing images, it has also the ability to split big image files, or to merge two or more smaller ones, this software is under the GPL License.

I didn't test it myself.


lightdm: cannot type password on login screen I am running 12.04 LTS, fully updated. My system is configured to automatically log me in into my account. Auto-login works fine.

However, sometimes I need to access the unity-greeter/lightdm login screen. For example, this happens when I log out and then want another user want to log into their account. The interface we get is exactly the one shown on the Wikipedia page for LightDM:

the password prompt is grayed out and I am unable to type my password
the mouse moves fine but I cannot click the system icons on the
top-right corner of the menu bar does not work
I can switch using ctrl-alt-f? to a console and login fine using the text/console login prompt. If I kill X, I am again returned to the same unusable login screen.

How can I fix this? How can a user log into their graphical environment without having to reboot the system?

I have encountered the same on random occasions on my 14.04 LTS installation. I have not been able to reproduce it. Sometimes it just happens and I am stuck at login.

I have added this alias to to my .bash_aliases file as a workaround that have worked so far:

alias saveme="export XDG_SEAT_PATH=/org/freedesktop/DisplayManager/Seat0 && dm-tool switch-to-greeter && logout"

When login prompt is grayed out. I switch to e.g. tty1 with Ctrl+Alt+F1, login and just enter my alias: saveme.

This way you will not lose any work from open applications. When you restart lightdm you will lose everything you had running which was really annoying and something I wanted to avoid..

XDG_SEAT_PATH may not be the same for you. Check while logged in in a terminal:

env | grep -i XDG_SEAT_PATH

You can also check with:

dm-tool list-seats

According to the bug reported at Launchpad.

The bug has been fixed in an updated version of Unity: 7.2.4+14.04.20141217-0ubuntu1. This fix should be included in 15.04 release as well.


File and directory comparison tool? I'm looking for something that will compare directories and files like Beyond Compare does for windows.

Its mainly for use of source control, but I need to use it for deployment as well.

Meld
Meld is a tool that can compare and merge files and directories. It is a GUI analog to the standard diff  and patch  command line tools. (See man diff and man patch for more details on those)

Also, lots of source control systems (such as bzr  or git ) have the ability to create diffs between versions.

Cross-platform, easy, no fuss & profile saving features make Jfilesync my top choice


Should I really follow all these steps to dual boot with Windows 10? It's been many years since I've installed any sort of linux distro. Back in the day, yes, I would say all of the steps in this article would be required to successfuly dual boot Windows & Ubuntu.

But Ubuntu is on 16.10 now. Should I just try the "Install Ubuntu alongside windows" option and let Ubuntu sort of figure out partitions/boot manager/everything? Or will I end up with a broken boot manager or messed up partition?

I've only skimmed the page to which you linked, but it looks basically reasonable, with one caveat: The page gives insufficient detail on how to determine your boot mode and control the boot of the Ubuntu installation medium to the correct mode. In brief, most computers with Windows 8 and later come with Windows installed in EFI/UEFI mode. Most (but not all) Windows 7 installations use BIOS/CSM/legacy mode, as do the vast majority of earlier Windows versions. If you installed Windows yourself, all bets are off, except for older versions (Vista and earlier, except on exotic platforms), which support only BIOS mode.

It's imperative that your Ubuntu installation use the same boot mode as your Windows installation. See this page of mine for information on determining your current boot mode. See this other page of mine for information on the Compatibility Support Module (CSM) and how to control the boot mode of your Ubuntu installation medium.

If you install Ubuntu in the wrong boot mode, you'll find it difficult or impossible to control which OS boots; hence the importance of getting this detail right.

One more caveat: Some (too many) computers have broken EFIs that forget their boot settings. If you're unlucky enough to have such a computer, you'll have to employ ugly workarounds to fix the problem. Numerous questions and answers on this site address such problems. See this one as a starting point.

Dual boot is pre-virtualization and unnecessary unless you need direct access to your hardware, in which case I would boot from an external medium anyway. Especially for something trivial like trying another OS, virtualization is a better solution. Look for virtualbox or vmware player.


How to default to newest version of Python? Possible Duplicate:
  How do I make the terminal run python 3.1?

I am using Ubuntu 10.10 and just installed Python 3.1 but entering python on my Gnome Terminal gets me Python 2.6 . How to fix it to get Python 3.1 on typing python on the terminal ?

I can't sanction Dayjay's answer at all. Replacing Python system-wide could make applications hugely unstable and in a lot of cases, they'll just break.

Python-based libraries are installed to a version-specific place (eg /usr/lib/python2.6/) so swapping in a new version without catering for existing packages will break things that need things on the right Python path.
There are major language differences between 2.6 and 3.x that, if a package doesn't check to see what version it's using (common of older scripts) could make things unstable.

For example, if you divide two ints in 2.6 you are returned a floored int; but in 3.x it'll return a float.

The safest thing to do is just call the 3.x binary when you want to use Python 3.x.

python3.1 my_python_script.py

You could simply change the symlink:

rm /usr/bin/python
ln -s /usr/bin/python3.1 /usr/bin/python


Is there a way for me to uninstall or delete EVERYTHING off of my computer? Is there a way for me to uninstall or delete EVERYTHING off of my computer including Linux Ubuntu because I want to make sure I can know everything that I have on it is just the stuff that I need.
Please help me with this problem.

Burn a Ubuntu live cd. Start it and click "Try Ubuntu" then start gparted and delete every partition or create a new partition table.


Is Compiz Unity's new flat black/outlined launcher look permanent? The new compiz version of Unity has a different looking launcher. Before it was similar to the ambiance theme used in unity. Now it's flat black with thin little lines around the launcher and icons.

Mainly, I'm just wondering if either:

devs haven't gotten to adapting or designing the final look of the launcher(/icons).
it is an intended change based on someone's personal aesthetic/design preferences
it was a change based on temporary or permanent technical limitations?
other

Pictures
PREVIOUS Mutter Unity Launcher
This is Mutter Unity launcher in various situations. (my opinion: You can see how, in a variety of situations, the launch bar fits in with the smooth theme perfectly, and also that the launcher meets up with the ubuntu dash iconfittingly)

CURRENT Compiz Unity Launcher
This is what it looks like now, flat black with lines around the icons and launcher. (my opinion: this looks like it belongs to a different style of theme, and when a window is next to it, it looks like two themes are clashing.)

This will look way better when maximized windows share titlebar and menu with the panel. I think even after maximized windows share controls and menu, the smooth look will still always fit better though

The theme is not final. We don't have design resources yet.

Currently it is just me drawing what I think looks okay without putting a lot of time into it. It could probably use a gradient or two...

I'm not sure I completely understand your question, but you may like to take a look at the "blog" post "Window controls will show in Unity panel for maximised apps" which may address your question about the window titlebar.


Laptop number pad not working Installed Ubuntu latest version on my Toshiba Satellite P875 and I can not get my number pad to work. Number lock is on but numbers don't type. The +/− and enter keys work only.

Try restarting and during boot sequence mash the number pad keys sometimes parts of HID's are not active at boot and do not get recognized let me know if this helps.


Connection timeout when accessing Github I have exactly the same problem as described here: https://stackoverflow.com/questions/12849986/connection-timeout-when-accessing-github

So I'll just copy & paste:

  I have some weird problems. When I try to log in my Github
  account, I get a "net::ERR_EMPTY_RESPONSE" error.

  I tried with Chrome, Firefox and Opera. In Firefox, if a clean the
  cache and offline data, it works for a while. Then I can log in, but I
  still can't create a Github repository, even if I clear the cache
  again.

  My friend, in the same network, with Windows, can do
  whatever he wants on Github's web site, but I can't. I tried many
  DNS servers, I tried not to set it (my friend doesn't), but it's still not working.

  My OS: Ubuntu x64 12.04

  Ideas, please. And thanks.

Also, I can clone any repo but I can't push. I had to change to https://codeplane.com/ due to this problem, but I want to understand why it happens.

EDIT: I could clone one repo, but the other one just hangs at this point:

felipelalli@felipelalli-Studio-XPS-8100:~/wa$ git clone git@github.com:felipelalli/micaroni.git
Cloning into 'micaroni'...
remote: Counting objects: 5238, done.
remote: Compressing objects: 100% (3257/3257), done.
Receiving objects:  92% (4839/5238), 43.29 MiB | 902 KiB/s

ANY push hangs like this:

master!fml.eti.br> push
Counting objects: 23, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (15/15), done.
Writing objects: 100% (19/19), 4.25 KiB, done.
Total 19 (delta 3), reused 0 (delta 0)

EDIT 2: I format my PC and I have reinstalled Ubuntu, but the problem keeps the same. So, it eliminates any problem with installations or updates. I have a Dell Studio XPS.

EDIT 3: I pay 4 Bitcoin if anyone solve my problem. Just put your public address together.

EDIT 4: When I try to push, after a few minutes, I receive this message:

felipelalli@felipelalli-Studio-XPS-8100:~/wa/fml.eti.br$ git push
Counting objects: 26, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (18/18), done.
Writing objects: 100% (22/22), 4.48 KiB, done.
Total 22 (delta 4), reused 0 (delta 0)
Write failed: Broken pipe
fatal: The remote end hung up unexpectedly
fatal: The remote end hung up unexpectedly

The solution:

after a long thread with Github support, they said it was a server side configuration related to a tentative of avoid DDOS attack that has affected some users, like me. After some adjustments in the Github server everything back to normal and works very fine again!

Thanks very much for Github support team, they were very transparent and helpful.

Quote from the long email thread:

  Hi Felipe -

  We've been experiencing intermittent DDoS attacks over the last
  several weeks, and an unfortunate side-effect of some of the
  preventative measures we've put in place is strange side-effects like
  this. We believe the problem here was that some of our DDoS protection
  was mis-configured. We're working with out network provider to tune
  the DDoS protection to not drop other traffic like this with the
  highest priority. Sorry again for the repeated problems here!

  Jesse GitHub Ops

I was getting this error while executing 'brew update' in my command line (terminal):

fatal: unable to access 'https://github.com/Homebrew/homebrew/': SSLRead() return error -36
Error: Failure while executing: git pull -q origin refs/heads/master:refs/remotes/origin/master

I also noticed that none of my browsers were able to connect to the github.com website.

I solved all the connection issues between my mac OS X Mavericks and github by switching my network wifi connection from 802.11n (5.18GHz) to 802.11g (2.412GHz).

I don't know why that worked for me, but I'm just glad it's back to normal.


Easiest way to stream videos from my server? I'd like to download movie torrents from my Ubuntu server as its download speed is much higher than at home. However, it is pretty pointless if I then have to download the movie from my server to my laptop so I thought a good compromise would be to stream the movies. What is the easiest way to do so? My only requirements are that everything on the server side should be done through the command line (ssh) and if possible, minimal dependencies. My media player is VLC but I wouldn't mind using a web browser to watch the videos.

Related question: how do i stream a video in my server to my computer?

use ssh -X with xauth, and run vlc on the server. It's fairly easy to stream videos using vlc. Howver this solution uses too much bandwidth to be usable.

What you should use instead is a network filesystem, just hit ctrl-l in nautilus, and then type sftp://user@my-server:port/folder and open up your movies directly off the server. This will use some cpu on both the server and client for the encryption, if that is a problem you can set up NFS.

I'd recommend uShare.

The link above have instructions to install and configure it
(it's for Xbox, but you can adapt for laptop use skipping the xbox options)

http://nexus172.wordpress.com/2009/04/26/how-to-stream-video-to-your-xbox360-using-ubuntu-ushare/


Error: Cannot find backlight controller for radeon acpi graphics card I get the following message every time I reboot Ubuntu 14.04 LTS:

drm: radeon_acpi_init  Error:  Cannot find a backlight controller

What does this mean, and how can I fix it?

Many thanks for your attention!

With bootscreen check here
so you should change the "quiet splash" to "nomodeset" using load screen;

or if you do not have several boot options:
 after loading press Alt+CTRL+F1 -> login as user or admin -> follow Coldfish answer here

this should help

PS : as the result i can now login successfully, but i see some strange popup that says that something ith monitor connection(on my laptop)


How to identify and replace broken files in a corrupted Ubuntu ISO? So, this isn't exactly an issue running Ubuntu, but rather with installing it.

Every time I try to download the Ubuntu ISO (from any source) it seems to end up corrupt. That is, the MD5 sums are never correct.

The Ubuntu ISO files come with a file that lists all the files in the ISO, and their respective MD5SUMs.

What I wish to do is loop over this file, and compare them to their files in the ISO, and work out what files are corrupt, in the hopes that I can extract the corrupt files from one of the other iso files, to create a working installer.

But, I don't know how to do this, and of course, to make it worse, I have to do this from Windows 7.

Does anyone know how to fix this?

Actually, I Know Which File Is Corrupted

Trying to combine files from multiple corrupted ISO images into a single, good ISO image is not a good approach to this problem. Here's why.

Almost all the data in the ISO image belongs to just one file, casper/filesystem.squashfs.

On an Ubuntu desktop CD or DVD ISO image, that is. On a server CD image or alternate CD image, it's a different story.

So I can tell you right now what file is almost certainly corrupt on each of the ISO's you downloaded: that file, on all of them. When something is corrupted in an Ubuntu ISO, the bad bytes are almost always somewhere in there.

filesystem.squashfs is itself a disk image; it is mounted as part of booting the system on the live CD. You could potentially extract it from the ISO, then extract its contents, see what's corrupted, and replace the corrupted files. While you can mount or extract a squashfs filesystem on Windows, you'd likely find doing so to be a nontrivial task. And this image is compressed, so there's no guarantee that minor corruption in the containing ISO won't affect multiple files.

Furthermore, if you've tried download the ISO image several times and it's always corrupt, you can be pretty sure it's not just minor corruption. You might have to replace hundreds or thousands of files if you attempted to do it this way.

Instead, you should download the ISO image using a more reliable method.

Conveniently, one of them (zsync) is similar to what you're thinking, except that it will download just the necessary pieces of the ISO files, rather than just the necessary files contained within it.

Make Sure You're Comparing Against the Right MD5 Hash

The first thing to do when your MD5 sum is wrong--especially if it's wrong after you download the file again--is to make sure you're comparing it against the MD5 hash for the correct file.

My guess is that

you have an 12.04 LTS image and you're using an MD5 hash for a 12.04.1 LTS image
(which is not the same file), or
you have a 12.04.1 LTS image and you're using an MD5 hash for a 12.04 LTS image, or
you have a 32-bit ("i386") image and you're using an MD5 hash for a 64-bit image, or
you have a 64-bit ("amd64") image and you're using an MD5 hash for a 32-bit image.

The list of MD5 hashes for each file is here.

In general, if your MD5 hash is wrong but the same for more than one download, usually

you're comparing against the wrong hash, or
the file is corrupted on the server (so if that looks to be the case, download from a different mirror, and, if you are willing, report a bug against ubuntu-website-content so the problem gets fixed), or
you're using a proxy or VPN that caches web content, and it has somehow cached a corrupted copy (downloading from another mirror should fix that too), or
you're downloading via FTP and a problem with the server or with your FTP client is causing the file to transfer in text mode rather than binary mode (this will corrupt it, and usually corrupt it the same way each time), or
your connection is being deliberately intercepted and altered by a malicious third party who is deliberately feeding you the wrong file (this is usually quite unlikely, though).

You can manually select a (different) download mirror at the bottom of this page.

If your ISO image really is corrupted, here are some ways to get a good file.

zsync

zsync (see also here) is a utility that can turn a partially correct file into a totally correct file by downloading just the parts you don't have the right versions of. Its primary application is for downloading slightly updated images, like those from one nightly build to another.

The way zsync works is this: Someone offering the file (like the Ubuntu project) creates a .zsync file which contains many checksums--checksums corresponding to many small parts of the file, rather than just one checksum for the whole file. You start out with anywhere from nothing to the entire file.

With nothing, the whole file is downloaded. With part of the file (that is, a file by the same name that's a different size or the same size with any number of binary differences), it figures out what parts need to be downloaded, and just downloads those parts. With the whole file, it doesn't download anything.

For very unreliable Internet connections, zsync is not much better than a web browser for downloading an entire file from scratch, unless you're willing to run it two or more times, in which case, later runs will correct the problems in earlier runs. For all but the highest error rate Internet connections, running zsync twice or, occasionally, three times on a file should be sufficient.

But you don't have to worry nearly as much about running zsync multiple times. Since you already--presumably--have most of the file, so that shouldn't be a problem. And as always if zsync gives you something corrupted, you can always run zsync again to fix it.

Getting zsync for Windows

zsync traditionally runs on Unix-like system (which doesn't really include Windows). However, recently a native Windows port of zsync has been created, so you can probably use that.

zsync is a command-line program, so in Windows you run it in the Command Prompt. (One way to open the command-prompt is to type cmd.exe into the text box in the Start menu and press Enter. Or, in Windows XP and earlier, Start > Run > cmd.exe.)

Another Way: Getting zsync for Cygwin

If you have any problems with the Windows port of zsync, you can always use the Cygwin version. Cygwin provides a Unix-like environment for Windows. It does not allow compiled executables to be run (for example, you could not use zsync from the Ubuntu package), but uses special versions of programs compiled for it from source. (It is far easier to compile a program written for Unix-like operating systems in Cygwin, than to compile it so it works natively on Windows.)

First, get Cygwin's installer (setup.exe) from here (or use this direct link).
Run it, click Next on the first screen, then select Install from Internet and click Next again.
On the next two screens, put Cygwin and the local package directory wherever you like them (defaults are usually good).
Select your Internet connection type (Direct Connection is usually good), and setup.exe will download a list of mirrors.
Pick any mirror, and it will download a list of available packages. You'll probably be warned about how this version is different from the previous one. That's not a problem, unless you've been using a previous version of Cygwin on the same machine.

Now you can select what packages to install. There is a text box for searching packages by name. Type zsync there (but do not press Enter--if you do, it's like clicking Next). An entry for Net will appear. Expand it by clicking the + to the left of it and you'll see Skip appear under it. That means if you don't change anything, setup.exe will not install zsync.

So click once, where it says Skip. Now it will install the latest available stable version of zsync for Cygwin.

Click Next again to finish the installation. The Cygwin environment, and zsync, will be downloaded and installed. (If you're asked to install packages that are required as dependencies, go ahead and do so.)

Once it's installed, open the Cygwin shell. You can run zsync from there.

  References

  Installing and Updating Cygwin (official site, very general instructions)
  How To Update To The Latest Ubuntu 11.04 ISO Using zsync In Windows (old and unofficial, but still helpful)

  Please note that while you can post on the Cygwin mailing list
  for problems with Cygwin (after reading that and the materials it
  tells you to read), they understandably do not support unofficial
  instructions. cygwin has quite good documentation, so like other
  projects with good centralized documentation (like OpenBSD), they
  expect that people asking for help will have read the documentation
  and are working from (or at least very familiar with) it.

  (Therefore, if you have trouble with my instructions, the best place
  to ask about them is probably here.)

zsync on Ubuntu

This doesn't apply in your specific case, but for folks who want to use zsync on Ubuntu, just install zsync . This can be done in the Software Center or by running this in a Terminal window (Ctrl+Alt+T):

sudo apt-get update && sudo apt-get install zsync

Now you can run it from the Terminal.

Related: How do I update an ISO with zsync?

Using zsync to Fix Your Corrupted ISO Images

In the Command Prompt, go to the directory that contains your corrupted ISO file. (You can use cd to change directory, same as Ubuntu. Use dir to list the contents of a directory.) Make sure the file you have has the same filename as when you got it.

Now run zsync in one of these ways, depending on which Ubuntu ISO image it is:

12.10, 32-bit:

zsync http://releases.ubuntu.com/quantal/ubuntu-12.10-desktop-i386.iso.zsync

12.10, 64-bit:

zsync http://releases.ubuntu.com/quantal/ubuntu-12.10-desktop-amd64.iso.zsync

12.04.1 LTS, 32-bit:

zsync http://releases.ubuntu.com/12.04.1/ubuntu-12.04.1-desktop-i386.iso.zsync

12.04.1 LTS, 64-bit:

zsync http://releases.ubuntu.com/12.04.1/ubuntu-12.04.1-desktop-amd64.iso.zsync

12.04 LTS (before the 12.04.1 point release), 32-bit:

zsync http://old-releases.ubuntu.com/releases/precise/ubuntu-12.04-desktop-i386.iso.zsync

12.04 LTS (before the 12.04.1 point release), 64-bit:

zsync http://old-releases.ubuntu.com/releases/precise/ubuntu-12.04-desktop-amd64.iso.zsync

Once you run one of those commands, zsync will automatically patch your ISO up to the correct version, and you're good to go.

Using zsync for Other Files

The general syntax is that you run zsync followed by a complete URL for the .zsync file on the server that has the same name as the file you have a version of and wish to download (except with .zsync at the end of course).

In case anyone wants to do this for any other Ubuntu releases (or other ISO files for the same release, like the version optimized for booting properly on Macs or the version for ARM-based mobile devices) here's the rule for where the .zsync files are located:

ISO images containing currently supported installers, including ISO's for the latest point release of LTS releases and all ISO's for currently supported LTS releases, are located in:

http://releases.ubuntu.com/
ISO images for end-of-life releases (which you shouldn't use anyway) or previous point releases of supported LTS releases are located in:

http://old-releases.ubuntu.com/releases/

Just click the link for your version and scroll down to see the full file list (or search the page for .zsync). Then copy the URL and paste it in the zsync command.

Use in "Upgrading"

You can also use zsync to "upgrade" one ISO to another. It will probably have to redownload most of the file if you're upgrading from one Ubuntu release to another. But if you're upgrading point releases (like 12.04 LTS to 12.04.1 LTS), it doesn't have to download quite as much. This is an excellent way to get a new point release quickly and efficiently.

Just rename the old file so it has the same name as the new file, then run zsync as above.

BitTorrent

When your Internet connection has a high rate of error, BitTorrent is often one of the best ways to download files reliably. Files are divided into many small pieces, and each piece is downloaded and checked to see if it's the real thing. (The individual pieces can be downloaded from different computers, which is what lets BitTorrent avoid putting load on a central server, and achieve speeds often faster than those possible with web-based downloads.)

Torrents for Ubuntu 12.10 and Ubuntu 12.04.1 can be obtained here.

You'll need a BitTorrent "client" to download it. If you don't already have one that you prefer, for Windows I recommend BitTornado.

After you download, I recommend seeding some if you can, to give back to the community. (With BitTorrent it from people like you.) You don't have to do it right away though--you can go back into your BitTorrent program and seed later. You can even quit it while the download is unfinished, and resume it anytime.

Using BitTorrent to Fix the File You Have

Warning: This subsection is not as well-researched as the rest of the answer. I have not tested the use of BitTorrent to fix corrupted files recently, or on Windows, or with BitTornado. I expect this would work for you, but I cannot be sure.

While BitTorrent is not as commonly used for this purpose as zsync, the BitTorrent protocol itself is just as capable of it.

Some BitTorrent programs will do this--others will refuse to, or download the whole file from scratch--unless the file you start with is exactly the same size. (Conveniently, a corrupted download often is the same size as the correct file.)

Put the old ISO image in the same folder as the .torrent file. Make sure your BitTorrent program downloads the torrent there. It will check to see if your current file is good. When it sees some parts are wrong, it can re-download them.

For some BitTorrent programs, you must import the file as a torrent in progress, or open it for seeding, in order to do this.

You can use ISO Master if you want to add and remove files to the ISO. It's available for both Windows and Linux.


Why does Nautilus hang while opening home folder? I have a Laptop Pentium dual core 2.16 GHz with 2 GB Ram while opening home folder or any other folder in that matter window becomes unresponsive.

I tried to reduce nice values of some processes in system monitor still problem exists. Due to this I can't open any file in any folder.

I believe that's a problem with nautilus, take a look on the /var/log/messages to see if you can find any good info.

other alternative is trying Nautilus Elementary, a nice replacement for nautilus, maybe it don't fall in the same problem, but I can't promise you that.

If the problem is on nautilus you can install nautilus elementary using the PPA @

ppa:am-monkeyd/nautilus-elementary-ppa

to install it throw the ppa, use these commands:

sudo add-apt-repository ppa:am-monkeyd/nautilus-elementary-ppa
sudo apt-get update && sudo apt-get upgrade

hope it help.


How to setup a file server over the Internet? I would like to be able to access the files in my desktop at home from anywhere over the Internet.

I don't know much, but I think that would involve setting up a FTP server, right? Can you please point me in the right direction - some reference materials and tutorials?

I would discourage you to use FTP, as it's a clear text protocol without any security.

Instead, I suggest you use ssh. Then you get both secure remote shell access and file transfer, all in one service. apt-get install openssh-server and you are good to go. Then you can connect to your machine through for instance Places -> Connect to server on a Gnome desktop, sftp in a shell, or using WinSCP on Windows.

To reach your machine, even with a dynamic ip, you could use a free dynamic dns service such as DynDNS or FreeDNS, which will give you a hostname such as mybox.uni.cx.

NAT is no issue either, as long as you forward the correct port to your machine. (tcp 22 in case of ssh)

You have to:
1) Be connected to the internet with a static, global IP address. No NAT or VPN bridge or whatever.
2) Set up an FTP server, the simpler - the better. Be sure not to allow anonymous access accidentaly.


Unable to login to 14.04 after successful installation After a successful upgrade to 14.04, now when I am trying to login using administrator id, It loops back to login page and doesn't load my session. Even guest is not working.
When I enter wrong password for administrator, it shows invalid password label.

File name ~/.xsession-errors show below error

Xlib:  extension "GLX" missing on display ":0".
Script for ibus started at run_im.
init: at-spi2-registryd main process ended, respawning
init: at-spi2-registryd main process ended, respawning
init: at-spi2-registryd main process ended, respawning
init: at-spi2-registryd main process ended, respawning
init: at-spi2-registryd main process ended, respawning
init: at-spi2-registryd main process ended, respawning
init: at-spi2-registryd main process ended, respawning
init: at-spi2-registryd main process ended, respawning
init: at-spi2-registryd main process ended, respawning
init: at-spi2-registryd main process ended, respawning
init: at-spi2-registryd respawning too fast, stopped

Please let me know what should I do.

After upgrade to 14.04, I had changed the driver to NVIDIA proprietary for my GF119M [GeForce 610M] graphics card which was causing this issue.

I had to do a fresh installation of 14.04 and this time I continued with driver X.Org X Server (Open Source) from xserver-xorg-video-nouveau.

This resolved my issue.


How do I search in multiple files with "cat"? What I want is to find within a directory all the files containing  a match and when it finds the match it shows the file where that match was found.
example
cat * | grep password:

Here it will show me all the matches that have a "password:"
But it doesn't show which file the match belongs to.

I think it's not possible to get the filenames after you piped the result of cat like in your example, because the cat command will just concatenate the contents, the information about filenames is gone after that.
What you could do instead is to rely on the grep command's behavior when it gets multiple input files, then grep will show the filename for each match.
So, instead of
cat * | grep password:

you could do this:
grep password: *

Using cat and grep to print out the names of files that contain the "password:" string within the current directory:
cat * 2>&- | grep -ls 'password:' *
With full file path:
cat * 2>&- | grep -ls 'password:' ${PWD}/*
2>&- is used to suppress error messages about being unable to read certain files/directories.

Using only grep to do the same thing:
grep -ls 'password:' *
With full file path:
grep -ls 'password:' ${PWD}/*

Using grep to pattern match for the "password:" string, printing the filename, then using cat to display the entire file(s) contents:
for match in $(grep -ls 'password:' *) ; do
    echo "${match}"
    cat "${match}"
done

With full file path:
for match in $(grep -ls 'password:' *) ; do
    echo -e "\e[7m\n$(readlink -f "${match}")\e[0m"
    cat "${match}"
done


Ubuntu 17.04 freezes I was navigating on Internet, had rythmbox reading a song and LibreOffice open developing a chart when suddenly on Firefox all freezed  and a ahotdown and reboot was necessary.

For all the similar cases, in particular a had a repository file missing, so I guess this was reason, I've removed both repository files missing 10 min after dealing with freezed ubuntu.

Best regards!

The reason behind this may be that you are not running a stable Os version and Ubuntu 17 has a lot of bugs and even the LTS version is not released so I prefer that you must downgrade your Ubuntu to 16.04 LTS as it is having really less bugs and I am also currently using it and there has been no issues since then.

There may be other Reasons like :-

Incorrect Installation

Drivers Fault

But I insist that you should downgrade your version to 16.04 LTS


Black screen when playing a movie in VLC player, just the sound is enabled When I move the VLC player window, I can see the video but when I stop moving it, then it gets back to black.

This happens not only in VLC but with my webcam too, when I use camorama webcam.

go to Tools → Preferences → Video and set the output to X11 video output and save it
now close and open VLC, and open your video
Edit:
If it still doesn't work try setting the output to OpenGL video output as suggested by @Asaf


How can I colorize code sent to STDOUT? Most text editors - vim, emacs, kate, gedit - have colorizers, so that, depending on the language you're programming in, it will color the text differently.

Is there a way to do that for code sent to the STDOUT? So that commands like those will colorize the whole output according to the language of the file (from extension or magic):

cat my-script.py

or

head -n 15 my-script.lua

pygmentize will output a colorized source code file. It has support for many languages. It determines how to color it based on the file extension or  the value you provide with the -l option. To get pygmentize install the python-pygments package.

Doesn't look like it's been updated in a while, but what about supercat?


Regenerate resolv.conf from dhclient.conf without releasing/renewing IP? When I make changes to dhclient.conf such as modifying the DNS search path (so that the changes don't get lost on reboot or DHCP renews), how do I regenerate /etc/resolv.conf? That page suggests dhclient -r; dhclient which releases the address, thus disrupting my connection and preventing me from reaching the host again. Is there another way of doing this? Thanks.

Just use your favorite editor to edit /etc/resolv.conf (or /run/resolvconf/resolv.conf if you are running Ubuntu 12.04 or later with resolvconf active).

After a reboot or an interface downup cycle, resolv.conf should be correctly regenerated so that you can reconnect. If that isn't the case then you have another problem.


Logkeys and screen capture Possible Duplicate:
  How to run logkeys

I am a kind of newbie and need to get control over my pupils, i. e. work at a youth home and have to have total control over the internet activity of some of the criminal youths over here.

How do I install logkeys for Ubuntu 11.10 Natty Narwhal and have it running from boot?

I thank you in advance.

Quite possible the best way to get control over their Internet activity is to install a hardware appliance such as the Sonicwall TZ100. These security devices connect between the Internet gateway and the PC, and are platform independent. I am not affiliated with Sonicwall, but I do use it at a high school where I am the tech coordinator with great success. I know money is tight everywhere, but for $339 at this web site, you will not only have an Internet content filtering service, but antivirus, anti-spyware, and Intrusion Prevention for all of the computers. I recommend the TotalSecure 100.

P.S. Ubuntu 11.10 is the Oneiric Ocelot. You might want to clarify that for other answers.


Network Printer "Print Data Error" receives data but does not print Ricoh/Lanier LD520C I've been tearing my hair out trying to figure this out. I just tossed WIN8.1 because I could not make any hardware work, but it had similar symptoms.

First I tried with Ubuntu 12.04 32 bit
Then I tried Linux Mint Cinnamon 15 64 bit

Both have the same symptoms.
The Printer appears to install just fine, drivers automatically selected, but test page fails to print. I can see the "data in" light flashing on the copier/printer but the display on the printer shows "Print Data Error" and nothing prints.

The printer requires an authorization code to print in COLOR, but NOT in black and white, so I set the settings to black/white. I also tried putting in the color code with color or black/white printing to no avail. The printer does this same thing when another networked PC tries to print in color without the code. Again there is no code needed for black/white.

ping works fine, nmap shows it is compatible with a host of different formats including

21 ftp
23 telnet
80 http
139 netbios
514 shell
515 printer
631 ipp
7443 unknown
9100 Jetdirect

/usr/lib/cups/backend/snmp command shows:

network socket://192.168.1.201 "LANIER MP C2050/LD520C" "LANIER MP C2050/LD520C" "MFG:LANIER;CMD:PJL,RCS,PCL,PCLXL,PCL,PCLXL;MDL:MP C2050/LD520C;STS:10001,0;CLS:PRINTER;DES:LANIER MP C2050/LD520C;" ""

LPINFO -V command shows the network socket address but no descriptor

The printer isn't giving any feedback except "Print Data Error"
Any help would be helpful. Thanks!
-Peter

Edit: I wanted to add that I tried the method which worked for another poster which was selecting the "Jetdirect" option and specifying the ip address and that did not work either. I do not know how to capture the log file to attach here. I am a complete noob in Linux but I can follow directions if adding that would help.

If printing from a MAC to a Ricoh/Lanier copier you will need an adobe postscript card installed on the machine. To check if machine has an adobe poscript, print out a configuration page, look for printer language, you should see adobe poscript 3 if not then you will need to purchase one through your copier vendor.

I just had this same problem on my printer and it appears to be a driver issue. When I initially setup the printer I selected the PS driver. When attempting to print I received the same error that you received, "Print Data Error". After switching to the PXL Driver I began printing correctly.


Bluetooth doesn't work after resuming from sleep, Ubuntu 18.04 LTS Bluetooth earphones work fine until sleep. After resuming from sleep however, they appear to connect for a brief moment before disconnecting. On blueman, the error given is Resource temporarily unavailable. This issue arose only after updating to 18.04 LTS.

Here's the terminal output for lsusb:

Bus 001 Device 002: ID 8087:8001 Intel Corp.
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 003 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 002 Device 004: ID 1bcf:0002 Sunplus Innovation Technology Inc.
Bus 002 Device 003: ID 04f2:b477 Chicony Electronics Co., Ltd
Bus 002 Device 002: ID 0a5c:21f1 Broadcom Corp. HP Portable Bumble Bee
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

update bluez to >=5.28.2

18.04 ships with a buggy bluez package for now; newer version is available from this PPA: https://launchpad.net/~bluetooth/+archive/ubuntu/bluez:

sudo add-apt-repository ppa:bluetooth/bluez
sudo apt install bluez

workaround for buggy Bluetooth applet (Unity specific?)

This is probably the issue @solstice mentioned - BT menu applet doesn't let me enable Bluetooth after resuming from sleep. No matter if the toggle switch is off or on, the BT icon is disabled, and rfkill output doesn't change:

$ rfkill list
0: phy0: Wireless LAN
    Soft blocked: no
    Hard blocked: no
12: hci0: Bluetooth
    Soft blocked: no
    Hard blocked: no

You can toggle BT manually by running (substitute your own ID):

rfkill block 12
rfkill unblock 12

and BT applet should pick it up correctly now. At this point, you should be able to connect to your devices. For now I've hacked it together using a script that does this automatically after resume:

$ cat /lib/systemd/system-sleep/bt
#!/bin/sh

case $1 in
  post)
    sleep 5
    rfkill block `rfkill list | grep hci | cut -d: -f1`
    sleep 1
    rfkill unblock `rfkill list | grep hci | cut -d: -f1`
    ;;
esac

The ID number next to hci0 in rfkill list output seems to increment after every suspend/resume. Disabling/enabling BT using the BT menu should change the output ('soft blocked: yes' for BT disabled via menu), but it doesn't. My guess is that the applet remembers the wrong device ID and is thus trying to enable a device that no longer exists.

The solution of upgrading to a newer version of bluez solved another problem for me of bluetooth connections disconnecting seconds after connecting, as described here: Ubuntu 18.04: Bluetooth device disconnects right after connect on Lenovo P50


How do you append to environment variable in Upstart? I put the following in my /etc/init/myjob.conf file but it doesn't seem to work

env PATH=$PATH:/mnt/data/src
env PYTHONPATH=$PYTHONPATH:/mnt/progs/link

Is it possible to somehow append to an environmental variable.

You can't append variables inside an upstart script, you need to use an external file and source it inside a script section:

create a /etc/default/myjob file with content like:

env PATH=$PATH:/mnt/data/src
env PYTHONPATH=$PYTHONPATH:/mnt/progs/link
export PATH
export PYTHONPATH

then in /etc/init/myjob.conf source it where you need it

script
    . /etc/default/myjob
    exec command
end script

while this would look unnecessary complicated it is actually correct because an init script file is supposed to change between packages version while /etc/default/appname are configuration files and aren't overwritten by default

export PATH=~/bin:"$PATH"

You should add this in ~/.bashrc file to work at every user session.

You should restart to see it working or try . .bashrc command to work without restart.


Gnome 3 uninstall failed? Oke now i really messed up my system. I have tried to uninstall gnome 3.
I have followed this guide.

But now my system do not anything at all. When I boot it stops when it needs to load the GUI. I thought keep calm there must be an easy solution for this. I opened a tty and did this commands:

sudo apt-get install dist-upgrade
sudo apt-get install gnome-panel //get errors about dm :/
sudo apt-get install gnome-shell //same
sudo apt-get install ubuntu-desktop //get message that distibution is unstable
sudo apt-get install unity
start lightdm // Don't work :(

Is there any way I can recover my system?

In this case i would say just reinstall ubuntu.

Boot using live CD
Open terminal and do sudo nautilus
Copy your Home directory to an external device
Remove your ubuntu parions using gparted
Start installation
Copy over your files / or just the files you need ;).
Start configurate your system again (Have fun with that).


Any SAP (structural analysis program) software in linux? I'm looking for any software like ETABS, SAP2000, Autodesk RSA (ROBOT), Graitec Advance Design, SCIA, STRAP, STAAD. I don't need simple 2D frame solver. I'm looking for fully fledged 3D, nonlinear, dynamic and seismic analysis capable software. Structural codes dimensioning and yield strength checkings would be really sweet. It doesn't matter if it's free or commercial.
Code-Aster and Salome are too 'academic' and hard to manipulate. They don't provide any structural codes support. They look more like Ansys (physics software, not structural specific).

A good starting point would be like these ones: bars3d (sourceforge.net/projects/bars3d), Estru3D (sourceforge.net/projects/estru3d) and Frame3DD (frame3dd.sourceforge.net). Sadly, i couldn't make any of those work on my Xubuntu 16. Estru3D installs fine, but it won't start at all. Anyway, these 3 are very crude projects, i'm looking for something more advanced.

Perhaps some of these meets your expectations:

FreeCAD is a general purpose Open Source 3D CAD/MCAD/CAx/CAE/PLM modeler,
aimed directly at mechanical engineering and product design but also fits
in a wider range of uses around engineering, such as architecture or other
engineering specialties.
Site

SolveSpace is an Open Source 2D and 3D CAD program.
It is a constraint-based parametric modeler with simple mechanical
simulation capabilities.
Site

VARKON is a free CAD system and high level development tool for Engineering,
Computer Aided Design and Product Modeling applications.
Site

gCAD3D is a 3D CAD CAM application that features an integrated 3D OpenGL viewer,a program interpreter for geometry and NC-commands in 3D, an integrated NC-processor, and a programming interface for user programs.
Site

OpenSCAD is a software for creating solid 3D CAD objects.
Unlike most free software for creating 3D models (such as the famous application Blender) it does not focus on the artistic aspects of 3D modelling but instead on the CAD aspects.
Site