UNIX Diary - Psychology, Philosophy, and Licenses

Users browsing this thread: 1 Guest(s)
venam
Administrators
(10-09-2014, 10:53 AM)xero Wrote:
(09-09-2014, 12:21 PM)venam Wrote: Today I had a lot of fun hacking the computers in the library at university...
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.

next time try https://addons.mozilla.org/En-us/firefox...-terminal/

Really nice, thanks a lot. I'll try that tomorrow.
EDIT: I don't think that it's what I need.
xero
Long time nixers
(10-09-2014, 11:51 AM)venam Wrote: Really nice, thanks a lot. I'll try that tomorrow.
EDIT: I don't think that it's what I need.
sorry, i guess that is a JS only terminal. (i use devtools-term in chrome sometimes, i thought this was the same idea).

the only other plugins i see are:
- terminalRun : https://addons.mozilla.org/en-US/firefox...rminalrun/ but that opens an external terminal, so idk if that will work for you either.
- tanasinn : http://saitoha.github.io/tanasinn/ - looks good, but some heavy dependencies.
- fireSSH : https://addons.mozilla.org/en-US/firefox/addon/firessh/ remote sessions only
z3bra
Grey Hair Nixers
Dear Unix Diary,

Yesterday I installed my first production server. And it went fine !

I was recently hired as a sysadmin, and had to lead my first project: deploying an ownCloud server for internal use.
The first thing I had to do was to setup a VM to run the Linux server, and then install all the vital components for ownCloud (web server, database, php, and such).
I took me about two days to get it working along with the already existing user base and network shares, but I did it ! The server is now active, and functionnal !
Next task is to make it higly available, and back it up !
xero
Long time nixers
dear UNIX diary,
today i showed my boss how to spoof production urls as localhost for offline testing!

