Показаны сообщения с ярлыком ubuntu. Показать все сообщения
Показаны сообщения с ярлыком ubuntu. Показать все сообщения

пятница, 24 апреля 2015 г.

Download all packages from Ubuntu repository

To download all packages from particular repository we can use "Packages" file. It contains meta information about every packages in repository.

1) Get particualr "Packages" file.

ls /var/lib/apt/lists/*_Packages

2) Use "apt-get download" to get all packages

for i in `grep "Package:" Packages | awk '{print $2}'`; do ${i}_* || apt-get download $i; done

It will download all deb files to current directory.

понедельник, 3 июня 2013 г.

How to upload files thru rdp from linux

If you want to copy files from Linux to remote Windows machine you could do it thru RDP (rdesktop utility).

rdesktop -g 90% -r disk:mydir=/home/user/mydir 10.0.0.2

It will open graphical RDP session and you could see your shared folder from "My Computer" page.

вторник, 5 февраля 2013 г.

Ubuntu splits all after 127.0.0.1 in dns-nameservers flag

Ubuntu manages local DNS settings by "resolvconf" package and settings could be set in /etc/network/interfaces file.

For example
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo
  iface lo inet loopback

# The primary network interface
auto eth0
iface eth0 inet static
  address 192.168.122.20
  netmask 255.255.255.0
  gateway 192.168.122.1
  dns-nameservers 127.0.0.1 8.8.8.8
  dns-search local.lan cloud.lan
In detail "man interfaces" or "man resolvconf".


I have local dns server on 127.0.0.1. And i've plunged in strange behavior with "dns-nameservers" flag.

If i set
dns-nameservers 8.8.8.8 127.0.0.1
It works like a charm.
cat /etc/resolv.conf
# Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)
#     DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN
nameserver 8.8.8.8
nameserver 127.0.0.1
search local.lan cloud.lan

But if I put 127.0.0.1 as first nameserver
dns-nameservers 127.0.0.1 8.8.8.8
There is no nameservers after 127.0.0.1 ...
cat /etc/resolv.conf 
# Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)
#     DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN
nameserver 127.0.0.1
search local.lan cloud.lan
But I want to be able to use local dns as preferable plus other public nameserver.

What i've found here /etc/resolvconf/update.d/libc (this file related to resolvconf package)
...
# Set TRUNCATE_NAMESERVER_LIST_AFTER_LOOPBACK_ADDRESS=no
# to allow additional nameserver addresses to be listed in
# resolv.conf after an initial loopback address 127.* or ::1.

...

SOLUTION:
echo "TRUNCATE_NAMESERVER_LIST_AFTER_LOOPBACK_ADDRESS=no" >> /etc/default/resolvconf

Used ubuntu 12.04 LTS




понедельник, 7 ноября 2011 г.

Configuring Openstack images to write in console.log

If you want to see booting process and kernel output in openstack console.log file you need to modify kernel params. By default "quiet splash" in kernel parameters. You need to delete it  and add "console=ttyS0". It will output to first serial port console. By default serial port 1 is set in libvirt xml files.


<console type='file'>
  <source path='/mnt/drbd0/nova/instances/instance-00000044/console.log'/>
  <target type='serial' port='1'/>
</console>


Ubuntu:
Edit /etc/default/grub:
....
GRUB_CMDLINE_LINUX_DEFAULT="console=ttyS0"
...
GRUB_TERMINAL=console
...
Then type "update-grub" to generate new grub.cfg. Tested on Ubuntu 11.04, 11.10

Fedora:
Edit /etc/grub.conf. Remove "quiet spalsh" params and add "console=ttyS0". Tested on fedora 14, 15.

Tested on libvirt-0.9.1-1.fc15.x86_64

To see what write to file
du -h /var/lib/nova/instances/instance-00000015/console.log

Add pci hot-plug in images for Openstack.

We use Openstack Diablo release on fedora. To fully use openstack nova-volume service you need to add PCI hot-plug feature in guest system. It will allow to attach and detach volumes without reboot. Linux Kernels support this feature with acpiphp module.

Ubuntu:
We need to load acpiphp module. To load it automatically after reboot
 echo "acpiphp" >> /etc/modules
Tested on Ubuntu 11.04, 11.10.

Fedora:
I have use libvirt VMs and by default there is acpi=off kernel parameter. To allow pci hotplugging remove acpi=off from kernel parameters by editing /etc/grub.conf. Tested on fedora 14, 15

CentOS:
Simplest solution it is add "modprobe acpiphp" string in /etc/rc.local. Tested on CentOS 5.6
echo "modprobe acpiphp" >> /etc/rc.local
How to attach volume in OpenStack:
To create 1GB volume with euca2ools and attach it to instance:
euca-create-volume -s 1 -z nova
euca-attach-volume -i i-00000043 -d /dev/vdb vol-00000003 
To see disk in guest system:
fdisk -l 
All works good, if you can attach, detach and again attach volume to instance.