No HDMI sound on INTEL NUC NUC5I3RYH I upgraded to ubuntu 16.04 LTS and I lost audio on HDMI. Headphones work fine.

Some information about my system:

$ aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: HDMI [HDA Intel HDMI], device 3: Generic Digital [Generic Digital]
  Subdevices: 0/1
  Subdevice #0: subdevice #0
card 1: PCH [HDA Intel PCH], device 0: ALC283 Analog [ALC283 Analog]
  Subdevices: 1/1
  Subdevice #0: subdevice #0

_

$ cat /proc/version
Linux version 4.4.0-83-generic (buildd@lgw01-29) (gcc version 5.4.0 20160609 (Ubuntu 5.4.0-6ubuntu1~16.04.4) ) #106-Ubuntu SMP Mon Jun 26 17:54:43 UTC 2017

-

$ pacmd list-cards
2 card(s) available.
    index: 0
    name: <alsa_card.pci-0000_00_03.0>
    driver: <module-alsa-card.c>
    owner module: 6
    properties:
        alsa.card = "0"
        alsa.card_name = "HDA Intel HDMI"
        alsa.long_card_name = "HDA Intel HDMI at 0xaa034000 irq 48"
        alsa.driver_name = "snd_hda_intel"
        device.bus_path = "pci-0000:00:03.0"
        sysfs.path = "/devices/pci0000:00/0000:00:03.0/sound/card0"
        device.bus = "pci"
        device.vendor.id = "8086"
        device.vendor.name = "Intel Corporation"
        device.product.id = "160c"
        device.product.name = "Broadwell-U Audio Controller"
        device.form_factor = "internal"
        device.string = "0"
        device.description = "Built-in Audio"
        module-udev-detect.discovered = "1"
        device.icon_name = "audio-card-pci"
    profiles:
        output:hdmi-stereo: Digital Stereo (HDMI) Output (priority 5400, available: unknown)
        off: Off (priority 0, available: unknown)
    active profile: <output:hdmi-stereo>
    sinks:
        alsa_output.pci-0000_00_03.0.hdmi-stereo/#0: Built-in Audio Digital Stereo (HDMI)
    sources:
        alsa_output.pci-0000_00_03.0.hdmi-stereo.monitor/#0: Monitor of Built-in Audio Digital Stereo (HDMI)
    ports:
        hdmi-output-0: HDMI / DisplayPort (priority 5900, latency offset 0 usec, available: unknown)
            properties:
                device.icon_name = "video-display"
    index: 1
    name: <alsa_card.pci-0000_00_1b.0>
    driver: <module-alsa-card.c>
    owner module: 7
    properties:
        alsa.card = "1"
        alsa.card_name = "HDA Intel PCH"
        alsa.long_card_name = "HDA Intel PCH at 0xaa030000 irq 47"
        alsa.driver_name = "snd_hda_intel"
        device.bus_path = "pci-0000:00:1b.0"
        sysfs.path = "/devices/pci0000:00/0000:00:1b.0/sound/card1"
        device.bus = "pci"
        device.vendor.id = "8086"
        device.vendor.name = "Intel Corporation"
        device.product.id = "9ca0"
        device.product.name = "Wildcat Point-LP High Definition Audio Controller"
        device.form_factor = "internal"
        device.string = "1"
        device.description = "Built-in Audio"
        module-udev-detect.discovered = "1"
        device.icon_name = "audio-card-pci"
    profiles:
        input:analog-stereo: Analog Stereo Input (priority 60, available: unknown)
        output:analog-stereo: Analog Stereo Output (priority 6000, available: unknown)
        output:analog-stereo+input:analog-stereo: Analog Stereo Duplex (priority 6060, available: unknown)
        off: Off (priority 0, available: unknown)
    active profile: <off>
    ports:
        analog-input-mic: Microphone (priority 8700, latency offset 0 usec, available: no)
            properties:
                device.icon_name = "audio-input-microphone"
        analog-output-headphones: Headphones (priority 9000, latency offset 0 usec, available: no)
            properties:
                device.icon_name = "audio-headphones"

-

cat /proc/asound/cards
 0 [HDMI           ]: HDA-Intel - HDA Intel HDMI
                      HDA Intel HDMI at 0xaa034000 irq 48
 1 [PCH            ]: HDA-Intel - HDA Intel PCH
                      HDA Intel PCH at 0xaa030000 irq 47

Should I upgrade to another version of ubuntu?

Next time you connect the HDMI open the sound settings. HDMI output should be listed along with your internal audio output. Select the HDMI output.
After that open terminal and type

pulseaudio -k

This worked fine for me I hope it works for yours.


How to display notebook model number? I have a notebook HP Pavilion dm4 running Ubuntu 12.04 and I'm trying to determine the model number (like HP Pavilion dm4-2015dx or HP Pavilion dm4-2033cl, etc).
There's no such information on notebook's body as suggested on HP's website on Option 1.

I tried to use lshw and dmidecode, but couldn't find. Maybe I should use an especific option but all the information I found is for Windows, nothing for linux.

There is a way to show this information on linux?

sudo dmidecode |grep Version

shows

Version: Intel(R) Core(TM) i5 CPU M 460 @ 2.53GHz

Here's the System Information part of sudo dmidecode | less

System Information
        Manufacturer: Hewlett-Packard
        Product Name: HP Pavilion dm4 Notebook PC
        Version: 058A120000242B10000020100
        Serial Number: 5CA1062FYJ
        UUID: E4BD398B-4D9E-BC63-1A03-099330BF5443
        Wake-up Type: Power Switch
        SKU Number: XZ299UAR#ABA
        Family: 103C_5335KV G=N L=CON B=HP S=PAV
:

To see your model number, open a Terminal with Ctrl + Alt + T and type:

sudo dmidecode | grep Version | sed -n '2p'

or alternatively type:

sudo dmidecode | grep 'SKU Number' | head -1

to see your SKU Number.

If you want to see a more detailed view of your System information type:

sudo dmidecode | grep -A 9 "System Information"

or

sudo dmidecode | less

and use the  ↓  key to go to the section System Information.

On my T430 I have to take out the battery and there is this little sticker that tells me exactly what I want to know. It's not where Lenovo says it is (on top of the battery), but there it is. Might be easier than doing it from the command line if in fact you have such a sticker.


How To Create a Personal VM Server I have a personal Ubuntu server at home for my various personal development needs. I often spend time to configure it for various purposes e.g. for serving a blog or my mercurial repositories etc. However, I am getting very interested in pre-packaged linux appliances available e.g. TurnKey linux etc. It takes no effort to get an appliance up and running!

I was wondering if I could make my home server into VM server, where I can run multiple VMs for various needs. The server does not have a screen, hence I would like to be able to manage my VMs from the web or console

I guess in short, I am asking if its possible to have my own personal, light weight Amazon EC2. If yes, how can I set it up? Is there an Ubuntu derived distro available for this? OR can I install a couple of packages and get this running?

Great question.

There is currently an on-going community effort to create what is currently dubbed as TurnKey master server. In a nutshell it aims to provide exactly what you are looking for, but nothing official has yet been released - we are still in experimentation mode.

Several community developers are exploring different technologies, such as Proxmox OpenVZ and PHPVirtualBox (alpha-testing TKLPatch and ISO's available).

It would be great to get feedback and ideas if you have them.

put Xenserver on your hardware and then run any OS in VMs on it. You are only limited by the RAM your server has!
XenServer is a Hypervisor OS. You can install it on your hardware. Once installed, you control it with a console application(browse to the ip of this server to download) This will then allow you to create new Virtual Machines on the Server using predefined templates or download and deploy virtual appliances. The nice thing about a hypervisor is that you are not limited to ubuntu or linux virtual appliances. This can be a good setup for a lab.


sbin/init crash after log in Hi I have been getting a problem where, every time I log into Ubuntu, a red exclamation mark appears in the top-right of the screen.  On clicking it, a window appears to say "Sorry, Ubuntu 12.04 has experienced an internal error".  Here are some of the information also given.

======================================
ExecutablePath
   /sbin/init

Package
upstart 1.5-0ubuntu7.2 [modified: sbin/initctl]

ProblemType
Crash

Title
init crashed with SIGSEGV

ApportVersion
2.0.1-0ubuntu17.8

Architecture
i386

.
.
.

ProcCmdline
/sbin/init

UnreportableReason
This is not an official Ubuntu package.  Please remove any third party package and try again.

UpgradeStatus
No upgrade log present (probably fresh install)

=========================================================

Is there a way to fix this?

In order to fix the error "Sorry, Ubuntu 12.04 has experienced an internal error" run the below command in the terminal,

sudo gedit /etc/default/apport

After running the command change the enabled parameter from 1 to 0 and then save the changes. Once you are done please reboot the machine, this might help you to fix.


Nautilus preferences and menu missing My nautilus does not show a preferences button or file/edit etc when I hove over the left top. I recently did a clean install of Ubuntu natty narwhal 11.04. What happened and how can I fix this?
See screnshot here

Open a terminal and type sudo apt-get install nautilus.

Then restart your session.

For some reason, Nautilus is not completely updated when you install the Elementary version. This will complete the upgrading process and Preferences and Menu will be there again the next time you start Nautilus.

Install compiz fusion icon from synaptic
In compiz fusion icon choose for "select windows manager' and then for Metacity.
If you have your preferences and menu back then compiz is the reason why.


Check if IP is static or dynamic programmatically I'm trying to determine whether my IP has been statically or dynamically assigned in Ubuntu 11.04 from within C. The closest I've come is examining /var/lib/dhcp/dhclient.leases, but that doesn't change if a static IP is assigned (as it caches DHCP leases for future connection attempts).

So... is there a command line utility (for Ubuntu) that will allow me to check if DHCP is enabled or disabled?

Alternatively: the machine is a server dedicated to one application; would it be easier just to maintain an environment variable that keeps track of DHCP status?

You can put scripts in /etc/network/if-up.d to be executed when an interface is activated (either by ifup or by Network Manager). These scripts receive information about the interface, including the environment variable $METHOD set to static or dhcp. This is documented in the interfaces(5) man page.

#!/bin/sh
## This is /etc/network/if-up.d/zzzz_alex_notify_myserver
case $LOGICAL in
  eth0)
    case $METHOD in
      dhcp) <notify server that it's on DHCP>;;
      static) <notify server that it's on a static IP configuration>;;
    esac;;
esac

I guess you're referring to the IP assignment of your ubuntu machine locally and not your external/public IP.

Perhaps the following output could be of some help:

cat /etc/network/interfaces |grep ^iface\ eth0 | awk -F ' ' '{print $4}'

This will print either the word static or dhcp, depending on the current configuration of interface eth0.

You can also make small adjustments, like:

cat /etc/network/interfaces |grep ^iface\ | awk -F ' ' '{print $2, $4}'

in order to list all of the interfaces and their configuration.


Migrating from Evolution to Thunderbird I would really like to switch over to Thunderbird from Evolution. I have had a look around and haven't found a good up to date how to for migrating. I have quite a lot of emails and filters and would like to make the transition as painless as possible.

thanks for any help.

Ubuntu <= 11.04

This is a perfect how to, very easy ...  you can follow, it has

