Tag Archives: ubuntu

Ubuntu: Create own deb package

I'll show you how to create own deb package using modified nginx
1) we download nginx sources
2) we download some external nginx modules
3) we run

1
2
3
4
5
6
7
./configure --with-cc-opt="-static -static-libgcc" --with-ld-opt="-Bstatic" --prefix=/etc/nginx --sbin-path=/usr/sbin/nginx --conf-path=/etc/nginx/nginx.conf --error-log-path=/var/log/nginx/error.log --http-log-path=/var/log/nginx/access.log --pid-path=/var/run/nginx.pid \
    --lock-path=/var/run/nginx.lock --http-client-body-temp-path=/var/cache/nginx/client_temp --http-proxy-temp-path=/var/cache/nginx/proxy_temp --http-fastcgi-temp-path=/var/cache/nginx/fastcgi_temp \
    --http-uwsgi-temp-path=/var/cache/nginx/uwsgi_temp --http-scgi-temp-path=/var/cache/nginx/scgi_temp --user=nginx --group=nginx \
    --with-cc-opt='-g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Wformat-security -Wp,-D_FORTIFY_SOURCE=2' --with-ld-opt='-Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,--as-needed' \
    --add-module=./modules/naxsi/naxsi_src \
    --add-module=./modules/nginx-goodies-nginx-sticky-module-ng-bd312d586752 \
    --add-module=./modules/headers-more-nginx-module-0.25

4) make
after make we have out/nginx file so we could create own package using it

$ mkdir -p /opt/nginx/deb/nginx-ng
$ cd /opt/nginx/deb/nginx-ng
$ ls -1

1
2
3
4
DEBIAN
etc
usr
var

I downloaded original nginx deb and unpack it, after that I took DEBIAN, usr, var and etc folders from it
Continue reading Ubuntu: Create own deb package

Ubuntu: mosh

mosh (Mobile shell)

Ubuntu 14.04 LTS

1
2
3
4
5
6
7
8
9
10
11
12
echo >> /etc/apt/sources.list.d/mosh.list << EOF
deb http://ppa.launchpad.net/keithw/mosh/ubuntu trusty main
deb-src http://ppa.launchpad.net/keithw/mosh/ubuntu trusty main
EOF


apt-get update
get error about key(for example: 7BF6DFCD) copy it and insert
gpg --keyserver hkp://keys.gnupg.net --recv-keys 7BF6DFCD
gpg -a --export 7BF6DFCD | sudo apt-key add -

apt-get update
apt-get install mosh

OS X

1
brew install mosh

Usage

1
2
mosh example.com # it connects with current user on default ssh port(22)
mosh --ssh="ssh -p33" alter@example.com # it connects with user "alter" to port 33

Ubuntu: install kernel 3.16

1
wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v3.16-utopic/linux-headers-3.16.0-031600-generic_3.16.0-031600.201408031935_amd64.deb http://kernel.ubuntu.com/~kernel-ppa/mainline/v3.16-utopic/linux-headers-3.16.0-031600_3.16.0-031600.201408031935_all.deb http://kernel.ubuntu.com/~kernel-ppa/mainline/v3.16-utopic/linux-image-3.16.0-031600-generic_3.16.0-031600.201408031935_amd64.deb

dpkg -i *.deb
reboot

How to create bond interface

Don't use bond interfaces by ubuntu guid — it's a real bullshit.
If it works now, it doesn't matter that it will work after reboot if you have more then 1 bond interface.
You have to use debian-style bond interface settings.

Example of using with 8 interfaces combined by 4 interfaces to 2 bond interfaces.
/etc/network/interfaces

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
auto eth0
iface eth0 inet manual
    bond-master bond0

auto eth1
iface eth1 inet manual
    bond-master bond0

auto eth2
iface eth2 inet manual
    bond-master bond0

auto eth3
iface eth3 inet manual
    bond-master bond0

auto eth4
iface eth4 inet manual
    bond-master bond1

auto eth5
iface eth5 inet manual
    bond-master bond1

auto eth6
iface eth6 inet manual
    bond-master bond1

auto eth7
iface eth7 inet manual
    bond-master bond1

auto bond0
iface bond0 inet static
       address 192.168.1.11
       netmask 255.255.255.128
       network 192.168.1.0
       broadcast 192.168.1.127
       gateway 192.168.1.1
## following commented settings for auto generating resolve.conf
#       dns-nameservers 192.168.11.2 192.168.11.3
#       dns-search home.local work.local
#       dns-options timeout:1
       bond-mode 4
       bond-miimon 100
       bond-updelay 200
       bond-downdelay 200
       bond-lacp-rate 1
       bond-xmit_hash_policy layer3+4
       bond-max-bonds 2
       bond-slaves none

auto bond1
iface bond1 inet static
       address 8.8.8.8
       netmask 255.255.255.0
       network 8.8.8.0
       broadcast 8.8.8.255
       gateway 8.8.8.1
       bond-mode 4
       bond-miimon 100
       bond-updelay 200
       bond-downdelay 200
       bond-lacp-rate 1
       bond-xmit_hash_policy layer3+4
       bond-max-bonds 2
       bond-slaves none