środa, 12 kwietnia 2017

E: Can not write log, openpty() failed (/dev/pts not mounted?)

W: Can not write log, openpty() failed (/dev/pts not mounted?)


sudo mount --bind /dev ~/chroot/chroot-amd64-ubuntu10.04/dev
sudo mount --bind /dev/pts ~/chroot/chroot-amd64-ubuntu10.04/dev/pts
sudo mount --bind /proc ~/chroot/chroot-amd64-ubuntu10.04/proc/
sudo mount --bind /sys ~/chroot/chroot-amd64-ubuntu10.04/sys
Source: https://docs.google.com/document/d/186YFzm3vKggFvvdzATU2X6PioqFNaQnyqLsOAaI-IYA/edit

niedziela, 9 kwietnia 2017

How to create a new normal user with sudo permission

How to create a new normal user with sudo permission?

 This procedure can be used in any Linux distro to add a normal user. That includes ubuntu, Linux mint, or even Centos

useradd -m username

# -m creates a home directory for the user.
# for more config option while adding user read
man useradd
## :)
Set password using passwd in order to login

passwd username


Add user to sudores so that we can use “sudo” to do administrative actions.

usermod -a -G sudo username


The option -a means to add and ‘-G sudo’ means to add the user to the sudo group. If you want to know more about the usermod command, issue man usermod command to know more about usermod

piątek, 7 kwietnia 2017

How to fix a locale setting warning from Perl?

When I run perl, I get the warning:

When I run apt, I get the warning:

When I run aptitude, I get the warning:


perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
    LANGUAGE = (unset),
    LC_ALL = (unset),
    LANG = "en_US.UTF-8"
are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").

instead of installing the locale, You can also change the locale. On my Ubuntu box, this is done for one user by editing ~/.pam_environmentChange the variables were es_US.UTF-8 or similar to en_US.UTF-8. or similar requested – Janus Troelsen Jun 8 '14 at 12:34 &  f1vefour Feb 18 '15 at 13:12

Use:
export LANGUAGE=en_US.UTF-8
export LC_ALL=en_US.UTF-8
export LANG=en_US.UTF-8
export LC_TYPE=en_US.UTF-8
It works for Debian. I don't know why - but locale-gen had not results.
(add) On Debian, local-gen only processes locales that are uncommented in /etc/local.gen. You may need to do echo en_US UTF-8 >> /etc/locale.gen first. – akhmed Nov 24 '15 at 2:45

Important! It's a temporary solution. It has to be run for each session.
#pseudoPermament I just put it into my .bashrc file. – Anirudh Ramanathan Jun 8 '14 at 16:08 
Polskie zasoby ustawiania locale:7

Konfiguracja Locales w Ubuntu


Spam atraction: 
$ locale
locale: Cannot set LC_ALL to default locale: No such file or directory
LANG=en_US.UTF-8
LANGUAGE=
LC_CTYPE=en_US.UTF-8
LC_NUMERIC=ru_RU.UTF-8
LC_TIME=ru_RU.UTF-8
LC_COLLATE="en_US.UTF-8"
LC_MONETARY=ru_RU.UTF-8
LC_MESSAGES="en_US.UTF-8"
LC_PAPER=ru_RU.UTF-8
LC_NAME=ru_RU.UTF-8
LC_ADDRESS=ru_RU.UTF-8
LC_TELEPHONE=ru_RU.UTF-8
LC_MEASUREMENT=ru_RU.UTF-8
LC_IDENTIFICATION=ru_RU.UTF-8
LC_ALL=

$ sudo su

# export LANGUAGE=en_US.UTF-8
# export LANG=en_US.UTF-8
# export LC_ALL=en_US.UTF-8

# locale-gen en_US.UTF-8
Generating locales...
  en_US.UTF-8... up-to-date
Generation complete.

# dpkg-reconfigure locales
Generating locales...
  en_AG.UTF-8... done
  en_AU.UTF-8... done
  en_BW.UTF-8... done
  en_CA.UTF-8... done
  en_DK.UTF-8... done
  en_GB.UTF-8... done
  en_HK.UTF-8... done
  en_IE.UTF-8... done
  en_IN.UTF-8... done
  en_NG.UTF-8... done
  en_NZ.UTF-8... done
  en_PH.UTF-8... done
  en_SG.UTF-8... done
  en_US.UTF-8... up-to-date
  en_ZA.UTF-8... done
  en_ZM.UTF-8... done
  en_ZW.UTF-8... done
Generation complete.

# exit

$ locale
LANG=en_US.UTF-8
LANGUAGE=en_US.UTF-8
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_PAPER="en_US.UTF-8"
LC_NAME="en_US.UTF-8"
LC_ADDRESS="en_US.UTF-8"
LC_TELEPHONE="en_US.UTF-8"
LC_MEASUREMENT="en_US.UTF-8"
LC_IDENTIFICATION="en_US.UTF-8"
LC_ALL=en_US.UTF-8
Like stack mee to so like Me to :) SOURCE: http://stackoverflow.com/questions/2499794/how-to-fix-a-locale-setting-warning-from-perl

root@host:~#locale-gen en_GB.UTF-8
root@host:~#localectl set-locale LANG=en_GB.UTF-8,LC_ALL=en_GB.UTF-8