Migrate local mail from Evolution
Migrate Calendar
Migrating Task
Migrate address book

how-to-migrate-from-evolution-to-thunderbird-in-ubuntu

--------------------------- UPDATED --------------------------------------------------

Ubuntu >= 11.10

EVOLUTION

Exporting calendar data

To export a complete calendar, right-click on the calendar in the list of calendars and click Save as. Available formats are iCalendar format (ICS, recommended), comma separated values (CSV), and RDF format.

If you want to export only one appointment, right-click on the appointment and click Save as iCalendar....

THUNDERBIRD

extension

Lightning 1.0b7
by Mozilla

or you can install this package from Ubuntu repository:

sudo apt-get install xul-ext-lightning version the same (1.0~b7)

Manage your daily schedule directly within Thunderbird. Allows managing calendars locally or subscribing to network calendars.
Lightning 1.0b7 supports Thunderbird 7.

Install this extension.
Open thunderbird.
Events and task
import and select the calendar saved before...

EVOLUTION

exporting contacts data

Contacts files are stored in a database, but can be saved as a vCard file.
To export a complete address book, click File ▸ Save Address Book As vCard.
If you want to export only one contact, click File ▸ Save as vCard or right-click on the contact and click Save as vCard.

THUNDERBIRD

extension

contact data (vCard or .vcf)

Some address book programs use a vCard format, which cannot be imported directly by Thunderbird. You can import both vCard and vcf using the third-party Thunderbird extension MoreFunctionsForAddressBook.

Install this extension.
Open thunderbird.
Address Book -> tools ->  MoreFunctionsForAddressBook -> action for contatcs -> import vcard/vcf

EVOLUTION

Exporting mail data

To save an email to a file in mbox format, select an email and click File ▸ Save as mbox... or right-click on the message and click Save as mbox....

The same steps apply to save a complete mail folder, but you have to mark all messages in it first.

You can select all messages in a folder by clicking Edit ▸ Select All or pressing Ctrl+A.

THUNDERBIRD

extension

ImportExportTools

Adds some tools to import and export folders and messages

mail data .mbox

Install this extension.
Open thunderbird.
tools -> ImportExportTools -> import file mbox -> import directly one or more files .mbox

EVOLUTION

exporting tasks

in Evolution, click on the Task tab. Right click on the Personal (or whatever name you give to your task list) and select Save to disk. Navigate to the location and save the task list in .ics format.

THUNDERBIRD

Importing Task

Events and task -> import.

P.D : All these are tested by my and work 100%

I think, that is a quite simple thing. I suggest you this tutorial.


How do I solve green layer problem while playing HEVC in Ubuntu 14.04? I have a HEVC (x.265) video. I am trying to play it in latest VLC (Rincewind 2.1.6) in Ubuntu 14.04. I have already installed VLC plugin for HEVC. Here is the screenshot:

However, when I try to play video, a green layer is coming over the video. Here's a screenshot:

I tried with lots of other players like DragonPlayer, SMPlayer. All of these have problems. So, I suppose this is a problem with Ubuntu itself. Any solution?

Update: I updated to 2.2.1 . Still, the problem persists.

Before begin.
Stay away from VLC whatever VLC since I'm avid reader and writer and I've read a lot about it. Even VLC says that they're not the best player out there and when come to problems and they've posted a lot saying that they are trying to make the most compatible player possible. So it's not the best. You can argue.

1st possibility -
During my same problems as yours. I've changed to DivX player because I discovered DivX use different plugin and the video was DivX made and every different player use his own plugins for HEVC or libde265, as I remember.

2nd possibility -
Hardware compatibility. Try another computer instead and with recent graphic adapters like NVIDIA or AMD.

3rd possibility -
Play the video on Linux if you're using Windows and the reverse if you're using Linux play it on Windows.

I'd resolved easily the same problems as yours years ago as green screens, lines on the screen, video playing with lags and video not playing at all. All by using these methods above.

Hope it helps!

Edit: Changing to recent graphics adapter that may or not resolve your problem same as trying to play HVEC on Android devices. Because a lot hardware compatibility issues developers are trying to make it possible!

Non-related (only for android) external links:
Is there any Video Player for android that can play HEVC videos smoothly?
How to Enjoy HEVC/ H.265 Video Playback on Android
Much Ado About Not Much (HEVC Support in Android) ~ May 23, 2018
Supported media formats ~ android official

You have to install libde265 via PPA. To install open Terminal and run the commands below:

sudo apt-add-repository ppa:strukturag/libde265
sudo apt-get update
sudo apt-get install vlc-plugin-libde265


Ubuntu 13.04 64 Bits interface freezes when running videos on chrome, firefox and chromium Ubuntu 13.04 64-bit, interface freezes when running videos directly in the browser, leaving only the mouse pointer moving.
Behavior occurs with browsers Google Chrome, Chromium and Firefox.
My hardware:

Intel Pentium Dual Core G860
Integrated video processor (Intel HD2000)
Motherboard Asus P8H61-M LE BR
4GB DDR3 Dual Channel

I think something on the flash.

I installed flashplayer through synaptic on my Ubuntu 13.04 64 bit and installed flashplugin-installer, my firefox (version 22.0) also freeze for awhile everytime streaming from youtube, but chrome is working fine. Then I follow instruction below :
http://ubuntuguide.net/install-adobe-flash-plugin-in-ubuntu-12-04both-3264-bit
it work okay now, the freezing problem were gone !

There was, literally just within the past few hours, an update to adobe flash player package.

Try doing..

sudo apt-get update
sudo apt-get upgrade

.. and see if you see the updates come through.  If so, that may fix your problem.  If NOT, it's possible the update may have caused the issue and we can continue troubleshooting at that point.

Good luck, and let us know what you find!

EDIT: Also, within the past hour there's been a Firefox update.  You may want to run this and get a list of what packages you update and make note if they cumulatively resolve the issues.


snap packages error "multiple nvidia drivers detected, this is not supported" This issue happened after running updates. I've checked the system but only one Nvidia driver seems to be present. Purging / reinstalling the Nvidia drivers didn't fix it. Nor did purging / reinstalling the snap system. Could it have something to do with nvidia-prime? How does it check for the issue?

The update failed to remove the folder nvidia-361 which contained two broken symlinks. Removing this folder resolved the issue.


Error while saving File in ubuntu 12.04 guest OS I'm running Ubuntu 12.04 as the guest in virtual box with windows 8.1 as host.

Whenever I try to save a text file I have been editing I get this error message on my first try at saving the file.

"Could not save file /thedirectory/thefilename
Unexpected error: Error renaming temporary file: Text file busy."

Is this a Virtualbox problem or an Ubuntu problem? How can I get it to save correctly first time?

NOTE : this happens in the shared folder - not in the rest of Ubuntu hence it  might be a virtual box problem.

try the following

//shareIP/sharedFolder mountpoint smbfs rw,umask=777,uid=linuxUID,username='windowsUsername',password='windowsPassword',auto 0 0


How to disable automatic login in LightDM? I was playing around with "User accounts" and somehow set automatic login. Now, when I start my PC, it just has one button named as "login". Clicking that button, directly logs me in to my PC.

There is no music or no asking for password while logging in. As a side effect, it asks me separately for keyring password

How to disable auto login and make login/keyring password unified again like before?

NOTE: Attempting to disable Automatic Login from System Settings > User Accounts does not work.

This is the content of my /etc/lightdm/lightdm.conf (where I have commented the autologin for my username mgandhi):

[SeatDefaults]
greeter-session=unity-greeter
user-session=ubuntu
#autologin-user=mgandhi

gksudo gedit /etc/lightdm/lightdm.conf

It displays some text as follows:

[SeatDefaults]
greeter-session=unity-greeter
user-session=ubuntu
autologin-user=username

Solution

This <username> would be your particular user name that is automatically logged in with or without password. Delete this username and type in the administrative username or leave it blank.
Shut down the system. It will go back to the login selection screen. Just power down the system and put it on again.

Since you
was playing around with "User accounts" and I made same mistake, I got in same hole.

Keep cool.

You just set your system to no-password when "playing around".

That's why your system log in (auto or not) without asking for password, and this is the same reason keyring system asks for it (cause doesn't received from the system).

So, action jackson:

