UNIX Diary - Psychology, Philosophy, and Licenses
venam
Dear Unix diary,
The last few days I've been explaining, to some people that got interested in the system I was using, the magic of GNU/Linux.
I should really spend more time *nixing but all I've been doing is programming projects.
On a side note, the Ricerous project is in its final stage, which is excellent.
venam
(09-09-2014, 12:21 PM)venam Wrote: Dear Unix Diary,
Today I had a lot of fun hacking the computers in the library at university.
I noticed that when the computer boots there's something like the default X-like cursor that appears and then turns into the windows one. I entered some system rescue commands ctrl+alt+sysRq REISUB and it worked (rebooted)! This means that it was running the Linux kernel underneath.
So, I tried going into a TTY but it didn't work, instead it put me inside a kind of Openbox session with a very restrictive menu.
I found out that it was really openbox and that it ran windows inside Firefox with a citrix plugin.
It was interesting to check the file system without a browser and trying to execute commands without any terminal emulator.
Actually, I wasn't able to execute anything, I was just able to browse the filesystem using the browser.

Dear Unix Diary,
Yesterday I finally found how to access a terminal on those machines I mentioned earlier. A *very* luck friend found the password for the administrative tools by mistake, it was "root".
Now that I had root access I played around a bit.
The filesystem is separated in 2 parts: a writable one and a read-only one, the package manager is apt. I couldn't install anything because of the read-only restrictions and I had problems using dpkg for local install.
All and for all, it was pretty fun tinkering around with those custom made Gnu/Linux thin-clients boxes. Now I can do whatever I want with them, for example instead of starting that "windows"-like interface I can set some mischievous interface to shock users.
neeasade
Dear Unix diary,

Today I was reminded how rice can essentially 'alienate' normal users from my computer, which IMO is double-sided.
I recently acquired a chromebook from a friend, and had installed arch and my dotfiles onto it, and was showing it to the friend who had given me the chromebook. In the past, he had shown interest in linux, and has used ubuntu and crunchbang for about the past year. Because of this interest when I showed him some of the ram usage on BSPWM with BAR, he took it to start playing around with, which I was happy. However, givin the nature of smallish WMs like that(all the keybindings are customizable, you can make everything how you like) he was pretty lost. It was fun to show him how it worked together, but at the same time I could feel him rejecting this and wondering why you would not go with a stock something. The good side to rice 'alienation' is that users not comfortable with my desktop will not mess with it. I may be overthinking this.
z3bra
(09-01-2015, 10:44 AM)neeasade Wrote: [...] The good side to rice 'alienation' is that users not comfortable with my desktop will not mess with it. I may be overthinking this.

Nice story ! I can totally relate. I do not count the time I said to my friends:

"press windows + enter, No, Hold the win key, then press enter. Right. Now type "M-P-C", the three letters, then space, then "next". Ok? Now press enter ! Good !"
z3bra
Dear Unix diary,

The other day, I met some Docker experts.
I met them at my company, where I work as a sysadmin. They came to see if (and how) they can help us with the deployment of our application. I was a bit biased at first, because our application consist of many components, each doing a job and communicating with the other nodes (Unix way FTW!). And as Docker seems to put every app in its own container, isolated from the rest of the system, it seemed not well suited for our needs.
I might be wrong though, because they explained to me that many containers can share the same networking stack, and thus use the same bridged interface from the host. Pretty good point! But there is more...

They told us about an experience they did with docker, to show how fast the docker containers boot. They had a piano keyboard linked to a virtual machine set up, and when they pressed a key, a container would start, play a sound, and then die. Al this, in less than a second. Wow.
And finally, they gave an that I, as an admin having to install a few computers per month, could not ignore.. Docker containers can be used to bootstrap a whole X environment with preinstalled application on any host (windows, linux, OSX, ...) making the process of installing software as easy as copying a container on a computer, and firing it up...

I... I think I'm sold!
venam
(19-02-2015, 07:05 AM)z3bra Wrote: Dear Unix diary,

The other day, I met some Docker experts.
I met them at my company, where I work as a sysadmin. They came to see if (and how) they can help us with the deployment of our application. I was a bit biased at first, because our application consist of many components, each doing a job and communicating with the other nodes (Unix way FTW!). And as Docker seems to put every app in its own container, isolated from the rest of the system, it seemed not well suited for our needs.
I might be wrong though, because they explained to me that many containers can share the same networking stack, and thus use the same bridged interface from the host. Pretty good point! But there is more...

They told us about an experience they did with docker, to show how fast the docker containers boot. They had a piano keyboard linked to a virtual machine set up, and when they pressed a key, a container would start, play a sound, and then die. Al this, in less than a second. Wow.
And finally, they gave an that I, as an admin having to install a few computers per month, could not ignore.. Docker containers can be used to bootstrap a whole X environment with preinstalled application on any host (windows, linux, OSX, ...) making the process of installing software as easy as copying a container on a computer, and firing it up...

