Linux « Różności …

Różności …

23 grudnia 2013

cairo-dock autostart

Zaszufladkowany do: Linux — Tagi: — Jacek @ 16:09

follow the guide and you can specify in the command option which backend to use when running cairo-dock by specifying it as an option.

Run with OpenGL backend

cairo-dock -o

Run with Cario backend

cairo-dock -c

While the dock is running, right click on the dock. In the drop down menu there’s an option to start cairo-dock on startup. Select it. Done.

22 grudnia 2013

sudoers

Zaszufladkowany do: Linux — Tagi: — Jacek @ 12:30
jerome ALL=(ALL) NOPASSWD: ALL

It must be at the end of the file.  In my version, the last line of code  gives all users in the admin group root access but with a password  required.
If your line precedes this, then the effects are undone by  the last line of code because my user login is also a member  (unintentional) of admin.

14 grudnia 2013

ubuntu xscreensaver autostart

Zaszufladkowany do: Linux — Tagi: — Jacek @ 11:21
/etc/xdg/autostart/screensaver.desktop
[Desktop Entry]
Name=Screensaver
Type=Application
Exec=xscreensaver -nosplash

13 grudnia 2013

Ubuntu – ten things to do.

Zaszufladkowany do: Linux — Tagi: — Jacek @ 16:23
http://www.webupd8.org/2012/04/things-to-tweak-after-installing-ubuntu.html

sudo add-apt-repository ppa:indicator-multiload/stable-daily
sudo apt-get update
sudo apt-get install indicator-multiload

http://www.noobslab.com/2013/10/tweaksthings-to-do-after-install-of.html

sudo apt-get install unity-tweak-tool gnome-tweak-tool

To remove white dots, enter following commands in Terminal:
sudo xhost +SI:localuser:lightdm
sudo su lightdm -s /bin/bash
gsettings set com.canonical.unity-greeter draw-grid false

To remove guest account open Terminal and enter following command:
echo allow-guest=false | sudo tee -a /etc/lightdm/lightdm.conf.d/50-unity-greeter.conf

To remove Remote login open Terminal and enter following command:
echo greeter-show-remote-login=false | sudo tee -a /etc/lightdm/lightdm.conf.d/50-unity-greeter.conf

Enter following command in terminal to disable overlay scrollbar:
gsettings set com.canonical.desktop.interface scrollbar-mode normal

If you want to get back overlay bar, enter following command:
gsettings reset com.canonical.desktop.interface scrollbar-mode

Enter following commands to disable crash reports:
sudo gedit /etc/default/apport
Now text file will open, In the last line you will see “enabled=1” change it to “enabled=0“. Save and close file.
Now enter following command in terminal to stop apport service:
sudo service apport stop

Enter following command to move buttons to right:
gsettings set org.gnome.desktop.wm.preferences button-layout ‘:minimize,maximize,close’

sudo apt-get install qbittorrent

Enter following commands to install plugins for Rhythmbox
sudo add-apt-repository ppa:fossfreedom/rhythmbox-plugins
sudo apt-get update
sudo apt-get install rhythmbox-plugin-complete

There are some Restricted extras in Ubuntu which can’t be install while installation of Ubuntu by default but you can install these Restricted extras by yourself. Restricted mp3 playback and decoding, support for various formats, fonts, java, flash plugin, lame, dvd playback.
sudo apt-get install ubuntu-restricted-extras

sudo apt-get install p7zip-rar p7zip-full unace unrar zip unzip sharutils rar uudeview mpack arj cabextract file-roller

sudo apt-get remove gnome-screensaver
sudo apt-get install gnome-core

To Reset Unity:

sudo apt-get install dconf-tools
dconf reset -f /org/compiz/
setsid unity
unity –reset-icons

10 grudnia 2013

MC shortcuts

Zaszufladkowany do: Linux — Tagi: — Jacek @ 22:41

Midnight Commander Keyboard Shortcuts

ALT + C – cd do katalogu

CTRL+o – podgląd teminala
ESC + TAB – autouzupełnianie komend
CTRL + strzałka w górę/dół – przeglądanie historii
ALT+s – incsearch

CTRL + \ – lista szybkich katalogów