Check what I am talking about. Go to Menu in Top Bar and choose 1st item (Switch User Account...) and see Login button (what mean you already logged and no user to choose, u can just login, u have no pass (OH!)
After clicking Login, and back to desktop, Choose again in top menu bar the logout command, and logout. You gonna see a button with your username, no "login" button.
Correcting things: Setting a new password. Set the same old one, to keyring dont get confused again, or it will ask you for the password again, after login with password provided. Go to same menu of item 1 and choose last item now (User Accounts...) and on this Gui interface , unlock on the respective button probably providing no password at all (just Enter, if this not works try with old pass..), and then THE GREAT MAGIC TRICK

CLICK THE PASSWORD BOX (its a hidden button, oh devil UI)

this open a dialog box (!) where u probably hit the "login without password" option AND with automatic login option ON too (outside this dialog, on User Accounts screen). SO:...

When you tell the computer to log in without a password (ITS NOT the same as Automatic Login) he does exactly this , log in, without password. So password = nothing. Then keyring goes crazy. (aha!) So, choose the right option now:

Set a password now

and after doing all the entry password stuff, simple hit enter, set automatic login off, to feel again the  pleasure of having a password, and if you want it on again, ok, turn it on, but dont log in without a password again. =D

I hope this helps you to solve your problem. Was a good lesson to me. Bad UI to Ubuntu -1 on this case.


fsck from util-linux 2.26.2 how to fix it I have upgraded from 15.04 to 15.10. After that finished, I have this message in black screen

fsck from util-linux 2.26.2 /dev/sda2: clean. 362332/30236672 files, 81578087/120945920 blocks

What does that mean and how to fix it?

It means that the integrity of the file system on /dev/sda2 was checked and no error was found. There's nothing to fix here, because it's just a notification that there was no problem.

you should reinstall your desktop.
prees ctrl+alt+f1

login with your user and pass.

if you use uinty write in terminal:

sudo apt-get install --reinstall ubuntu-desktop

if use Gnome :

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


Those are error-reports send to the developers of Ubuntu. Just wait until there comes an update. Run

sudo apt update
sudo apt upgrade

To check for and install updates.


Problems with libGl, fbConfigs, swrast through each update? I have problems when compile SFML-project(don't see any graphic):

libGL error: No matching fbConfigs or visuals found
libGL error: failed to load driver: swrast

This error can be solved by simple reinstalling nvidia-drivers through this tutorial: https://askubuntu.com/a/451248/341889

..but when i get new updates - this error is returning ;( What should I do? It's not the solution - not use system's update...

P.S. and yes, i saved all changes after installing nvidia-drivers

The swrast thing is the software renderer.  That means it's not finding the hardware driver for your graphics card.   There are a bunch of libGL libraries installed and a bunch of of symbolic links to those libraries.  To see these run this from the shell:

find /usr -iname "*libGL.so*" -exec ls -l -- {} +

Now the probable cause of your problem is that installing graphics drivers sometimes break these symbolic links.  (Specifically /usr/local/lib/libGL.so.1.2.0 is likely to be either the wrong lib or a sym link to the wrong link) (N.B. I wrote this a while ago.  libGL.so.1.2.0 was the current gl version it may be something else now).

To work out what library the OpenGL programs are trying to run you can turn on a bit of verbosity and run a simple OpenGL program.  You can verify this using the standard OpenGL test program:

LIBGL_DEBUG=verbose glxgears

Hopefully that will fail in the same way as SFML.  With LIBGL_DEBUG it should tell you what OpenGL library it's trying to load.  Furthermore the lib it will be trying to load will almost certainly be /usr/local/lib/libGL.so.1.2.0 (Edit: This was the standard OpenGL library on my machine at the time I answered this.  It may well be some other version on your machine now).

So the solution (in this case) is to make sure that /usr/local/lib/libGL.so.1.2.0 is a symbolic link pointing at the right OpenGL library.  In my case I have the Nvidia 3.40 driver so I ran:

ln -s /usr/lib/nvidia-340/libGL.so.1 /usr/local/lib/libGL.so.1.2.0

But you'll want to point it at the OpenGL lib that is appropriate for you (listed in the first find command).

In summary: installing (proprietary) graphics drivers can break the symbolic links used for OpenGL libs.  To solve this problem manually fix the symbolic links (fix /usr/local/lib/libGL.so.1.2.0 first).

I was facing this weird issue when I ssh to my Ubuntu VM from my Macbook Pro, but installing the below Nvidia driver on my Ubuntu 16.04 fixed the issue. Hope this works for you.

sudo apt-get install nvidia-331


How to use QQ and WeChat on Ubuntu 16.04 LTS? How can I install and use QQ and WeChat with Ubuntu 16.04 LTS? Are there any solutions or suggestions?

WeChat

Franz

You could use Franz and configure your WeChat account there.

It supports:

Slack
Messenger (Facebook)
WhatsApp
Telegram
Skype
WeChat
Hipchat
ChatWork
Flowdock
Hangouts
GroupMe
Rocket.chat
Mattermost
Grape
Gitter
TweetDeck
DingTalk
Steam Chat
Discord
MySMS

so far with 3.0.0 and is available for Windows, Linux and OSX.

QQ

I don't know what QQ is - so can't comment on this.

I found this

Deepin-Apps-Installation

  This repo shows how to install apps packaged with deepin-wine by Deepin on Ubuntu based linux distributions, like Wechat, QQ, TIM, Thunder Speed etc.

Maybe you don't need to install the software, since they both have web-based versions:

WeChat
QQ


How to configure eth0 manually? How to manually configure eth0 in Ubuntu?
I don't have any DHCP server. Do I need IP address when I am just going to capture packets?

I am not sure what you exactly mean by your question. The real manual method has been described above, but since you write you don't have DHCP, I think you rather would like to know what to do to give your box a static IP address and assign this IP address at boot time automatically. Well, here is how:

There should be a file /etc/network/interfaces. This file is read by the Ubuntu boot scripts which in turn configure the network according to that file. If you would like to know what should / could go into that file, then please type "man interfaces".

For example, my /etc/network/interfaces looks like this (comments are cut out):

auto lo
iface lo inet loopback

auto eth0
iface eth0 inet static
        address 192.168.20.20
        netmask 255.255.255.0
        network 192.168.20.0
        broadcast 192.168.20.255
        gateway 192.168.20.250

The first two lines are standard and may already look similar on your box. You may be interested especially in the rest of the file: These lines define a static network configuration to eth0 (without DHCP), and this static configuration gets active automatically on every boot.

ifconfig
ifconfig etho
ifconfig ehto 192.168.3.40 netmask 255.255.255.0
route -n

or

ip route show
then
name for DNS
nameserver 127.0.11
nameserver 8.8.8.8


Install Ubuntu to a discrete drive without touching the main bootloader My machine is set up as follows:

/dev/sda (i.e. "disk1") - 500GB SSD with my production OS environment on it
/dev/sdb (i.e. "disk2") - a 250GB ssd that I use for storing data files
/dev/sdc (i.e. "disk3") - a 16GB m.sata drive that I only recently found out was installed on my machine, but appears to be a reasonably high performance device (i.e. suitable to run an OS and lightweight apps)

What I'd like to do is install Ubuntu on the 16GB drive so that I can boot into it when needed, but primarily use the /dev/sda operating system.

I do NOT want to touch the bootloader on /dev/sda. I do NOT need to be able to select the boot device from GRUB or a windows bootloader.  I'm perfectly willing to do an explicit boot device selection from BIOS to choose when I need to boot into the Ubuntu OS on the 16G drive.  I should actually consider this a requirement, as at some point I will likely need to move one or both of these devices to another machine and I want them to appear as standalone devices, each with their native bootloaders and no knowledge of the "other" OS installed on that machine.

I've tried stepping through the Ubuntu installation program, but it's not clear to me how I could do this (both selecting the destination device for the install and ONLY installing grub on that device).  Anyone have suggestions on how this might work?  I found a suggestion that was basically "take the other disks out, install, and then reinstall the disks" but that's not only pretty un-elegant, it's a real pain for me to take this particular machine (laptop) apart to get to the physical drives.

At the end of the installation process, you are asked to install a bootloader aka grub.

At the bottom of the screen choose the device on which to install it with the drop-down menu.

That's it.

Although, the installer will certainly auto-detect other OSes and populate the grub menu with it. But that' not a problem. Just ignore those entries.

I know a workaround, might be an easier way though! But previously, I have just installed Ubuntu, installed Grub then used EasyBCD in windows to wipe the entire bootloader, then when you reboot it will take you to the system repair screen. Go to advanced, then use cmd.exe and use the command

    bootrec /rebuildbcd

This will recreate original Windows Bootloader, which will not find Ubuntu and Grub will not exist. You will now have Ubuntu Alone on your spare disk, which is useless I believe without a bootloader. This is where you would use a livecd like http://sourceforge.net/projects/boot-repair-cd/ to install grub to the Ubuntu Disk. But it will try to install grub to the Windows partition, so you will have to specify which disk. Maybe even use Gparted to create a small free partition for for Grub on the Ubuntu disk.


Looking for an icon set like this one I'm looking for a working plastic looking icon set like the one below:

Source: Plastico icons by kxmylo | DeviantArt

Unfortunately these icons are too small.

your /home/nuc/.icons isnt actualy a folder but a copy of Plastico-icons.tar renamed to .icons

Use the mv command instead to avoid mistakes like this, or man cp

rm -rf /home/nuc/.icons     (only once to delete your .icons who is actualy a file, not a folder)
mkdir /home/nuc/.icons      (only once, if directory is not existing).
tar -xvf /tmp/Plastico-icons.tar -C /home/nuc/.icons/  (to unpack your .tar to your folder).

I'm unsure why you are looking for one a like when you can have that one?
Download is available through DeviantArt - please check the license!

http://www.deviantart.com/download/390271064/plastico_icons_by_kxmylo-d6gcv2w.png?token=d4b10e7f26dc6cf634c0356b29f3761189509ac2&ts=1442343673


Is #!/bin/sh read by the interpreter? In bash or sh, I guess anything which starts with # is a comment.

But in bash scripts we write:

#!/bin/bash

And in Python scripts, there is:

#!/bin/python

Does this mean that # by itself is a comment whereas #! is not?

The #! line is used before the script is run, then ignored when the script runs.
You're asking what the difference is between a shebang line and an ordinary comment.
A line starting with #! is just as much a comment as any other line that starts with #. This is true if the #! is the first line of the file, or anywhere else. #!/bin/sh has an effect, but it is not read by the interpreter itself.
# is not a comment in all programming languages but, as you know, it's a comment in Bourne-style shells including sh and bash (as well as most non-Bourne-style shells, like csh). It's also a comment in Python. And it is a comment in a variety of configuration files that are not really scripts at all (like /etc/fstab).
Suppose a shell script begins with #!/bin/sh. That is a comment, and the interpreter (the shell) ignores everything on the line after the # character.
The purpose of a #! line is not to give information to the interpreter. The purpose of the #! line is to tell the operating system (or whatever process launches the interpreter) what to use as the interpreter.

If you invoke the script as an executable file, for example, by running ./script.sh, the system consults the first line to see if begins with #!, followed by zero or more spaces, followed by a command. If it does, it runs that command with the name of the script as its argument. In this example, it runs /bin/sh script.sh (or, technically, /bin/sh ./script.sh).

If you invoke the script by explicitly calling the interpreter, the #! line is never consulted. So, if you run sh script.sh, the first line has no effect. If script2.sh's first line is #!/usr/games/nibbles, running sh script2.sh will not try to open the script in nibbles (but ./script2.sh will).

You'll notice that in neither case does the script's extension (.sh), if it has one, impact how it is run. In a Unix-like system, this doesn't ordinarily affect how the script is run. On some other systems, like Windows, the #! shebang line might be ignored entirely by the system, and the extension might determine what runs the scripts. (This doesn't mean you need to give your scripts extensions, but it is one of the reasons why if you do, they should be correct.)
#! was chosen to serve this purpose precisely because # begins a comment. The #! line is for the system, not the interpreter, and it should be ignored by the interpreter.
Shebang Line for Bash Scripts
You (originally) said you use #!/bin/sh for bash scripts. You should only do that if the script doesn't require any of bash's extensions--sh needs to be able to run the script. sh is not always a symlink to bash. Often, including on all remotely recent Debian and Ubuntu systems, sh is a symlink to dash.
Shebang Line for Python Scripts
You also said (in the first version of your question, before editing) that you start your Python scripts with #!/bin/sh read by the interpretor. If you mean that literally, then you should definitely stop doing that. If hello.py begins with that line, running ./hello.py executes:
/bin/sh read by the interpretor hello.py

/bin/sh will try to execute a script called read (with by the interpretor hello.py as its arguments), read will (hopefully) not be found, and your Python script will never be seen by a Python interpreter.
If you're making this mistake but not having the problem I'm describing, you're probably invoking your Python scrips by explicitly specifying the interpreter (e.g., python hello.py), causing the first line to be ignored. When you distribute your scripts to others, or use them a long while later, it may not be clear that this is necessary for them to work. It's best to fix them now. Or at least remove the first line entirely, so that when they fail to run with ./ the error message will make sense.
For Python scripts, if you know where the Python interpreter is (or is going to be), you can write the #! line the same way:
#!/usr/bin/python

Or, if it's a Python 3 script, you should specify python3, since python is almost always Python 2:
#!/usr/bin/python3

However, the problem is that while /bin/sh is supposed to always exist, and /bin/bash almost always exists on systems where bash comes with the OS, Python may exist in a variety of places.
Therefore, many Python programmers use this instead:
#!/usr/bin/env python

(Or #!/usr/bin/env python3 for Python 3.)
This makes the script rely on env being in the "right place" instead of relying on python being in the right place. That's a good thing, because:

env is almost always located in /usr/bin.
On most systems, whichever python should run your script is the one that appears first in the PATH. Starting hello.py with #!/usr/bin/env python make ./hello.py run /usr/bin/env python hello.py, which is (virtually) equivalent to running python hello.py.

The reason you cannot use #!python is that:

You want the interpreter specified to be given by an absolute path (i.e., starting with /).
The calling process would execute python in the current directory. Searching the path when the command doesn't contain a slash is specific shell behavior.

Occasionally a Python or other script that isn't a shell script will have a shebang line starting with #!/bin/sh ... where ... is some other code. This is sometimes correct, because there are some ways to invoke the Bourne-compatible shell (sh) with arguments to make it invoke a Python interpreter. (One of the arguments will probably contain python.) However, for most purposes, #!/usr/bin/env python is simpler, more elegant,  and more likely to work the way you want.
Shebang Lines in Other Languages
Many programming and scripting languages, and some other file formats, use # as a comment. For any of them, a file in the language can be run by a program that takes it as an argument by specifying the program on the first line after #!.
In some programming languages, # is not normally a comment, but as a special case the first line is ignored if it starts with #!. This facilitates the use of #! syntax even though # doesn't otherwise make a line a comment.
Shebang Lines for Files That Don't Run As Scripts
While it's less intuitive, any file whose file format can accommodate a first line starting with #! followed by the full path of an executable can have a shebang line. If you do this, and the file is marked executable, then you can run it like a program...causing it to be opened like a document.
Some applications use this behavior intentionally. For example, in VMware, .vmx files define virtual machines. You can "run" a virtual machine as though it were a script because these files are marked executable and have a shebang line causing them to be opened in a VMware utility.
Shebang Lines for Files That Don't Run as Scrips but Act Like Scripts Anyway
rm removes files. It is not a scripting language. However, a file that starts #!/bin/rm and is marked executable can be run, and when you run it, rm is invoked on it, deleting it.
This is often conceptualized as "the file deletes itself." But the file is not really running at all. This is more like the situation described above for .vmx files.
Still, because the #! line facilitates the running of a simple command (including command-line arguments), you can perform some scripting this way. As a simple example of a "script" more sophisticated than #!/bin/rm, consider:
#!/usr/bin/env tee -a

This takes user input interactively, echoes it back to the user line-by-line, and appends it to the end of the "script" file.
Useful? Not very. Conceptually interesting? Totally! Yes. (Somewhat.)
Conceptually Similar Programming/Scripting Concepts (just for fun)

Scripts/programs that are multiple languages at once, for example, to simulate hashbang functionality in OSes that didn't have it.
(These programs are called polyglots, but this is not to be confused with the other sense of polyglot in software development, a program/project where different parts are written in different languages.)

Metacommands in QBasic/QuickBASIC, which signaled to the compiler (for compiled code) options for code generation, but were part of comments and thus ignored during actual compilation/interpretation.

No, it is only used by the exec system call of the Linux kernel, and treated as a comment by the interpreter

When you do on bash:

./something

on Linux, this calls the exec system call with the path ./something.

This line of the kernel gets called on the file passed to exec: https://github.com/torvalds/linux/blob/v4.8/fs/binfmt_script.c#L25

if ((bprm->buf[0] != '#') || (bprm->buf[1] != '!'))

It reads the very first bytes of the file, and compares them to #!.

If the comparison is true, then the rest of the line is parsed by the Linux kernel, which makes another exec call with path /usr/bin/env python and current file as the first argument:

/usr/bin/env python /path/to/script.py

and this works for any scripting language that uses # as a comment character.

And yes, you can make an infinite loop with:

printf '#!/a\n' | sudo tee /a
sudo chmod +x /a
/a

Bash recognizes the error:

-bash: /a: /a: bad interpreter: Too many levels of symbolic links

#! just happens to be human readable, but that is not required.

If the file started with different bytes, then the exec system call would use a different handler. The other most important built-in handler is for ELF executable files: https://github.com/torvalds/linux/blob/v4.8/fs/binfmt_elf.c#L1305 which checks for bytes 7f 45 4c 46 (which also happens to be human readable for .ELF). Let's confirm that by reading the 4 first bytes of /bin/ls, which is an ELF executable:

head -c 4 "$(which ls)" | hd

output:

00000000  7f 45 4c 46                                       |.ELF|
00000004

So when the kernel sees those bytes, it takes the ELF file, puts it into memory correctly, and starts a new process with it. See also: https://stackoverflow.com/questions/8352535/how-does-kernel-get-an-executable-binary-file-running-under-linux/31394861#31394861

Finally, you can add your own shebang handlers with the binfmt_misc mechanism. For example, you can add a custom handler for .jar files. This mechanism even supports handlers by file extension. Another application is to transparently run executables of a different architecture with QEMU.

I don't think POSIX specifies shebangs however: https://unix.stackexchange.com/a/346214/32558 , although it does mention in on rationale sections, and in the form "if executable scripts are supported by the system something may happen".


Services in rc.d, not starting automatically at boot I have a few services in rc.d that aren't starting at boot time. I've done the update-rc.d, redoing it tells me that start/stop links are already in place, and I can start services manually by using service start.

One of these services (sabnzbdplus) was pulled from apt, the others are downloaded from git. None of them start up automatically.

Nothing seems to be on google other than reinstall the whole system. Any advice?

I corrected this problem by chuser'ing the files/directories that were involved (including settings). I believe this happened because starting and stopping services with sudo gives them root privileges, whereas they're run as the user account at startup.

A folder and subsequent files in 'nix are owned/operated by users+ groups + everyone else. When root owns a folder/files in that folder, only root can use those folder/files for any purpose unless permission is given to others to use those same folder/files.

In this case, the scripts are owned by root so any user will not be able to run them unless two things happen. 1) either root allows anybody else to run them by changing permissions to something like 777 (read, write and execute by anyone) or 2) including the user in the same group with root thereby allocating those same rights to the user.

Both are not the same however. 1 gives all users the right to use (maybe dangerous) whilst ownership stays with root but 2 shares ownership with user through inclusion in same group (exposure to only one user may be more manageable).

I tend to use 1 but that is personal preference and also cos I'm lazy as running one script like "sudo chmod -R 777 /etc/init.d/couchpotato" solves my problems (note my system is isolated so it works for me whereas 2 may be the best solution for open or not so closed systems.
Hope that helps someone else


Ubuntu 17.10 - Bluetooth service "inactive (dead)" I have all of a  sudden a problem with my Bluetooth on Ubuntu 17.10.

The UI tells me it's Off, and I can still turn it off (which is strange).

Then I tried to purge/reinstall Bluez, and used a lot of commands to activate the Bluetooth service but nothing works...

I have read a lot of threads on multiples forums this morning, if someone want to guide me through a kind of debug process it would be appreciated.

Thanks !

First Type in to know the status of Bluetooth

sudo service bluetooth status

Then Use systemctl to start the Bluetooth service

systemctl start bluetooth


I can read from /dev/null; how to fix it? I read the Wikipedia article on /dev/null and was playing around by moving files to /dev/null.

For this I created a test_file and put some contents in it:

$ touch test_file
$ echo "This is written by Aditya" > test_file
$ cat test_file
This is written by Aditya

Thereafter I tried to move the file to /dev/null:

$ mv test_file /dev/null
mv: inter-device move failed: ‘test_file’ to ‘/dev/null’; unable to remove target: Permission denied

Since, this gave me a Permission denied Error; I went ahead and used sudo as I normally do whenever I encounter a Permission denied error.

$ sudo mv test_file /dev/null

The command succeeded and test_file is no longer present in the directory.

However, the Wikipedia article says that it is not possible to recover anything moved to /dev/null and it gives an EOF to any process that tries to read from it. But, I can read from /dev/null:

$ cat /dev/null
This is written by Aditya

What did I do wrong and how do I fix /dev/null back to normal? And why did I encounter Permission denied error in the first place?

/dev/null is a file. A special file. A device file like /dev/sda or /dev/tty that talks to a piece of hardware on your system.

The only difference with /dev/null is that no hardware is linked to it. Any data you send to it is silently discarded. Like the following command:

echo "Hello World" > /dev/null

which won't print anything on your terminal because you send the output of echo to null, to the void, a black hole thus.

But when you did mv test_file /dev/null you've replaced the special file /dev/null by a normal text file, holding a copy of the content of your test_file.
In other words, you've lost your /dev/null.

Now, what you have to do is (to reconstruct it):

sudo rm /dev/null
sudo mknod -m 0666 /dev/null c 1 3

You should reconstruct it because a lot of scripts by default send output to /dev/null. If /dev/null is no more a black hole but a regular text file, it may grow, grow and fill your file-system up. And I'm sure you want to avoid this.

And much more dangerous, a lot of scripts assume that reading from /dev/null will read nothing; breaking this assumption can lead to random garbage written in files all around your system... practically impossible to fix up.

And remember that Linux is multi-tasking: while you are playing with /dev/null, a lot of processes are running and can wreak havoc even during a few seconds "window of opportunity".

If you want to play with /dev/null you can create a copy and experiment with it:

sudo mknod -m 0666 /tmp/null c 1 3

Will create a /tmp/null file that works in the exactly same way of /dev/null but that you can manipulate and test without any risk for your system.

To answer your question of what you should have done, to remove a file, you do:

rm test_file

As others have stated, /dev/null is a destination for the output of programs.


Grub 1.99 Boot Screen Help I am just recently installed Linux on my Oplitex Gx280. Every time T log on I am met by the Grub 1.99 screen and select (Ubuntu, with Linux 3.5.0-34-generic).

I need my computer to boot up automatically so I adjusted the  /etc/default/grub file and set GRUB_TIMEOUT=3 and ran update-grub. However the Grub menu didn't change and have discovered there is no time out and won't advance until you choose an option.

I have even tried using the GRUB_SAVEDEFAULT=true line. I have also done a reinstall of grub from my boot cd with no luck. This is what my grub file looks like after the reinstall:

If you change this file, run 'update-grub' afterwards to update # /boot/grub/grub.cfg. # For full documentation of the options in this file, see: # info -f grub -n 'Simple configuration'

GRUB_DEFAULT="Ubuntu, with Linux 3.5.0-34-generic"
GRUB_HIDDEN_TIMEOUT="5"
GRUB_HIDDEN_TIMEOUT_QUIET="false"
GRUB_TIMEOUT="3"
GRUB_DISTRIBUTOR="`lsb_release -i -s 2> /dev/null || echo Debian`"
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"
GRUB_CMDLINE_LINUX=""

Uncomment to enable BadRAM filtering, modify to suit your needs # This works with Linux (no patch required) and with any kernel that obtains # the memory map information from GRUB (GNU Mach, kernel of FreeBSD ...)

#GRUB_BADRAM="0x01234567,0xfefefefe,0x89abcdef,0xefefefef"
# Uncomment to disable graphical terminal (grub-pc only)
#GRUB_TERMINAL="console" # The resolution used on graphical terminal # note that you can use only modes which your graphic card supports via VBE
# you can see them in real GRUB with the command `vbeinfo' #GRUB_GFXMODE="640x480"
# Uncomment if you don't want GRUB to pass "root=UUID=xxx" parameter to Linux #GRUB_DISABLE_LINUX_UUID="true"
# Uncomment to disable generation of recovery mode menu entries #GRUB_DISABLE_RECOVERY="true"
# Uncomment to get a beep at grub start #GRUB_INIT_TUNE="480 440 1"

GRUB_DISABLE_OS_PROBER="true"
GRUB_SAVEDEFAULT="true"

Please help me solve this issue and keep in mind that I am fairly new to Linux Thx

I have answered my question. Apparently Ubuntu didn't shutdown properly at some point. In this situation Grub defaults to the selection page and forces you to choose. The bug is reaching this screen in this situation also is considered improper and the vicious cycle begins causing you to always reach the Grub boot screen and always having to manually make a choice.

To fix this you must edit /etc/grub.d/00_header and edit the record fail section to

if\${recordfail} = 1 ]; then
  set timeout=${GRUB_TIMEOUT}
