Monday, October 21, 2019

hard drive - Why do Disk utility and Gparted show different information for the same hdd(s)?




Gparted and Disks utility give me different sizes for my hard drive and its partitions. Is there a reason, for both programs, to list different information or is it an error?



GParted & Terminal output: sudo lsblk -o NAME,FSTYPE,SIZE,MOUNTPOINT,LABEL




dev/sda = 298.1 Gib
/dev/sda3 = 191.40 GiB
/dev/sda4 = 92 GiB
/dev/sda5 = 88.40 GiB
/dev/sda6 = 3.60 GiB




Disks Utility output





dev/sdb = 320 Gib
/dev/sda3 = 206 GiB
/dev/sda4 = 99 GiB
/dev/sda5 = 95 GiB
/dev/sda6 = 3.9 GiB




The result shown by sudo lsblk -o NAME,FSTYPE,SIZE,MOUNTPOINT,LABEL performs calculations using the binary prefix i.e. multiples of 1024 (which is 210). So 500107862016 bytes would be equal to 465.76 GB or approximately 466 GB. (You can use -b switch to print in bytes instead of human readable as sudo lsblk -b -o NAME,FSTYPE,SIZE,MOUNTPOINT,LABEL.)



Calculation:

500107862016 bytes = (500107862016 / (1024 ^ 3)) GB = 465.76 GB



While Disks Utility uses decimal prefix for calculation so expressed as multiples of 1000. So 500107862016 bytes here would mean 500.11 GB or 500 GB approx.



Calculation:

500107862016 bytes = (500107862016 / (1000 ^ 3)) GB = 500.11 GB

12.04 - How to install/upgrade Chromium offline?

I am running Ubuntu 12.04.2 LTS, in which I also use Chromium browser.
Now, I always install/upgrade files on Ubuntu in offline mode. Though, I never had any problem with any application ever, I never could do so with Chromium.



Every time, I try to do, it says that installation will break. I have all dependencies downloaded and none of them are being installed. I have even uninstalled previous version of Chromium, but no use. The result stays same. But, if I'll try to do so online, then Ubuntu downloads same files and then install/upgrade Chromium.



Can't one do so in offline mode?



UPDATE [14.02.2014]: Ok,I think there is some problem with updating browsers offline. I was not able to do so with Firefox 27.0 release, with similar errors, though, all other updates are running perfectly, even update from 12.04. to 12.04.4.

apt-get update fails (oom killer executed on /usr/lib/apt/methods/https memory hog)

I am repeatedly seeing the apt-get update/install process leading to a situation in which /usr/lib/apt/methods/https eats up the system's memory and as a result the OS oom killer is triggered. The OOM killer kills off the https process and the apt-get operation fails.


I'm running on EC2 t2.smalls and t2.mediums.


$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 14.04.2 LTS
Release: 14.04
Codename: trusty
$ uname -a
Linux stage-app1 3.13.0-48-generic #80-Ubuntu SMP Thu Mar 12 11:16:15 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux

Sunday, October 20, 2019

networking - Dual NIC not working

I am running Ubuntu Server 16.04 with two on-board NICs. Ubuntu sees both cards, but both eth0 and eth1 will only pass traffic out of one physical interface, although they are configured separately (I think). Information is below:


lshw -C network
*-network
description: Ethernet interface
product: 82579LM Gigabit Network Connection
vendor: Intel Corporation
physical id: 19
bus info: pci@0000:00:19.0
logical name: eth0
version: 04
serial: 54:be:f7:65:9a:9b
size: 1Gbit/s
capacity: 1Gbit/s
width: 32 bits
clock: 33MHz
capabilities: pm msi bus_master cap_list ethernet physical tp 10bt 10bt-fd 100bt 100bt-fd 1000bt-fd autonegotiation
configuration: autonegotiation=on broadcast=yes driver=e1000e driverversion=3.2.6-k duplex=full firmware=0.13-4 ip=172.22.1.112 latency=0 link=yes multicast=yes port=twisted pair speed=1Gbit/s
resources: irq:26 memory:f7e00000-f7e1ffff memory:f7e39000-f7e39fff ioport:f080(size=32)
*-network
description: Ethernet interface
product: 82574L Gigabit Network Connection
vendor: Intel Corporation
physical id: 0
bus info: pci@0000:02:00.0
logical name: eth1
version: 00
serial: 54:be:f7:65:9a:9c
size: 1Gbit/s
capacity: 1Gbit/s
width: 32 bits
clock: 33MHz
capabilities: pm msi pciexpress msix bus_master cap_list ethernet physical tp 10bt 10bt-fd 100bt 100bt-fd 1000bt-fd autonegotiation
configuration: autonegotiation=on broadcast=yes driver=e1000e driverversion=3.2.6-k duplex=full firmware=2.1-3 ip=172.22.1.113 latency=0 link=yes multicast=yes port=twisted pair speed=1Gbit/s
resources: irq:18 memory:f7d00000-f7d1ffff ioport:e000(size=32) memory:f7d20000-f7d23fff