Ctrl + / i potem / – katalogi

CTRL + M – kopiuje daną nazwę do linii komend

Common Functions
Ctrl + r Refresh active panel
Ctrl + x c Opens chmod dialog for marked file
Ctrl + x o Opens chown dialog for marked file
Alt + ? Opens search dialog
Ctrl-x a Open VFS list. If a ftp session times out, you can use this to free the open vfs so you can log in again.
Panel Functions
TAB Switch focus between left and right panel
Insert Marks or removes mark on file(s)
Alt + g Marks first file or directory in active panel
Alt + r Marks middle file or directory in active panel
Alt + j Marks last file or directory in active panel
Alt + s Incremental search
Ctrl + / Look for filename given in last line of active panel (not whole screen), and jumps on first file
* Marks removes marking for all files in active panel (not directories)
+ (Plus) Brings up the input box where it can be given regular expression. All files with names that fill condition(s) in regular expression will be marked.
\ (Backslash) Remove marking for more data (opposite to + )
Shell Functions
Alt + Enter Copies selected filename in command line
Ctrl + Shft + Enter Copies full path of selected file in the command line
Alt + H Shows command line history
Function Keys
F1 Help
F2 Opens user menu
F3 View selected file content
F4 Opens file in internal text editor
F5 Copies selected file. Default is to another panel, but it asks first.
F6 Moving file. Default is to another panel, but it asks first.
F7 Make directory.
F8 Delete file or directory.
F9 Opens main menu at the top of the screen.
F10 Ends current action; editor, viewer, dialog window or ends mc program.

24 listopada 2013

mkisofs

Zaszufladkowany do: Linux — Tagi: — Jacek @ 21:19

mkisofs -o nazwa.iso /katalog

22 listopada 2013

mount iso

Zaszufladkowany do: Linux — Tagi: — Jacek @ 18:55

mount -o loop disk1.iso /mnt/disk

20 listopada 2013

LVM – LINUX (logical volume manager)

Zaszufladkowany do: Linux — Tagi: — Jacek @ 20:16

vgscan

lvmdiskscan

lvdisplay

parted /dev/sda print

Podmontowanie:
vgchange -a y
mount /dev/volumegroup/logicalvolume /mnt/somewhere

keyboard layout, klawiatura polska

Zaszufladkowany do: Linux — Tagi: — Jacek @ 18:23

setxkbmap pl

18 listopada 2013

iptables

Zaszufladkowany do: Linux — Tagi: — Jacek @ 20:08

service iptables stop
service iptables start
service iptables save
iptables-save > /etc/sysconfig/iptables

iptables -I INPUT 5 -p tcp –dport 443 -j ACCEPT
iptables -L -n –line-numbers

14 listopada 2013

Oracle 11g installation on Centos 6.4

Zaszufladkowany do: Bazy danych,Linux,Oracle — Tagi: , — Jacek @ 09:55

http://www.tecmint.com/oracle-database-11g-release-2-installation-in-linux/

selinux

Zaszufladkowany do: Linux — Tagi: — Jacek @ 07:25

czasowe wyłączenie
setenforce 0
setenforce 1

lub

echo 0 >/selinux/enforce
newrole -r sysadm_r
echo 1 >/selinux/enforce

cat /selinux/enforce

SSH key authentication problem:
Turns out that SELinux was interfering with the key authentication because there was no security context for the newly created ~/.ssh
directory.

The fix:
restorecon -R -v /root/.ssh

13 listopada 2013

SSH tunel

Zaszufladkowany do: Linux — Tagi: — Jacek @ 19:33

http://jakilinux.org/aplikacje/sztuczki-z-ssh-2-tunele/#

XFCE on CentOS

Zaszufladkowany do: Linux — Tagi: — Jacek @ 15:32

Źródło/Source:

http://blog.inticol.com/2012/10/installing-xfce-on-centos-6.html