I... I think I'm sold!
The piano thing is extremely cool.
I'm also at work using portable box for development and testing.
We use vagrant, it's simple and easy to learn. It's not as scalable as Docker though.
xero
(19-02-2015, 04:55 PM)venam Wrote: The piano thing is extremely cool.
I'm also at work using portable box for development and testing.
We use vagrant, it's simple and easy to learn. It's not as scalable as Docker though.

nothing is stopping you from using docker with vagrant!
http://docs.vagrantup.com/v2/provisioning/docker.html
z3bra
Dear Unix diary,

today I've been a bad sysadmin.
It just happened. I host my own git repository, and earlier this evening I was working on my crux port tree, when I decided to commit and push my work. But this time, something went wrong and git didn't let me push any reference. Amongst all the messages returned by git, I saw this one:

Code:
remote: fatal: write error: No space left on device

Fucking shit. I instantly imagine what's happening: my /var partition wasn't correctly sized upon creation. This is where I host my website, gopherhole, git repo, pictures, videos, ... Every 'production' service. And after serving me well for several years, it's now full.

Hopefully, I had setup all my partitions on top of LVM, and let like 200GiB available, just in case things go wrong. And they did.

So here am I, staring at my red prompt, typing a few commands:

Code:
root ~# df -h
Filesystem                Size      Used Available Use% Mounted on
mdev                      1.0M         0      1.0M   0% /dev
shm                     499.4M         0    499.4M   0% /dev/shm
/dev/dm-1                 4.0G    797.9M      3.2G  20% /
tmpfs                    99.9M    208.0K     99.7M   0% /run
cgroup_root              10.0M         0     10.0M   0% /sys/fs/cgroup
/dev/sda1                96.8M     14.5M     77.3M  16% /boot
/dev/mapper/vg0-var      50.0G     50.0G     20.0K 100% /var
/dev/mapper/vg0-home    100.0G     12.9G     85.2G  13% /home
/dev/mapper/vg0-data    600.0G    346.7G    252.1G  58% /data
tmpfs                   499.4M         0    499.4M   0% /tmp
tmpfs                   499.4M     32.4M    467.0M   6% /home/z3bra/tmp
/dev/mapper/vg0-data    600.0G    346.7G    252.1G  58% /var/lib/mpd/music

root ~# mount | grep /var
/dev/mapper/vg0-var on /var type xfs (rw,relatime,attr2,inode64,noquota)

root ~# lvs
  LV   VG   Attr       LSize
  data vg0  -wi-ao---- 600.00g
  home vg0  -wi-ao---- 100.00g
  root vg0  -wi-ao----   4.00g
  swap vg0  -wi-ao----   1.00g
  var  vg0  -wi-ao----  50.00g

root ~# vgs
  VG   #PV #LV #SN Attr   VSize   VFree
  vg0    1   5   0 wz--n- 931.41g 176.41g

Ok, so it's not the first time this happens, remember? You already grew your /home partition, and it went good! Just do the same with /var! It works without a reboot!

What was those commands again?

Code:
root ~# lvextend -L +20G vg0/var
  Extending logical volume var to 70.00 GiB
  63e74d07f000-63e74d2c1000 r-xp 00000000 fd:01 8430401                    /lib/libdevmapper.so.1.02: mlock failed: Out of memory
  63e74d2c6000-63e74d4cb000 r-xp 00000000 fd:01 8430404                    /lib/libdevmapper-event.so.1.02: mlock failed: Out of memory
  Logical volume var successfully resized
  Internal error: Reserved memory (9064448) not enough: used 9084928. Increase activation/reserved_memory?

root ~# lvs
  LV   VG   Attr       LSize   Pool Origin Data%  Meta%  Move Log Cpy%Sync Convert
  data vg0  -wi-ao---- 600.00g
  home vg0  -wi-ao---- 100.00g
  root vg0  -wi-ao----   4.00g
  swap vg0  -wi-ao----   1.00g
  var  vg0  -wi-ao----  70.00g

root ~# xfs_growfs -d /var
meta-data=/dev/mapper/vg0-var    isize=256    agcount=4, agsize=3276800 blks
         =                       sectsz=4096  attr=2, projid32bit=1
         =                       crc=0
data     =                       bsize=4096   blocks=13107200, imaxpct=25
         =                       sunit=0      swidth=0 blks
naming   =version 2              bsize=4096   ascii-ci=0 ftype=0
log      =internal               bsize=4096   blocks=6400, version=2
         =                       sectsz=4096  sunit=1 blks, lazy-count=1