else
  set timeout=${GRUB_TIMEOUT}
fi
EOF

This means if there is any failure it it will continue after the time you have specified in /etc/default/grub under GRUB_TIMEOUT. Then run sudo update-grub

Before you edit this it probably says something along the lines of RECORD_FAIL(I don't remember what it exactly said and have since edited mine) with a -1. That -1 time value was what was forcing me to manually make a choice. You might be able to just edit the -1 to some time value, but changing it to what is showed above will defiantly fix the problem.

Have you tried with this:

GRUB_TIMEOUT="0"

I tried it just now, it works. I have also 0 in "hidden grub timeout"

Here is my grub:

firekage@deusex:~$ cat /etc/default/grub
# If you change this file, run 'update-grub' afterwards to update
# /boot/grub/grub.cfg.
# For full documentation of the options in this file, see:
#   info -f grub -n 'Simple configuration'

GRUB_DEFAULT=0
#GRUB_HIDDEN_TIMEOUT=0
GRUB_HIDDEN_TIMEOUT_QUIET=true
GRUB_TIMEOUT=0
GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"
GRUB_CMDLINE_LINUX=""

# Uncomment to enable BadRAM filtering, modify to suit your needs
# This works with Linux (no patch required) and with any kernel that obtains
# the memory map information from GRUB (GNU Mach, kernel of FreeBSD ...)
#GRUB_BADRAM="0x01234567,0xfefefefe,0x89abcdef,0xefefefef"

# Uncomment to disable graphical terminal (grub-pc only)
#GRUB_TERMINAL=console

# The resolution used on graphical terminal
# note that you can use only modes which your graphic card supports via VBE
# you can see them in real GRUB with the command `vbeinfo'
GRUB_GFXMODE=640x480

# Uncomment if you don't want GRUB to pass "root=UUID=xxx" parameter to Linux
#GRUB_DISABLE_LINUX_UUID=true

# Uncomment to disable generation of recovery mode menu entries
#GRUB_DISABLE_RECOVERY="true"

# Uncomment to get a beep at grub start
#GRUB_INIT_TUNE="480 440 1"


Wireless Problem (broadcom) Please help! Hi so the problem is that i can connect to my wireless but i cant connect to the internet.
Thinks i try: Get closer to router, Format, Reinstall firmware.
None help

cat /etc/resolv.conf

# Generated by NetworkManager
nameserver 94.143.178.17
nameserver 195.167.65.194

nm-tool

NetworkManager Tool

`State: connected (global)

- Device: eth0 -----------------------------------------------------------------
  Type:              Wired
  Driver:            tg3
  State:             unavailable
  Default:           no
  HW Address:        00:1D:72:28:DF:B9

  Capabilities:
    Carrier Detect:  yes

  Wired Properties
    Carrier:         off

- Device: wlan0 ----------------------------------------------------------------
  Type:              802.11 WiFi
  Driver:            b43
  State:             disconnected
  Default:           no
  HW Address:        00:1F:3A:56:5E:73

  Capabilities:

  Wireless Properties
    WEP Encryption:  yes
    WPA Encryption:  yes
    WPA2 Encryption: yes

  Wireless Access Points
    EFESSOU GEUSEIS: Infra, 00:05:59:0B:6C:37, Freq 2437 MHz, Rate 54 Mb/s, Strength     54

- Device: ttyUSB0  [Cosmote Default] -------------------------------------------
  Type:              Mobile Broadband (GSM)
  Driver:            option1
  State:             connected
  Default:           yes

  Capabilities:

  IPv4 Settings:
    Address:         31.152.209.75
    Prefix:          32 (255.255.255.255)
    Gateway:         10.64.64.64

    DNS:             94.143.178.17
    DNS:             195.167.65.194

sudo iwlist scan

lo        Interface doesn't support scanning.

eth0      Interface doesn't support scanning.

irda0     Interface doesn't support scanning.

wlan0     Scan completed :
      Cell 01 - Address: 00:05:59:0B:6C:37
                Channel:6
                Frequency:2.437 GHz (Channel 6)
                Quality=42/70  Signal level=-68 dBm
                Encryption key:off
                ESSID:"EFESSOU GEUSEIS"
                Bit Rates:1 Mb/s; 2 Mb/s; 5.5 Mb/s; 11 Mb/s; 22 Mb/s
                Bit Rates:6 Mb/s; 9 Mb/s; 12 Mb/s; 18 Mb/s; 24 Mb/s
                          36 Mb/s; 48 Mb/s; 54 Mb/s
                Mode:Master
                Extra:tsf=000000333425f1b6
                Extra: Last beacon: 784ms ago
                IE: Unknown: 000F45464553534F552047455553454953
                IE: Unknown: 010582848B962C
                IE: Unknown: 030106
                IE: Unknown: 2A0100
                IE: Unknown: 32080C1218243048606C

wwan0     Interface doesn't support scanning.

ppp0      Interface doesn't support scanning.

cat /var/lib/NetworkManager/NetworkManager.state

[main]
NetworkingEnabled=true
WirelessEnabled=true
WWANEnabled=true
WimaxEnabled=true

cat /etc/network/interfaces

auto lo
iface lo inet loopback

lsmod | grep b43

b43                   318816  0
mac80211              272785  1 b43
cfg80211              172392  2 b43,mac80211
ssb                    50682  1 b43

route -n

Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
0.0.0.0         10.64.64.64     0.0.0.0         UG    0      0        0 ppp0
10.64.64.64     0.0.0.0         255.255.255.255 UH    0      0        0 ppp0
169.254.0.0     0.0.0.0         255.255.0.0     U     1000   0        0 ppp0

I runned those codes when i was online with my broadband connection. If you need any command be executed when i am connected with my wireless (witch it has problem) please tell me

The output of iwlist and lsmod you included show that your computer recognised and can use the wireless card, so it's not likely a driver issue.

Based on your routing table, it looks like your computer is set up to send all internet traffic through the ppp0 interface and not the wlan0 interface.  try unplugging/disabling any modems or VPNs that you have configured, then try connecting to wireless again.

Your wired properties carrier (whichever it is) is off. You must activate it.

echo on | sudo tee /sys/class/net/eth0/device/power/control


Command not found on bash script I want to run a bash script to access two terminal tabs, each run cd "folder", then "npm run start", as below:

 #!/bin/bash
    sudo mysql -u root -h localhost
    PATH=/var/lib/cloud9/autorun/loginbrillo
    tmux new-session -d -s session1 "cd $PATH/backend && npm run start" &
    tmux new-session -d -s sessionn1 "cd $PATH/frontend && npm run start" &
    chromium-browser  http://192.168.7.2:4001/

When I run it, I get :

tmux: command not found
npm: command not found
chromium-browser: command not found

How to fix it please ?

The PATH variable is used to find all commands your script will use but rather than adding new directories to it you have overwritten it with a single directory, replace your second line with the following:

PATH=$PATH:/var/lib/cloud9/autorun/loginbrillo

PATH is a colon seperated list, this will get the current value of PATH, append a colon to it and add your directory to it


Output of a Perl one-liner I have a perl one-liner:

perl -pe 'while (/((\(.*?[^)]\))|(".*?"))/g) {print "$1 ";} print "\n"' testdata

The file testdata contains the following:

"123" (123) 123

Ouput is:

"123" (123)
"123" (123) 123

But I need:

"123" (123)

What can I do?

How muru commented:

  -p prints $_. If you're going to do your own printing, use -n.

perl -ne 'while (/((\(.*?[^)]\))|(".*?"))/g) {print "$1 ";} print "\n"' testdata

Hm, you could simply put your query (the data-pattern) you are looking for between these symbols and demand strictly this by

'data-pattern'

whatever this data-pattern would contain ... even wild-cards are then
allowed too ...

this would look here as part of your intended usage of your command like

'"123" (123)'

or it would look like

\'"123" (123)\'

after your comment I added as follows (please dont downvote me - instead stay constructive with your opinion but do not use your thumbs like in cakepoof) so add or link your perl-line with a pipe to grep -e as follows :

  perl -pe 'while (/(((.?[^)]))|(".?"))/g) {print "$1 ";} print "\n"' testdata | grep -e '"123" (123)'

or

  perl -pe 'while (/(((.?[^)]))|(".?"))/g) {print "$1 ";} print "\n"' testdata | grep -e \'"123" (123)\'


Touchpad not working on Ubuntu 19.04 Im a complete noob. Just bought a Lenovo ideapad 330 17ch. Installed Ubuntu 18.10. Wored fine apart from wi-fi and touchpad. Then downloaded prerelease od 19.04. installed it and this solved the problem with wi-fi, but not with touchpad. My bloothoth mouse works fine. Please help. Thanks
Ive found this: This touchpad id is "ELAN061F"

"To resolve this issue you need add a line in file:
drivers/input/mouse/elan_i2c_core.c

missing line:

{ "ELAN061F", 0 },"
But I really dont know how to make it.

I guess the problem is editing the file the right way. You can use a text editor that will allow you to edit the particular file as root, so executing the editor in terminal with sudo might help. Dont try it with gedit though, it happens that gedit will say it is not allowed to use it in sudo mode... so what you do is, use one that is allready installed. I suggest, if you are not that familiar with terminal based text editors, to use nano, it allows usage of the mouse, which vi/vim does allow as well, but... not clicking in text, also, but this solution I am not that familiar with... you can use a command to simply append the specified line to the specified file, wouldnt know what kind of command it is, but I am just as curious if someone could help out! Chances are, using vi/vim or nano, you wont need sudo, but just use it to be safe... Also please specify the file path from root / that would help me, I am not that experienced myself, but if you right click elan_i2c_core.c and look into its properties, you will find the correct file path from root directory to the location of the file.


Since the input appears to be grouped/sorted by the 2nd column already this should be quite simple and doesn’t require to keep and sort the entire data set in memory, only two records at a time.1

I first thought of an Awk solution but found it to clumsy to deal with arrays and non-blank field delimiters. Then I decided on a short-ish Python program:

#!/usr/bin/python3
import sys
DELIMITER = ','

def remove_duplicates(records):
    prev = None
    for r in records:
        r = (int(r[0]), int(r[1]), int(r[2]), float(r[3]), int(r[4]))
        if prev is None:
            prev = r
        elif r[1] != prev[1]:
            yield prev
            prev = r
        elif r[3] > prev[3]:
            prev = r
    if prev is not None:
        yield prev

def main():
    for r in remove_duplicates(
        l.rstrip('\n').rsplit(DELIMITER) for l in sys.stdin
    ):
        print(*r, sep=',')

if __name__ == '__main__':
    main()

On my system it has a throughput of ~250,000 records or 5 MB per CPU second.

Usage

python3 remove-duplicates.py < input.txt > output.txt

The program can’t deal with column headers, so you need to strip them off:

tail -n +2 < input.txt | python3 remove-duplicates.py > output.txt

If you want to add them back to the result:

{ read -r header && printf '%s\n' "$header" && python3 remove-duplicates.py; } < input.txt > output.txt

1 This is one major advantage over waltinator’s and steeldriver’s  approaches for data sets that don’t fit into main memory.


Is there a shell-independent HUD-like menu search tool for Xfce/GNOME/Cinnamon? The Ubuntu Heads-Up Display (HUD) - you love it or you hate it. Personally I rather like a classic desktop, so I use Xfce or GNOME-fork Cinnamon, and I'd like to keep those menu's where they are.

But the HUD is pretty awesome when your menus are complex and you forgot where an option sits. This makes that search trick very interesting.

I know the HUD is Unity specific. I am looking for a HUD-like tool to complement the menu in shells other than Unity.

There is Appmenu Runner for KDE that does this.
There is also appmenu-qt for KDE.

Problem with the above is that it uses KDE libs, and it only works for KDE apps.

This is Linux, there aught to be something like this for GNOME/GTK apps, right?

Looking for any tool that can search the menus. I already use(d) Synapse, Kupfer and GNOME Do, but those are simply app-launchers (with some tricks). Something like that would suffice if only they included searching the menus for the currently focused application.

The HUD allows users to activate menu items by typing part of the name. It uses a fuzzy search algorithm that will highlight partial matches. It can match menu items that are multiple layers deep in an application's menu hierarchy. The feature, which replaces traditional menu accelerators, is activated by pressing the alt key.

Similar questions:

Is there a way to search a menu bar in Debian? - Unix.StackExchange
How can I access menu bar items alike hud (unity)? - Unix.StackExchange
HUD in other window managers (especially xmonad) - AskUbuntu

I prefer Synapse over Gnome-Do.

It seems that there is some discussion about bringing this feature to Synapse.

The following two applications are nominally part of Xfce, but can readily be used in the DE of your choice.

xfce4-appfinder: The Application Finder in Xfce.

xfdashboard: "Maybe a Gnome shell like dashboard for Xfce"

It comes with extensive documentation and screenshots.

The panel plug-in solution below, however, is not desktop-independent and requires the use of xfce4-panel. But since you are using Xfce and are looking for similar functionality in the Gtk  world, the following could help.

xfce4-whiskermenu: "Whisker Menu is an alternate application launcher for Xfce. [..] If you’re not sure exactly where a program is listed, instead of browsing through each category you can simply enter a search term. The search field is focused when opening the menu, so you can just start typing."

In addition, check How can I have a dash-like search under Xfce? for a similar question with relevant answers.


bash: /usr/bin/locale-check: No such file or directory error after i downgraded from ubuntu 18.10 to 18.04 After downgrading my Ubuntu from 18.10 to 18.04 when ever trying to login I am getting the following error:

And opening the terminal following error displays

  bash: /usr/bin/locale-check: No such file or directory

How can I fix this error?

I had this same issue after downgrading 18.10 to 18.04

  -bash: /usr/bin/locale-check: No such file or directory

In downgrading I had to create this file:
/etc/apt/preferences.d/preferences
to force it to downgrade, which was preventing some packages from being downloaded
after removing it and updating/upgrading:

  Note: you may have created a different preferences file so your file below might be named differently

sudo rm /etc/apt/preferences.d/preferences
sudo apt update && sudo apt upgrade

That fixed it for me! :)

It should be fixed by reinstalling the package base-files, which can be done via:

sudo apt install base-files

Unfortunately, that didn't work, so I simply also copied it from another Ubuntu 18.04 system onto this one.


What is the difference between apt and apt-get? I read about the new fancy progress bar which was added to apt 1.0 in Softpedia and how to enable it here. However on running sudo apt-get update, I did not see the fancy progress bars. On reading the second link again, the solution explicitly requires you to use sudo apt update.

Hence my question is the difference between apt and apt-get. I thought they were one and the same.

They are very similar command line tools available in Trusty (14.04) and later.  apt-get and apt-cache's most commonly used commands are available in apt.
apt-get may be considered as lower-level and "back-end", and support other APT-based tools. apt is designed for end-users (human) and its output may be changed between versions.
Note from apt(8):
The `apt` command is meant to be pleasant for end users and does not need
       to be backward compatible like apt-get(8).

Take a look at this post for more information on the new tool:

http://mvogt.wordpress.com/2014/04/04/apt-1-0/

A synopsis of the above link (with corrections*):

The big news for this version is that we included a new “apt” binary that combines the most commonly used commands from apt-get and apt-cache. The commands are the same as their apt-get/apt-cache counterparts but with slightly different configuration options.

Currently the apt binary supports the following commands:

list: which is similar to dpkg list and can be used with flags like
--installed or --upgradable.
search: works just like apt-cache search but sorted alphabetically.
show: works like apt-cache show but hide some details that people are less likely to care about (like the hashes). The full record is still available via apt-cache show of course.
update: like the regular apt-get update with color output enabled, but apt update also shows the number of upgradeable packages (if any).
install,remove: adds progress output during the dpkg run.
upgrade: the same as apt-get upgrade --with-new-pkgs.*
full-upgrade: a more meaningful name for dist-upgrade.
edit-sources: edit sources.list using $EDITOR.
policy: works just like apt-cache policy

You can enable/disable the install progress [bar] via:
# echo 'Dpkg::Progress-Fancy "1";' > /etc/apt/apt.conf.d/99progressbar

APT is a vast project, whose original plans included a graphical interface. It is based on a library which contains the core application, and apt-get is the first front end — command-line based — which was developed within the project.

  apt is a second command-line based front end provided by APT which overcomes some design mistakes of apt-get.

Quoted from:

https://debian-handbook.info/browse/stable/sect.apt-get.html


How to install wkhtmltopdf 0.12.1 on Ubuntu server? I am trying to install current stable version 0.12.1, but it only installs 0.9.9.
Any chance to install latest version with apt-get install? It seems that 0.9.9 is very old :(

In Ubuntu 16.04 and later wkhtmltopdf 0.12.2+ can be installed from the default Ubuntu repositories.

In Ubuntu 14.04, open the terminal and type:

sudo add-apt-repository ppa:ecometrica/servers
sudo apt-get update
sudo apt-get install wkhtmltopdf

In Ubuntu 12.04, open the terminal and type:

sudo add-apt-repository ppa:pov/wkhtmltopdf
sudo apt-get update
sudo apt-get install wkhtmltopdf

and one step after this is to reboot the server or else you will get the error: wkhtmltopdf: cannot connect to X server .

After trying the below command, It worked for me

cd ~
yum install -y xorg-x11-fonts-75dpi xorg-x11-fonts-Type1 openssl git-core fontconfig
wget https://downloads.wkhtmltopdf.org/0.12/0.12.4/wkhtmltox-0.12.4_linux-generic-amd64.tar.xz
tar xvf wkhtmltox-0.12.4_linux-generic-amd64.tar.xz
mv wkhtmltox/bin/wkhtmlto* /usr/bin


How can I remove the "Dash Home" icon from the Unity launcher? My notebook has a widescreen display so vertical space is an absolute premium for me. When I installed Ubuntu 11.10 I was disappointed to see that a new icon confusingly named "Dash Home" had been added to the very top of the Unity launcher. I can't move it to the bottom (by dragging it) and it doesn't have a context menu with which to remove it (by unchecking "Keep In Launcher"). It's horrible.

How can I remove it from the Unity launcher and reclaim the space that was taken from me? (I realize that if it's removed I'll have to open the dashboard with the super key - I'm fine with that)

I wasn't satisfied with the answers so I compared the 11.10 Unity-2D source with earlier versions. It can be done. Here's how to do it:

(for 11.04/11.10)

gksudo gedit /usr/share/unity-2d/launcher/Launcher.qml

(for 12.04)

gksudo gedit /usr/share/unity-2d/shell/launcher/Launcher.qml

Scroll down until you find the following section:

    Component.onCompleted: {
        items.appendModel(bfbModel);
        items.appendModel(applications);
        items.appendModel(workspaces);
        items.appendModel(devices);
        shelfItems.appendModel(trashes);
    }

items.appendModel(bfbModel); is the offending line of code. Remove this line (or comment it out). Save your changes and close the file.

Restart Unity-2D with:

killall unity-2d-launcher

(12.04)

killall unity-2d-shell

Let's hope someone adds a way to toggle this feature in the upcoming Unity settings manager. Cheers!

You cannot remove it as it is a part of the Unity Launcher code, Mark Shuttleworth explained the reasons behind the Dash icon and the Launcher in his blog post here.


Change owner of internal hard drive partition from root to user I have a number of drives internal and external. Some are partitioned. Most mount automatically at boot (all did at one point).

One partition is owned by root and therefore does not mount automatically. I know how to mount it as root.

I do not know how to take ownership of that partition as user X. I have tried changing permissions using the gui in Nautilus as root. They are not accepted and immediately revert.

The partition is NTFS. The other parition on that drive is owned by me as user and mounts automatically

Did you try

sudo chown user:user

For example sudo chown cyrex:cyrex (User:Group)

if the partition is called party, your user is called cyrex and it is in /media just do for example:

sudo chown cyrex:cyrex /media/cyrex/party -R (The R is for recursive so it affects all directory/files and subdirectory.

As noted, the partition is NTFS so if is automatically mounted you need to make sure that the user that has permission is you. To do this follow this steps:

Go to console (gnome-terminal)
Type id -u. This should give you the user id you have which you will insert into fstab.
Open fstab sudo /etc/fstab and search for the line that is mounting the ntfs partition.
Assuming is something like this:

UUID=1234532123 /media/amntfs  ntfs  defaults 0       0

Add to it the umask, uid and gid masks like this

UUID=1234532123 /media/amntfs  ntfs   defaults,umask=007,uid=1000,gid=1000  0       0

Save the file and just reboot or remount the unit.

Here:

The uid is your User ID. The one you got from id -u.
The gid is you Group ID. Normally the same as id -u but you can check it with id -g.
The umask is like chown but reversed.

See How do I use 'chmod' on an NTFS (or FAT32) partition? on more about using chmod/chown on NTFS filesystems.

The easiest  is to in terminal open file manager as sudo
sudo nemo or sudo nautilus or what ever file manager linux is using, then right click on partition and add permisions


apt-get install with --assume-yes is still prompting me to install dependencies I am trying to write a bash script to install a list of software. I am using --assume-yes to get past the prompts.

This following line somehow doesn't work:

sudo apt-get install python-software-properties --assume-yes

If I try to apt-get without --assume-yes it works but the prompt asks me to:

please [Enter] to continue or ctrl+c to cancel adding it

How do I add Enter as a command when running apt-get install instead of using --assume-yes?

Your problem is that the option should be before the packages, not after, this is the correct syntax:

apt-get <options> command package=version/release

So, for it to work it should be:

sudo apt-get --assume-yes install python-software-properties

apt-get is forgiving when mixing up command and options, but to err on the safe side, you should always use the options before the command and never put options or commands after the name of the package.

For another silent and effective way as follows :

sudo DEBIAN_FRONTEND=noninteractive apt-get install -qq python-software-properties < /dev/null > /dev/null


Security considerations for a default install? So with an old burned install CD of Feisty Fawn I went through the process of completely formatting the Windows OS and installing Ubuntu on an old XP laptop. I then went through the online upgrade to 10.4 LTS, only installing the gnome desktop environment package in the process.

My (admittedly very open) question is that in this state and online, what security considerations do I have to immediately make for the default install? I understand that a lot of this swings on my intended use of the server, but just sitting there online what risks is it exposed to (this obviously goes far beyond the realm of linux, but I am not sure how these risks are accommodated in the default install). For example, I believe there is a firewall installed with Ubuntu but by default it allows all traffic.

Any other guidelines would be much appreciated.
Thanks

The Community Documentation's security chapter is a good starting point. For a server you should read the security chapter in the server guide, too

None.

There is no firewall needed for a default Ubuntu system because there are no insecure services listening by default.


I can't install valgrind due dpkg-deb broken pipe, how to fix this? hanu@hanu-HP-Pavilion-Sleekbook-14:~/raijin/build_debug$ sudo apt-get -f install
Reading package lists... Done
Building dependency tree
Reading state information... Done
Correcting dependencies... Done
The following extra packages will be installed:
  locales
The following packages will be upgraded:
  locales
1 upgraded, 0 newly installed, 0 to remove and 1008 not upgraded.
Need to get 0 B/3,801 kB of archives.
After this operation, 6,537 kB of additional disk space will be used.
Do you want to continue [Y/n]? Y
WARNING: The following packages cannot be authenticated!
  locales
Install these packages without verification [y/N]? y
Preconfiguring packages ...
(Reading database ... 204496 files and directories currently installed.)
Preparing to replace locales 2.13+git20120306-9 (using .../locales_2.17-92_all.deb) ...
Unpacking replacement locales ...
dpkg: error processing /var/cache/apt/archives/locales_2.17-92_all.deb (--unpack):
 trying to overwrite '/usr/sbin/validlocale', which is also in package libc-bin 2.17-0ubuntu5
configured to not write apport reports
                                      dpkg-deb: error: subprocess paste was killed by signal (Broken pipe)
Errors were encountered while processing:
 /var/cache/apt/archives/locales_2.17-92_all.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

hanu@hanu-HP-Pavilion-Sleekbook-14:~/raijin/build_debug$ valgrind
The program 'valgrind' is currently not installed. You can install it by typing:
sudo apt-get install valgrind

When finding errors, it is usually informative to look at the first error, the one that caused the later ones.

dpkg: error processing /var/cache/apt/archives/locales_2.17-92_all.deb (--unpack):
 trying to overwrite '/usr/sbin/validlocale', which is also in package libc-bin 2.17-0ubuntu5

The problem is as dpkg says: the same file validlocale exists in two packages, so they cannot both be installed.  What might fix this is to upgrade the other package first.

aptitude install libc-bin

When that is finished, try installing valgrind again.

It may be better to install it from the Ubuntu Software Center. Search for valgrind

This would allow you to install the main programme

and any other additional packages which may be relevant.


Extracting zip file fails giving error need PK compat. v5.1 I have a password protected zip file which was created in Windows. When I am trying to extract the same file under Ubuntu I get the error need PK compat. v5.1 (can do v4.6). Any idea how to proceed?

According to this thread you can use 7z for this. First install p7zip-full package with:

sudo apt-get install p7zip-full

Then either use the GUI or extract the archive with this command:

7z e /path/to/file

or

7z x /path/to/file

(second one preserves directory structure).

Fix zip file by the use of fixing broken zip file missing parts

Item http://www.fixbrokenzipfile.zipfilefix.com will give you the conception how to handle the issue


Graphics problems with applications For some reason, I've got some graphical issues sometimes. Mostly with AbiWord, LibreOffice (and OpenOffice.org), and Wine applications. I've added some screenshots below t oclarify a bit.
This is not a problem that recently popped up. As a matter of fact, I've always had it since Ubuntu 8.10, and there never came an update to fix it. I'm currently using Linux Mint 10 (based upon Ubuntu 10.10), but as I already said, that doesn't really say much as I'va also had this problem with Linux Mint 8, Ubuntu 8.10, Ubuntu 9.04, Ubuntu 9.10 and Ubuntu 10.04. It was never a big problem, as I rarely used any text processing programs. But recently, I'm starting to use them more and more, and it's really annoying being unable to work because of this problem. When I first open an application, everything looks normal, then after a while (when I highlight, click, ... an item) they'll suddenly screw up. This also happens when I move or resize the window. Sometimes when this happens, I can just minimize the window, and when i restore it, sometimes it will be gone (for a few seconds at least) or it will have changed positions.
I'm using the nvidia-current graphics card driver. But I have also always had this problem on my old computer, wich used... I think nvidia-96.

Screenshots

(I've done the blur myself, so that's not the issue, the problem is that blue crap)

It's a known bug in the nvidia drivers. Unfortunately, since you're using proprietary drivers, there is no way of getting this bug fixed except by maybe complaining on nvnews.net (where some nvidia reps hang out).

So the solution is to use the workaround listed in the bug report, or to switch to the free drivers.

And next time you're buying graphics hardware, remember nvidia's buggy drivers.. :-P

What version of Java are you using (specifically, is it the latest)? If you're using openJDK, have you tried using Sun Java (and purging OJDK)? I can't speak for AbiWord, and your "Wine programs" is too vague, but I know LO/OO.o runs on Java, and Java issues sometimes manifest as UI issues. Since Java isn't dependent on the OS, it could explain why your issue persists through distros.


I can't open Ubuntu Software Center I downloaded google chrome that was made for my computer from https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb. For some reason after I installed I can't open. Also in the corner where the time and other things are there's this red circle with a white dash in the middle of it. It says "An error occured, please run package manager from the right click menu or apt-get in a terminal to see what is wrong. The error message was: 'Unknown Error:''(E:The package google-chrome-stable needs to be reinstalled,but I can't find an archive for it.)' This usually means that your installed packages have unmet dependencies.

Type in terminal: sudo apt-get install -f

Follow next instructions.

You can try removing the package completely first by doing:

sudo dpkg --force-all -P google-chrome-stable


History command showing the directory and the date Is there a way to have in the .bash_history file, listed: the directory where the command has been typed, the date, and the command ?

You CAN write the current working directory in a history file as well, but you have to make an own history file:

Write your .bashrc as follows:

export CUSTOM_HISTFILE="/tmp/bash_history" #path of the new history file
export PROMPT_COMMAND="history -a; history -c; history -r; date | xargs echo -n >>$CUSTOM_HISTFILE; echo -n ' - ' >>$CUSTOM_HISTFILE; pwd | xargs echo -n >>$CUSTOM_HISTFILE; echo -n ' - ' >>$CUSTOM_HISTFILE; tail -n 1 $HISTFILE >>$CUSTOM_HISTFILE; $PROMPT_COMMAND"

It's a bit circumstantial, but it works. An entry could look like this:

Mit Nov 13 13:44:39 CET 2013 - /home/test - ls -la

Can you please clear your question a bit. There is a command called fc(fixed command) in ubuntu which enables you to display the history file, edit and re-execute previous command. Basically it is the alias set up for history command.

By default,

fc  -l lists the 16 most recent commands.

You can also use

history command itself to see the command history.


How to access hotspot created on Linux(Ubuntu/ Mint)from android device? I am able to create hotspot(ad-hoc) and it is visible to other laptops and connects successfully but hotspot is not visible to android devices.

Android does not support by default ad-hoc wifi network. For that to work, you need to install some third party app/utility that require most of the time that the android device is rooted.

So another option is to create a (software) AP (Access Point) on Ubuntu. But for that you need that your wifi card support it at the driver level. And few card support that. Check that with

$ sudo iw list
[...]
Supported interface modes:
         * IBSS
         * managed
         * AP
         * AP/VLAN
         * WDS
         * monitor
         * mesh point

You need the * AP line

Also if your card is not compatible with nl80211, the above command will output nothing. I don't know how to check the AP support in that case.

If your card support AP mode, then you can use https://github.com/oblique/create_ap which is a simple script that wrap around hostapd, iptables, ... and do the dirty work for you.

Install the dep:

sudo apt-get install hostapd iptables iw git

then run create_ap

git clone https://github.com/oblique/create_ap
cd create_ap
sudo iw dev wlan0 disconnect
sudo ./create_ap -c 3 -w 2 wlan0 eth0 MyWifiAP mywifiappassword

There are 3 ways to create wifi hotspot in Ubuntu:

Using Ap-hotspot, an open-source app from github
Using KDE connection editor
Using Unity’s Default Network Manager with a little hack

Using Unity’s Default Network Manager with a little hack

Disable WIFI and plug in an internet cable to your laptop so that your Ubuntu is connect to a wired internet and wireless is disabled.
Go to Network Icon on top panel -> Edit Connections …, then click the Add button in the pop-up window.
Choose Wi-Fi from the drop-down menu when you’re asked to choose a connection type
fill the wifi form
Go to Wi-Fi Security tab, select security type WPA & WPA2 Personal and set a password.
Go to IPv4 Settings tab, from Method drop-down box select Shared to other computers.

Full details here


swapon has no effect, /proc/swaps remains empty My Ubuntu server has no more than 512 MB of memory. It is not enough for running Node.js + MongoDB.

Hence I decided to add a swap file:

# dd if=/dev/zero of=/root/myswapfile bs=1M count=1024
1024+0 records in
1024+0 records out
1073741824 bytes (1.1 GB) copied, 4.69263 s, 229 MB/s
# mkswap /root/myswapfile
Setting up swapspace version 1, size = 1048572 KiB
no label, UUID=3c64da32-d0b4-49e5-92db-fba961b8ae28
# swapon /root/myswapfile

No error message => successful!

The new swap file should now be listed, but it is not:

# swapon -s
Filename                Type        Size    Used    Priority

(empty list)

How can I make it work? What might be the reason for the missing swap?

First, erase your original swapfile:

sudo rm /myswapfile

Next, run the following commands one by one:

sudo fallocate -l 1G /swapfile
sudo chmod 600 /swapfile
ls -lh /swapfile

The output should be similar to the following:

-rw------- 1 root root 1.0G Aug  3 18:20 /swapfile

Now, run the following commands:

sudo mkswap /swapfile
sudo swapon /swapfile
sudo swapon -s

Now, edit /etc/fstab to make the changes permanent:

sudo nano /etc/fstab

and add the following line to the end of the file:

/swapfile    none            swap    sw              0       0

Press CTRL + o and then press ENTER to save the file.

Press CTRL + x to exit nano.

source: https://www.digitalocean.com/community/tutorials/how-to-add-swap-on-ubuntu-14-04

If that still doesn't work, you may want to check swappiness:

cat /proc/sys/vm/swappiness

This command should return a number. The default should be 60.

If no output, run the following commands one by one:

sudo sysctl vm.swappiness=60
echo "vm.swappiness = 60" | tee -a /etc/sysctl.conf

The -a is important after tee or you will overwrite the entire file!!!

you could do this:

sudo umount -a
gedit /etc/fstab

and write in where swap is this:

/proc/swap     proc   default  errors=noremount     1

and then this:

sudo mount -a

and then run gpart and set the swap drive as swap, and mount it on the root dev drive, and it might work fine this way.


PyCharm Community Edition won't display in Ubuntu 18.04 I installed PyCharm Community Edition via Ubuntu Software Center, and when I try to open the application it indicates that PyCharm is open and I can see the window when I hover over the icon, but it won't display on the desktop in full view. I have already tried to uninstall and reinstall this, and the issue continues to persist.

There was an issue with the display functionality on my Ubuntu where it thought that I had 2 displays. Therefore it was showing PyCharm on the other "display". Once I changed the display settings, PyCharm showed up on my display.

This happened to me a while back and i tried resetting and it worked, my recommendation, restart Ubuntu, run it, if that doesnt work; uninstall PyCharm then restart Ubuntu, then re-install, just restarting always worked for me.


How should I transfer photo (jpeg) files from my ubuntu 14.04 PC and display them on my iPad, without using iTunes? I am very happy to manage my photo files centrally on my Ubuntu 14.04 PC.
It is easy to mount an i-device onto the PC using a USB cable and opening Nautilus. (congrats for making that so seamless, developers!) Then I can copy jpegs FROM the directories of the i-devices TO my PC file system, using Nautilus file manager.
But, I need to take photos FROM the PC, and copy them TO an i-app that can display them on an i-device.
Does anybody have a practical way to do this without iTunes ? I have tried a number of apps which were recommended for Ubuntu 12, but nothing has worked.
I do not care what the i-device "thinks" about the pictures' dates, places, etc, I just need to carry the pictures and show them to people on the iPad.

A FTP client can transfer files both ways, you can download or upload files. So yeah, you can definitely move the photos TO the smartphone. Greetings.

I use sftpd (ftp server) to transfer files from my smartphone (where I installed a ftp client, obviously) to my laptop (Ubuntu 14.04), anytime, anywhere, as long as both of them are running.


How do I find out the kernel version I am running? The path to previous driver is
usually /lib/modules/<kernel-version>/kernel/net/wireless

I need this info so I can finish updating my STA Broadcom wireless. However, I'm a noob at Ubuntu and I'm not sure how to find the kernel version or kernel.
I checked /lib/modules/ and found this:
2.6.27-10-generic  2.6.32-30-generic  2.6.32-34-generic  2.6.32-38-generic
2.6.27-7-generic   2.6.32-31-generic  2.6.32-35-generic  3.2.0-54-generic
2.6.28-19-generic  2.6.32-32-generic  2.6.32-36-generic  3.2.0-54-generic-pae
2.6.31-23-generic  2.6.32-33-generic  2.6.32-37-generic

Which one is the running kernel?
Another question. Is there a snippet so I don't have to cut and paste?
Thanks for your time! :)

Well there are multiple ways to find the kernel version
Open terminal and execute:
uname -r

It would display something like:
3.8.0-30-generic

You can get further information on the current kernel with
uname -a

It would display something like:
Linux saurav-P4I45Gx-PE 3.8.0-30-generic #44~precise1-Ubuntu SMP Fri Aug 23 17:33:45 UTC 2013 i686 i686 i386 GNU/Linux

Another way to know the kernel version is to open Synaptic Package Manager and search for linux image. You have to check for the installed Kernel version.
Another way to find version of installed kernels is to run this command:
dpkg -l | grep linux-image | grep ii

or for just the version strings:
dpkg -l | grep linux-image | grep ii | awk '{print $3}'

The latest kernel (the one with the highest version number) will boot by default, so if you have rebooted since the last kernel update, and you have not made adjustments to boot into a kernel other than the default, then you can be reasonably confident that the highest version number displayed will be the version of the running kernel, but you should use uname for more reliable information.

You can use the two following commands:
uname -r

for version - output like:
3.5.0.17-generic

and
uname -v

for update time - output like:
#-ubuntu SMP Tue Oct 9 19:32:08 UTC 2012


Ubuntu Server on laptop - power off display when close lid Running Ubuntu Server 11.10 on a laptop.  I would like to find a way to have the lcd display power off when I close the lid.  Don't want to burned it out.  Tried search for an hour, but couldn't find a solution anywhere.  At least not for the server version.

Please note, this is the Server version I am asking about.  There is no GUI.

Tried searching for "ubuntu server" with words like "power management", "lid close", "display power", etc.

New:  I found a way to detect if the laptop lid is closed with the acpid daemon.  Is there any kind of power management command that will power off the display?

Posting answer from comment above:

vbetool dpms off will power off the display – cscarney Dec 9 '11 at 20:52

found in system settings, depending on the ubuntu desktop manager you use. In this dialogue I have the option to darken the screen (and then select 0%) when closing the lid.


Why does XChat always open only partially maximized? When I start Xchat, I note the issue:

As you can see, the bottom edge of the window is covered by some other thing (in this case, it's firefox status bar, but if I have no other window opened, I see my desktop background in that position), so I reduce it with the maximize button on top left:

Finally I maximize it again and obtain the wanted behaviour:

Is this a bug or can I adjust it in any way?

It's been annoying me too :).  It's a bug which is fixed in Ubuntu 12.10 (Quantal) and will be fixed in 12.04 (requires verification).

It seems the verification was made for 12.04. A recent update solved the issue for me. Now I'm running 1:0.30.0~git20110821.e2a400-0.2ubuntu4.1


I choose to load GNOME but it always loads Unity I've installed GNOME-Shell from the software centre and it installed with no problems.  However when I log out, select GNOME from the dropdown menu and log back in, it just loads Unity.

Any ideas?  I'm running 11.10 on an older Toshiba Satellite A100.

I'm using Unity 3D right now. As for specs, it's a dual-core T5200 1.6GHz with the 945GM integrated graphics and 2GB RAM.

If I disable auto-login I can get it to load.  I've tried a couple of the auto-login tricks that I've read about but they don't work.  I've tried editing /etc/lightdm/lightdm.conf and it didn't work.  I don't remember exactly what else I tried.

Gnome-Shell is pretty picky and at least for me, easy to break.

I would first check your Xorg log, for me it's: /var/log/Xorg.0.log.

Also check your .xsession-errors in your home directory.

Xorg should tell you what is happening. That is standard behavior for Gnome-Shell, its likely the fallback session.

You can also check system info under System Settings -> System Info. Check the Graphics line under Summary to confirm the correct graphics card. Check Experience line under Graphics.

That's where I would start. I'm always messing with things and breaking my window environment :D

Report back if you figure it out.

Cheers!

theres a guide on how to make unity look like classic in issue 56 of full circle magazine
http://dl.fullcirclemagazine.org/issue56_en
(its in .pdf format btw) using  gnome-session-fallback


E: Cannot get debconf version. Is debconf installed? I installed Java 7 and later I got troubles with my system, I can't update anymore. The package system is broken.

Check if you are using third party repositories. If so disable them, since they are a common source of problems. Furthermore run the following command in a Terminal:

sudo dpkg --check  ==> no results, does not recognise command
sudo apt-get check

Reading package lists... Done
Building dependency tree
Reading state information... Done
You might want to run 'apt-get -f install' to correct these.
The following packages have unmet dependencies:
 libc6 : Depends: libgcc1 but it is not installed
         Depends: tzdata but it is not installed
E: Unmet dependencies. Try using -f.

apt-cache policy debconf

debconf:
  Installed: (none)
  Candidate: 1.5.42ubuntu1
  Version table:
     1.5.42ubuntu1 0
        500 http://archive.ubuntu.com/ubuntu/ precise/main i386 Packages

apt-get install -f

The following packages have unmet dependencies:
libc6: Depends: libc-bin (= 2.15-0ubuntu10.5) but 2.15-0ubuntu10.5 is installed
       Depends: libgcc1 but it is not installed
       Depends: tzdata but it is not installed

sudo apt-get install -f
Reading package lists... Done
Building dependency tree
Reading state information... Done
Correcting dependencies... Done
The following extra packages will be installed:
  apt-utils coreutils debconf debconf-i18n dpkg libacl1 libapt-inst1.4
  libapt-pkg4.12 libattr1 libbz2-1.0 libdb5.1 libgcc1 liblocale-gettext-perl
  liblzma5 libselinux1 libstdc++6 libtext-charwidth-perl libtext-iconv-perl
  libtext-wrapi18n-perl perl-base tar tzdata xz-utils zlib1g
Suggested packages:
  debconf-doc debconf-utils whiptail dialog gnome-utils
  libterm-readline-gnu-perl libgtk2-perl libnet-ldap-perl libqtgui4-perl
  libqtcore4-perl apt bzip2 ncompress xz-lzma
The following NEW packages will be installed:
  apt-utils coreutils debconf debconf-i18n dpkg libacl1 libapt-inst1.4
  libapt-pkg4.12 libattr1 libbz2-1.0 libdb5.1 libgcc1 liblocale-gettext-perl
  liblzma5 libselinux1 libstdc++6 libtext-charwidth-perl libtext-iconv-perl
  libtext-wrapi18n-perl perl-base tar tzdata xz-utils zlib1g
0 upgraded, 24 newly installed, 0 to remove and 0 not upgraded.
2 not fully installed or removed.
Need to get 0 B/9303 kB of archives.
After this operation, 29.7 MB of additional disk space will be used.
Do you want to continue [Y/n]? y
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
    LANGUAGE = (unset),
    LC_ALL = (unset),
    LC_TIME = "de_CH.UTF-8",
    LC_MONETARY = "de_CH.UTF-8",
    LC_ADDRESS = "de_CH.UTF-8",
    LC_TELEPHONE = "de_CH.UTF-8",
    LC_NAME = "de_CH.UTF-8",
    LC_MEASUREMENT = "de_CH.UTF-8",
    LC_IDENTIFICATION = "de_CH.UTF-8",
    LC_NUMERIC = "de_CH.UTF-8",
    LC_PAPER = "de_CH.UTF-8",
    LANG = "en_US.UTF-8"
    are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
locale: Cannot set LC_ALL to default locale: No such file or directory
E: Cannot get debconf version. Is debconf installed?
debconf: apt-extracttemplates failed: No such file or directory
dpkg: regarding .../libgcc1_1%3a4.6.3-1ubuntu5_i386.deb containing libgcc1, pre-dependency problem:
 libgcc1 pre-depends on multiarch-support
  multiarch-support is unpacked, but has never been configured.
dpkg: error processing /var/cache/apt/archives/libgcc1_1%3a4.6.3-1ubuntu5_i386.deb (--unpack):
 pre-dependency problem - not installing libgcc1
No apport report written because MaxReports is reached already
                                                              Errors were encountered while processing:
 /var/cache/apt/archives/libgcc1_1%3a4.6.3-1ubuntu5_i386.deb
E: Internal Error, No file name for libc6
W: Could not perform immediate configuration on 'multiarch-support:i386'. Please see man 5 apt.conf under APT::Immediate-Configure for details. (2)
E: Sub-process /usr/bin/dpkg returned an error code (1)

If coreutils is not installed, your system is seriously hosed.

Does /bin/date exist and work? If yes, “just” your package database is corrupt. In this case, restore /var/lib/dpkg/status from a backup – e.g. /var/lib/dpkg/status-old or one of the files /var/backups/dpkg.status.* (remember to uncompress the *.gz files).