After a minimal install of CentOS 6.3, the following steps are needed to install XFCE
  • Make sure your machine can connect to the internet
  • Install the wget package, used to download other files from the internet.
    yum install wget
  • Download and install the epel-release package from the EPEL repository, 6.8 is the version at this date but it can be different later, check the name of the file.
    wget http://download.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
    rpm -ivh epel-release-6.8.noarch.rpm
  • The following command install all the xfce packages, the version is 4.8.3 at this time.
    yum groupinstall Xfce
  • The following command install some fonts needed for the graphical login process in CentOS, if they are not present, you will see squares instead in the login screen.
    yum install xorg-x11-fonts-Type1 xorg-x11-fonts-misc
  • Test your installation by going to runlevel 5
    /sbin/telinit 5
  • Another option for testing/starting the graphical desktop is:
    startxfce4
  • If everything works fine, remember to update the default startup level to 5 in /etc/inittab

11 listopada 2013

ls color directory blue

Zaszufladkowany do: Linux — Tagi: — Jacek @ 22:26

/etc/DIR_COLORS

cp /etc/DIR_COLORS ~/.dircolors

To customized colors you must use special string combination:
FILE-TYPE Attribute codes: Text color codes:Background color codes

Where,

  • FILE-TYPE: is file type like DIR (for directories)
  • Attribute codes:
    • 00=none
    • 01=bold
    • 04=underscore
    • 05=blink
    • 07=reverse
    • 08=concealed
  • Text color codes:
    • 30=black
    • 31=red
    • 32=green
    • 33=yellow
    • 34=blue
    • 35=magenta
    • 36=cyan
    • 37=white
  • Background color codes:
    • 40=black
    • 41=red
    • 42=green
    • 43=yellow
    • 44=blue
    • 45=magenta
    • 46=cyan
    • 47=white

For example to define Bold Blue color for DIR file type, entry should look as follows:
DIR 01;34
http://www.cyberciti.biz/tips/where-is-color-of-ls-command-defined.html

3 listopada 2013

linux vpn

Zaszufladkowany do: Linux — Tagi: — Jacek @ 18:28

vpnc – -natt-mode none vpnc.conf

vpnc.conf:
IPSec gateway 111.111.111.111
IPSec ID login_vpn
IPSec secret haslo
Xauth username login

openvpn – -config openvpn.ovpn

openvpn.conf
dev tun
tls-client
remote 111.111.111.111 7777
# If redirect-gateway is enabled, the client will redirect it’s
# default network gateway through the VPN.
# It means the VPN connection will firstly connect to the VPN Server
# and then to the internet.
# (Please refer to the manual of OpenVPN for more information.)
#redirect-gateway
pull
proto udp
script-security 2
ca ca.crt
comp-lzo
reneg-sec 0
auth-user-pass

2 listopada 2013

SSH authorized_keys – keys authenitcation

Zaszufladkowany do: Linux — Tagi: — Jacek @ 18:54

You should never add the file with the contents starting with -----BEGIN RSA PRIVATE KEY-----, that’s your private key. You must put the public key in the ~/.ssh/authorized_keys file.

This public key has the .pub extension when generated using ssh-keygen and the contents of the public key begins with ssh-rsa AAAA3B

The permissions of ~/.ssh on the server should be 700. ~/.ssh/authorized_keys on the server are supposed to be set to 600. The permissions of the key on the client-side should be 600.

If the private key was not protected with a password and you put it on the server, I recommend you generating a new one using:

ssh-keygen -t rsa

You can skip this if you’re fully sure that nobody can recover the deleted private key on the server.

If this does not help, run ssh with options for more verbosity:

ssh -vvv user@example.com

On the server side, you can review /var/log/auth.log for details.

23 października 2013

Zaszufladkowany do: Linux — Tagi: — Jacek @ 18:08

Instalacja zwykłych RPMów

Mamy RPMa i chcemy go zainstalować. Używamy komendy:

rpm -ihv nazwa_pakietu.rpm
rpm -Uhv nazwa_pakietu.rpm
rpm -Fhv nazwa_pakietu.rpm

Parametr -ihv spowoduje zainstalowanie pakietu jeżeli spełnione są wszystkie wymagania, jeżeli nie wyświetlone zostaną brakujące elementy lub inne błędy na jakie trafił instalator. Wersja -Uhv różni się tym od -ihv tym że jeżeli mamy starszą wersję danego programu to zostanie on zaktualizowany (ihv zainstalowałby RPMa jako 2 wersję), jeżeli nie ma to zostanie on standardowo zainstalowany. Wersja -Fhv tylko aktualizuje. Jeżeli nie mamy zainstalowanej starszej wersji to RPM nie zostanie zainstalowany. Usunięcie RPMa przeprowadzamy tak:

rpm -e nazwa_pakietu.rpm
Polecenie Opis
rpm -qip nazwa_pakietu.rpm Wyświetlone zostaną dane o pakiecie takie jak opis, autor, strona projektu i inne.
rpm -q nazwa_aplikacji To polecenie zwróci numer zainstalowanej wersji aplikacji jeżeli oczywiście jest zainstalowany
rpm -qa Wyświetla listę wszystkich zainstalowanych RPMów wraz z numerem wersji
rpm -qai Wyświetla szczegółowe opisy dla każdego zainstalowanego RPMa
rpm -qf /folder/x/plik_lub_folder Określa nazwę pakietu, którego elementem jest wskazany plik/katalog

RPMy źródłowe

Komenda jest następująca:

rpmbuild –rebuild nazwa_pakietu.src.rpm

Odpalony zostanie pakiet a zawarty w nik kod źródłowy będzie kompilowany. Do tego potrzebne są odpowiednie biblioteki i w przypadku bardziej złożonych programów będziemy musieli je ściągnąć i zainstalować. Instalator powie nam czego brakuje.
Wynik:
/root/rpmbuild/RPMS/x86_64

Źródło: http://www.linux.rk.edu.pl/w/p/obsluga-pakietw-rpm/

Remote Display With the X – Window System

Zaszufladkowany do: Linux — Tagi: — Jacek @ 09:58

ssh -X login@haslo

http://www.softprayog.in/troubleshooting/x-window-remote-display

14 października 2013

linux cloning (network interfaces problem) (eth0)

Zaszufladkowany do: Linux — Tagi: — Jacek @ 20:09

For years we’ve used bash scripting to ensure that all of our server configurations are standardised, so that we can expect servers with the same role to have the exact same configuration profile and exhibit the exact same behaviour. We’re in the process of moving to Chef but we’re not quite there yet. Recently we decided to redesign our network architecture with a higher level of focus around High Availability. This new design introduces Percona XtraDB Cluster and we’re writing our installation and configuration scripts to ensure that our new cluster boxes are both tuned and standardised.

We have base template linux VM’s in both VMWare and Oracle VirtualBox, and also templates that are specific to server roles such as web servers, HAproxy servers or MySQL Cluster servers. If we need to test a new configuration, or add a new node to the cluster, we just clone the appropriate template add some minor configuration and we’re good.

However if you clone a VMWare or Oracle VirtualBox VM, you’ll notice that it kills your network interfaces throwing errors like the one listed below:

#ifup eth0
Device eth0 does not seem to be present, delaying initialisation

What’s happening here is that when you clone your VM, VirtualBox and VMWare apply a new MAC Address to your network interfaces but they don’t update the linux configuration files to mirror these changes and so the kernel doesn’t firstly can’t find or start the interface that matches it’s configuration (with the old MAC Address) and it finds a new interface (the new MAC Address) that it has no configuration information for. The result is that only your networking service can only start the loopback networking interface and eth0 is dead.

So here’s how we fix it:

  1. Remove the kernel’s networking interface rules file so that it can be regenerated
    # rm -f /etc/udev/rules.d/70-persistent-net.rules
  2. Restart the VM
    # reboot
  3. UPDATE your interface configuration file
    # vim /etc/sysconfig/networking/devices/ifcfg-eth0

    Remove the MACADDR entry or update it to the new MACADDR for the interface (listed in this file: /etc/udev/rules.d/70-persistent-net.rules).

    Remove the UUID entry

    Save and exit the file

  4. Restart the networking service
    # service network restart

SOURCE:

http://www.envision-systems.com.au/blog/2012/09/21/fix-eth0-network-interface-when-cloning-redhat-centos-or-scientific-virtual-machines-using-oracle-virtualbox-or-vmware/

« Nowsze wpisyStarsze wpisy »

Strona startowa: www.jaceksen.pl