realtime =none                   extsz=4096   blocks=0, rtextents=0
data blocks changed from 13107200 to 18350080

root ~# df -h
Filesystem                Size      Used Available Use% Mounted on
mdev                      1.0M         0      1.0M   0% /dev
shm                     499.4M         0    499.4M   0% /dev/shm
/dev/dm-1                 4.0G    797.9M      3.2G  20% /
tmpfs                    99.9M    208.0K     99.7M   0% /run
cgroup_root              10.0M         0     10.0M   0% /sys/fs/cgroup
/dev/sda1                96.8M     14.5M     77.3M  16% /boot
/dev/mapper/vg0-var      70.0G     50.0G     20.0G  71% /var
/dev/mapper/vg0-home    100.0G     12.9G     85.2G  13% /home
/dev/mapper/vg0-data    600.0G    346.7G    252.1G  58% /data
tmpfs                   499.4M         0    499.4M   0% /tmp
tmpfs                   499.4M     32.4M    467.0M   6% /home/z3bra/tmp
/dev/mapper/vg0-data    600.0G    346.7G    252.1G  58% /var/lib/mpd/music

Phew... I'm safe now! So what the hell was going on? I decided to investigate a bit further, to see what I should watch next time.
That's how I realised that I did a HUGE mistake...

Code:
root ~# cd /var/
root var# du -sh *
48.5G   backup
156.7M  cache
0       db
0       empty
228.8M  git
5.7M    gopher
4.5G    lib
0       local
0       lock
7.9M    log
0       mail
0       run
40.0K   spool
0       tmp
1.1G    www

root var# cd backup/

root backup# du -sh *
12.0K   bin
20.0K   etc
48.5G   out
20.0K   usr
84.0K   var

root backup# mountpoint out
out is not a mountpoint

root backup# cd out/
root out# ll
total 50841516
drwxr-sr-x    2 backup   users       4.0K Apr 28 02:11 ./
drwxr-sr-x    8 backup   users       4.0K Feb  2 20:24 ../
-rw-r--r--    1 backup   users       5.3G Apr 25 07:43 data
-rw-r--r--    1 backup   users          0 Apr 25 07:43 data.0.BAK
-rw-r--r--    1 backup   users      12.0G Apr 26 04:37 homedir
-rw-r--r--    1 backup   users      12.0G Apr 22 04:43 homedir.0.BAK
-rw-r--r--    1 backup   users      12.0G Apr 25 05:00 homedir.1.BAK
-rw-r--r--    1 backup   users      44.0K Apr 26 04:42 homedir.2.BAK
-rw-r--r--    1 backup   users       1.2G Apr 28 02:11 production
-rw-r--r--    1 backup   users       1.2G Apr 21 02:10 production.0.BAK
-rw-r--r--    1 backup   users       1.2G Apr 22 02:11 production.1.BAK
-rw-r--r--    1 backup   users       1.2G Apr 23 02:11 production.2.BAK
-rw-r--r--    1 backup   users       1.2G Apr 24 02:11 production.3.BAK
-rw-r--r--    1 backup   users       1.2G Apr 25 02:12 production.4.BAK
-rw-r--r--    1 backup   users          0 Apr 26 02:11 production.5.BAK
-rw-r--r--    1 backup   users       5.3M Apr 27 02:12 production.6.BAK
-rw-r--r--    1 backup   users          0 Apr 28 02:11 production.7.BAK

My backup system doesn't check wether it saves to a mountpoint or not. Shit.
For a whole week, all my backups where created in my /var partition instead of a backup USB drive meant for this purpose. And it filled it up pretty quickly.

My backup system send me a mail after each backup, explaining me how it went. The fact it's saving to a mountpoint or not is written in it. I just stopped checking. Silly me.

I realise that this issue could have been easily solved by mounting my backup disk elsewhere, then moving the files, and remounting where it should be. But I didn't. Instead, I grew a partition that didn't need to be (the backups filled 48GiB out of 50Gib allocated to /var), and this partition can't be shrinked anymore, as it's an XFS filesystem.

So today I learnt two things, the hard way:

1. Don't do anything until you know what's going on
2. Configure systems checks and READ THEM

I hope you'll learn from my mistakes. For now I think I'll just print this over my desktop, as a reminder:

Code:
root ~# df -h /var/
Filesystem                Size      Used Available Use% Mounted on
/dev/mapper/vg0-var      70.0G      1.5G     68.5G   2% /var
bsdkeith
:lol: - so it isn't just us users that don't read their messages properly! ;)

It's how you learn, (by mistakes), as long as you take it in & don't repeat it; this is why I keep a notebook for reminders. :)
z3bra
This thread is my notebook ;) And I also copied the story on my blog, as a reminder




Members  |  Stats  |  Night Mode