/etc/network/interfaces:


# The loopback network interface
auto lo
iface lo inet loopback
# The primary network interface
auto eth0
iface eth0 inet dhcp
# The secondary network interface
auto eth1
iface eth1 inet dhcp

Thank you for any help!


ifconfig:


eth0      Link encap:Ethernet  HWaddr 54:be:f7:65:9a:9b
inet addr:172.22.1.112 Bcast:172.22.1.255 Mask:255.255.255.0
inet6 addr: fe80::56be:f7ff:fe65:9a9b/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:61 errors:0 dropped:0 overruns:0 frame:0
TX packets:11 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:5880 (5.8 KB) TX bytes:1436 (1.4 KB)
Interrupt:20 Memory:f7e00000-f7e20000
eth1 Link encap:Ethernet HWaddr 54:be:f7:65:9a:9c
inet addr:172.22.1.113 Bcast:172.22.1.255 Mask:255.255.255.0
inet6 addr: fe80::56be:f7ff:fe65:9a9c/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:1093 errors:0 dropped:0 overruns:0 frame:0
TX packets:575 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:88205 (88.2 KB) TX bytes:42753 (42.7 KB)
Interrupt:18 Memory:f7d00000-f7d20000
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:160 errors:0 dropped:0 overruns:0 frame:0
TX packets:160 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1
RX bytes:11840 (11.8 KB) TX bytes:11840 (11.8 KB)

route -n:


Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
0.0.0.0 172.22.1.1 0.0.0.0 UG 0 0 0 eth1
172.22.1.0 0.0.0.0 255.255.255.0 U 0 0 0 eth1
172.22.1.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0

route -n with eth0 unplugged. Cannot access either ip address.


Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
0.0.0.0 172.22.1.1 0.0.0.0 UG 0 0 0 eth0
172.22.1.0 0.0.0.0 255.255.255.0 U 0 0 0 eth1
172.22.1.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0


Script with eth0 disconnected
eth0 Link encap:Ethernet HWaddr 54:be:f7:65:9a:9b
inet addr:172.22.1.112 Bcast:172.22.1.255 Mask:255.255.255.0
inet6 addr: fe80::56be:f7ff:fe65:9a9b/64 Scope:Link
UP BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:28527 errors:0 dropped:0 overruns:0 frame:0
TX packets:10 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:2202058 (2.2 MB) TX bytes:1372 (1.3 KB)
Interrupt:20 Memory:f7e00000-f7e20000
eth1 Link encap:Ethernet HWaddr 54:be:f7:65:9a:9c
inet addr:172.22.1.113 Bcast:172.22.1.255 Mask:255.255.255.0
inet6 addr: fe80::56be:f7ff:fe65:9a9c/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:31516 errors:0 dropped:0 overruns:0 frame:0
TX packets:1730 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:6125004 (6.1 MB) TX bytes:155950 (155.9 KB)
Interrupt:18 Memory:f7d00000-f7d20000
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:160 errors:0 dropped:0 overruns:0 frame:0
TX packets:160 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1
RX bytes:11840 (11.8 KB) TX bytes:11840 (11.8 KB)
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
0.0.0.0 172.22.1.1 0.0.0.0 UG 0 0 0 eth1
172.22.1.0 0.0.0.0 255.255.255.0 U 0 0 0 eth1
172.22.1.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data.
64 bytes from 8.8.8.8: icmp_seq=1 ttl=58 time=27.4 ms
64 bytes from 8.8.8.8: icmp_seq=2 ttl=58 time=25.8 ms
64 bytes from 8.8.8.8: icmp_seq=3 ttl=58 time=27.8 ms
64 bytes from 8.8.8.8: icmp_seq=4 ttl=58 time=26.6 ms
64 bytes from 8.8.8.8: icmp_seq=5 ttl=58 time=26.6 ms
--- 8.8.8.8 ping statistics ---
5 packets transmitted, 5 received, 0% packet loss, time 4007ms
rtt min/avg/max/mdev = 25.818/26.897/27.860/0.733 ms
Script with eth1 disconnected
eth0 Link encap:Ethernet HWaddr 54:be:f7:65:9a:9b
inet addr:172.22.1.112 Bcast:172.22.1.255 Mask:255.255.255.0
inet6 addr: fe80::56be:f7ff:fe65:9a9b/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:28540 errors:0 dropped:0 overruns:0 frame:0
TX packets:10 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:2202968 (2.2 MB) TX bytes:1372 (1.3 KB)
Interrupt:20 Memory:f7e00000-f7e20000
eth1 Link encap:Ethernet HWaddr 54:be:f7:65:9a:9c
inet addr:172.22.1.113 Bcast:172.22.1.255 Mask:255.255.255.0
inet6 addr: fe80::56be:f7ff:fe65:9a9c/64 Scope:Link
UP BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:31528 errors:0 dropped:0 overruns:0 frame:0
TX packets:1735 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:6125988 (6.1 MB) TX bytes:156460 (156.4 KB)
Interrupt:18 Memory:f7d00000-f7d20000
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:160 errors:0 dropped:0 overruns:0 frame:0
TX packets:160 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1
RX bytes:11840 (11.8 KB) TX bytes:11840 (11.8 KB)
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
0.0.0.0 172.22.1.1 0.0.0.0 UG 0 0 0 eth1
172.22.1.0 0.0.0.0 255.255.255.0 U 0 0 0 eth1
172.22.1.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data.
--- 8.8.8.8 ping statistics ---
5 packets transmitted, 0 received, 100% packet loss, time 4031ms