at my new job i've been learning nodejs. it's pretty cool writing end-to-end javascript for a project. the idea is that all our clients have a given url (e.g. http://nixers.net) and in the project code we use that url all over the place. when it's time to make a fix it's difficult to test on localhost when all the urls redirect you to the live site. when my co-workers we're talking about how they test, they told me they use a cluster of virtual staging servers that the devops team sets up for us to act as a given domain. i asked my boss why we needed this since we could all do that locally. the secret is editing your hosts file and telling your box to respond as that domain.

- edit /etc/host
- add a new line in this format: ip-address hostname.domain.org hostname
- 127.0.0.1 nixers.net nixers.net
- save the file.
- start the nodejs frontend in the cli
- sudo node app --url http://localhost:4000 --p 80 -w 0

now all requests to http://nixers.net (or in the node world http://nixers.net:3000 - depending on how you setup your dev ports) will redirect to http://localhost/!!!

i got some "brownie points" with my boss for that one! unix to the rescue!
pizzaroll1
Long time nixers
The best part is that Windows has an /etc/hosts file too, but it's somewhere in the Windows directory. It's from back when they took all of the TCP/IP stack code from BSD (could have been FreeBSD or NetBSD, or maybe 4.4BSD, I don't remember), I think. But hardly anyone uses it for some reason.
my website: kaashif.co.uk
hades
Long time nixers
I've seen someone use the hosts file on Windows before. He was demonstrating, for a Security class, how viruses with Admin priveleges, could cause your legitimate traffic to be redirected to a phishing site. He then demonstrated setting up several sites that looked just like major sites, such as facebook, twitter, and even a bank's website, and then setting up the hosts file to redirect to the lookalike sites. Spooky stuff.

But if the virus is contracted while using a non-admin account, it can't do that damage. He followed up this lesson by reminding the class that it's not a good idea to browse the web and conduct everyday activities while logged in as an admin, which shocked most of the Windows users in the class. And their shock, shocked me - that's basically the equivalent of logging in as root full-time on a *nix system. The amount of ignorance it would take to do that is beyond me.
venam
Administrators
We were talking about host files a while back. They can be used to avoid spams. For example there's this guy http://someonewhocares.org/ that is trying to make a good list of hosts to block. Also, the host file in this case has been proved to not be that efficient and it's better to use something like adsuck.
xero
Long time nixers
(18-09-2014, 12:37 AM)venam Wrote: http://someonewhocares.org/hosts/
holy hosts file batman! there's some good stuff in there. thanx for sharing!
venam
Administrators
Dear Unix diary,
Today I've set up an account on https://pushover.net/. I recently got a smartphone and I thought it was time to get this thing working so I get notification when I'm away from my main machine. Thus, I've got the api key and wrote a little shell script to do the notif. I tested it at home and it worked perfectly. So I inserted a line in my updater script which fetches new info and manga updates. Then I went to univ and tried checking if things where working properly and it turned out they're not. The port used by the Pushover application is blocked. University ITs are lame.
earsplit
Members
(17-09-2014, 10:51 AM)xero Wrote: dear UNIX diary,
today i showed my boss how to spoof production urls as localhost for offline testing!

at my new job i've been learning nodejs. it's pretty cool writing end-to-end javascript for a project. the idea is that all our clients have a given url (e.g. http://nixers.net) and in the project code we use that url all over the place. when it's time to make a fix it's difficult to test on localhost when all the urls redirect you to the live site. when my co-workers we're talking about how they test, they told me they use a cluster of virtual staging servers that the devops team sets up for us to act as a given domain. i asked my boss why we needed this since we could all do that locally. the secret is editing your hosts file and telling your box to respond as that domain.

- edit /etc/host
- add a new line in this format: ip-address hostname.domain.org hostname
- 127.0.0.1 nixers.net nixers.net
- save the file.
- start the nodejs frontend in the cli
- sudo node app --url http://localhost:4000 --p 80 -w 0

now all requests to http://nixers.net (or in the node world http://nixers.net:3000 - depending on how you setup your dev ports) will redirect to http://localhost/!!!

i got some "brownie points" with my boss for that one! unix to the rescue!

Best way to do this is at an application level though. You shouldn't be spoofing production URLs because it can lead to a greater chance of error. Say you're testing API calls locally and you forget to spoof your domain. You've ended up making them all on production.

What you should do instead is in your routes, associate a host to each controller. In the application configuration, you can set the default host to "production.com" and overwrite it in a development environment.

For instance,
Code:
defaults.json
{
  domain : "production.com"
}
Code:
development.json
{
  domain : "local.com"
}
Code:
staging.json
{
  domain : "staging.com"
}
Where the values in staging + development overwrite settings in default.json.

You can use environmental variables to control this further, and catch the environment in node.
Code:
export APP_ENV=development/staging/production
You can access it in node with
Code:
process.env.APP_ENV

Most importantly, I suggest you implement something like this:
https://github.com/web-napopa/node-reversable-router
And then replace all hardcoded urls with calls to
url('named_route').
vompatti
Long time nixers
Dear Unix Diary,

couple days ago, while working on my VOIP system, I came to conclusion that python is too slow for the client side software so I started to do it in Go which I've been enjoying a lot. Such a nice language. Problem which I'm facing now is to send audio data over network (converting []int16 to []byte but encoding/gob seems to do the job). Can't wait to get this work. The server software seems to be pretty stable for now, haven't tested it with malicious data nor have I wrote any tests. Server has about 950 lines of code now but it doesn't have that much functionality though it can handle user authentication and do the UDP hole punch, it has simple control panel and it is _very_ easy to add stuff into it (to the control panel and other functionality for the clients).
pizzaroll1
Long time nixers
Dear UNIX Diary,

I finally made the switch to Emacs completely (pkg_delete vim). I can't believe how much better Emacs is (for writing Haskell and C) than Vim is. Coding in REPL languages is very nice with Emacs, as you write the code, it is loaded into the REPL, so you can just switch buffers and play around with the code. Emacs Lisp is way better than VimScript, too, although it has its shortcomings. There's a project to replace the Emacs Lisp interpreter with the Guile interpreter (GNU project's Scheme dialect), which would be fantastic, since Guile is a reasonably modern language. I really need to get into writing more Lisp, I hear it's like nirvana once you "get" it.

I always hear the saying that Emacs is a good operating system without a good editor. Well clearly that's wrong, since evil-mode provides all of the features of Vim in Emacs, and the plethora of Emacs packages provide functionality that's impossible in Vim.

Now all that's left is to install webkit.el for browsing the web in Emacs, getting to grips with Gnus for writing/reading mail in Emacs and running Emacs as PID 1. Maybe that's a joke, maybe it isn't: I don't see why it wouldn't be fun to try to write an .emacs file that brings up the network, starts daemons, fscks the disk.....
my website: kaashif.co.uk
srp
Long time nixers
Deer µNix Diary

After wanting to get involved in game development, I decided to plunge into it. I remembered that kirby used SFML in his platformer so I found the official C bindings for it (it's C++ default), and tried my hand at it. Things went well until I noticed that CPU usage was around 80% and that energy usage was very high. So I moved to the Allegro game library, and the usages are low, like they should be. I pushed my test code onto GitHub.

http://github.com/thevypr/gamedev
~Seraphim R.P.
the artistnixer formerly known as vypr formerly known as sticky
kirby
Long time nixers
(21-09-2014, 02:09 AM)vypr Wrote: Deer µNix Diary

After wanting to get involved in game development, I decided to plunge into it. I remembered that kirby used SFML in his platformer so I found the official C bindings for it (it's C++ default), and tried my hand at it. Things went well until I noticed that CPU usage was around 80% and that energy usage was very high. So I moved to the Allegro game library, and the usages are low, like they should be. I pushed my test code onto GitHub.

http://github.com/thevypr/gamedev

If you're not using C++, I would recommend SDL. It's C based and what I started learning with, which taught me a good deal about gamedev basics. I moved to SFML because I'm a big fan of Object Oriented and think it works really nicely for game development in general. There's a great tutorial for SDL here.

EDIT: I learned on SDL 1.x, no clue if 2.0 still feels like C or not. It is a C library still so in theory it should be.
venam
Administrators
Dear Unix Diary,
The last two weeks I was busy with university and programming projects.
I haven't got time to do anything special Unix specific. I've learned Octave (Matlab-like), I'm reading my second Haskell book, I finished a meta-programming project, I finished reading a nice book about PostgreSQL and I'm still learning new things about it, I'm watching programming talks, I'm trying to finish the Ricerous project with the other members, and I'm working on my "website visual coherency framework" which consist of an add-on (done) and of a program that uses perceptual hash (pHash) to match images and output graphs/statistics about them.

I'm doing so much things but I feel hollow... I miss you Unix, I know you are more than grep, sed, rename, and find.
xero
Long time nixers
dear unix diary,
as a cli junkie and a new recruit to the "cult of vim" i spend most of my time in the terminal. i've been using tiling window managers for a while now (currently running herbstluftwm) and usually have 5+ terminal windows open at time. because of this, i never really gave tmux much of a thought, but after this week, i'm a believer. a few different factors brought me to this revelation, all of them related to work. half our sites are written in nodejs, and require a frontend and a backend server; each of which i ran in a separate terminal. a spent lots of time resizing the pane and looking back through the buffer, but whenever a new "event" was fired urxvt/zsh would scroll back to the bottom *uggg!*. our other legacy sites are coded in php, and we develop them on a special test server. the server is a weird environment. i got our sysadmin in install zsh for me but lots of my keyboard presses were interpreted wrong. i tired running the zkbd, setting the $term var, nothing worked. finally, one of my co-workers (a pc users oddly enough) asked me if i'd tried tmux. i initially just brushed him off (*psh!* what's a windoze user know about nix warez?) but after a while i was getting super frustrated and decided to just give it a try. *ZOMFGBBQ!#@!~* like magic everything just seemed to work. using buffers for each node server is awesome, it's a lot more relaxed when it comes to scrolling back though history. combine it with an ssh ServerAliveInterval i can just toss my dev server connection in a buffer and forget about it until i need it. the configurable keybindings are great (i love making up my own styles). and it's copy paste features seems to work better than the urxvt-perls library i was using before. it's kinda vim style, i enter command mode (ctrl+a), press esc to enter selection mode, move around and find what i want to select, press V to start selecting, and press Y to yank it to the clipboard. once it's copied, i can use my normal paste (ctrl+v) anywhere. here's how that looks in my .tmux.config
Code:
# vim style copy paste mode
unbind [
bind Escape copy-mode
unbind p
bind p paste-buffer
bind-key -t vi-copy 'v' begin-selection
bind -t vi-copy y copy-pipe 'xclip -in -selection clipboard'
i really have only scratched the surface, having never used any of the splitting features, but i can say now i'm a believer.

*CLI-LIFE 4-LIFE*
cjm
Long time nixers
Dear Unix Diary,

I am in my first year of college, and I am starting to get overwhelmed with work. I know my way around a Unix system and I am beginning to wonder how far a knowledge of Unix will get me. Overall I am enjoying the work, but as it is a Windows centric environment. I want it to be more unixy :).
----
blog: c-jm.github.io
twitter: https://www.twitter.com/_c_jm
My ambition in life is to be a graybeard by the time I am 65.
----
kirby
Long time nixers
Dear Unix Diary,

Comparatively, the start of my University life has been the opposite. Lots of work yes, but I've had entire lectures on how to use mv, cp and rm, as well as an attached practical session. Everything here is Linux (some old Red Hat) but they assume I have no prior experience, making it pretty easy. The same goes for the programming part, all I need to learn there is Java syntax (eew). Big thanks to z3bra by the way for his blog post on using a Makefile for Java.
JerrySpringerIsMyDad
Members
Dear Unix Diary,

Today, I decided that since I know almost nothing about python, I would write myself a "file manager" type thing with it. It is not easy at all, not everything works the way I want, everything is messy, and half the time I have no idea what I am doing. At this point I have something that kind of actually works, but it is pretty crude and doesn't do a whole lot. It is an interesting learning experience though, so I guess that's all that really matters. Right? I can share it with you guys if you want. I would really appreciate any tips you might have.
xero
Long time nixers
@JerrySpringerIsMyDad yes exactly! i have tons of old programs i wrote that emulate other programs just to see if i could. keep hacking :D
venam
Administrators
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
Administrators
(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
Grey Hair Nixers
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
Grey Hair Nixers
(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
Grey Hair Nixers
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
Administrators
(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
Long time nixers
(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
Grey Hair Nixers
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
Long time nixers
: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
Grey Hair Nixers
This thread is my notebook ;) And I also copied the story on my blog, as a reminder