Transmission Remote GUI setup hangs on DHT attempting to bootstrap

I'm trying to install transmission on Ubuntu Server 12.04. But I'm running into few issues, The main one now is that the setup seems to hang on:



DHT Attempting bootstrap from dht.transmissionbt.com (tr-dht.c:247)


Here is the guide I have followed: link.




Installing the transmission daemon went fine, But when I tried to configuring it, It gave me the above issue.



The command is: transmission-daemon -f -t -u your_username -v your_password -w /path/to/downloaded/torrents -g /etc/transmission-daemon/



At first I used '&' symbol in the password and that messed some things up. I restarted the server and then used the same command with a password without '&' it goes through.
The command does hang for a while on the line



transmission-daemon requiring authentication (daemon.c:508)



but then after say 20 seconds or so, It goes on to the line



DHT Attempting bootstrap from dht.transmissionbt.com (tr-dht.c:247)


It hangs there for over 10 min. The next line should be something about starting port forwarding.



When I look for the files that the command should have created, They look fine, Username is set, Not sure where to find the password though.



Still I cannot continue, And if I quit the command with Ctrl+C, when I run the remote GUI, It doesn't connect (it doesn't say more than that).




Any idea what is wrong? Any idea on how to go about figuring this out?



Sidenote: when running transmission-daemon -f -t -u your_username -v your_password -w /path/to/downloaded/torrents -g /etc/transmission-daemon/ for the first time, it said it failed to allocate the correct size to something UDP, and said to edit a file to specify the larger size. I did so, rebooted, and that issue was gone once re-trying.



Not sure if this helps but this is what comes after executing the command:



[22:31:21.566] Transmission 2.51 (13280) started (session.c:718)

[22:31:21.567] RPC Server Adding address to whitelist: * (rpc-server.c:803)


[22:31:21.567] RPC Server Serving RPC and Web requests on port 127.0.0.1:9091/transmission/ (rpc-server.c:997)

[22:31:21.568] RPC Server Whitelist enabled (rpc-server.c:1001)

[22:31:21.568] RPC Server Password required (rpc-server.c:1004)

[22:31:21.568] Port Forwarding Stopped (port-forwarding.c:181)

[22:31:21.569] DHT Generating new id (tr-dht.c:309)


[22:31:21.569] Using settings from "/etc/transmission-daemon/" (daemon.c:488)

[22:31:21.569] Saved "/etc/transmission-daemon/settings.json" (bencode.c:1731)

[22:31:21.570] transmission-daemon requiring authentication (daemon.c:508)

[22:32:13.576] DHT Attempting bootstrap from dht.transmissionbt.com (tr-dht.c:247)

^C


[22:57:39.319] Saved "/etc/transmission-daemon/settings.json" (bencode.c:1731)

[22:57:39.320] DHT Saving 67 (67 + 0) nodes (tr-dht.c:366)

[22:57:39.320] Saved "/etc/transmission-daemon//dht.dat" (bencode.c:1731)

[22:57:39.321] Port Forwarding Stopped (port-forwarding.c:181)

Closing transmission session... done.

Help needed in passing arguments from command line in bash

#function myfunc
myfunc(){
echo $1
case $1 in
e)
a=5
;;
q)
a=10
;;
esac
}
myfunc

I need help in following :


$myfunc.sh e

echo $1 is not showing anything. case is also not working. What am I doing wrong?

xfce - How to customize Xubuntu with remastersys?

I've been trying to make my own custom xubuntu-based distro. I thought I understood how to import settings and features and repackage using remastersys, but apparently not.
One of the features involves removing the xfce4-panel and replacing it with cairo-dock(with my own theme), but with each ISO it keeps asking me to how I want to configure xfce4-panel and forgets about auto-starting cairo-dock.


Also when I do manually start cairo-dock it doesn’t have the theme i designed selected by default. I made sure I selected my user-name when configuring remastersys, as well as copying over the files/directories from my home directory to /etc/skel/. I even later moved my user-space over to /etc/skel/, but to no avail. Anybody know how what I'm doing wrong?

11.10 - Can't boot from USB after installing Ubuntu

I bought a Samsung series 5 notebook and a very strange thing happened: I installed Ubuntu 11.10 from a usb pen drive but when I restarted (...