UNIX Diary - Printable Version +- nixers (https://nixers.net) +-- Forum: General (https://nixers.net/Forum-General) +--- Forum: Psychology, Philosophy, and Licenses (https://nixers.net/Forum-Psychology-Philosophy-and-Licenses) +--- Thread: UNIX Diary (/Thread-UNIX-Diary) |
RE: UNIX Diary - venam - 10-09-2014 (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... Really nice, thanks a lot. I'll try that tomorrow. EDIT: I don't think that it's what I need. RE: UNIX Diary - xero - 11-09-2014 (10-09-2014, 11:51 AM)venam Wrote: Really nice, thanks a lot. I'll try that tomorrow.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/addon/terminalrun/ 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 RE: UNIX Diary - z3bra - 12-09-2014 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 ! RE: UNIX Diary - xero - 17-09-2014 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! RE: UNIX Diary - pizzaroll1 - 17-09-2014 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. RE: UNIX Diary - hades - 17-09-2014 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. RE: UNIX Diary - venam - 18-09-2014 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. RE: UNIX Diary - xero - 18-09-2014 (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! RE: UNIX Diary - venam - 18-09-2014 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. RE: UNIX Diary - earsplit - 19-09-2014 (17-09-2014, 10:51 AM)xero Wrote: dear UNIX diary, 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 Code: development.json Code: staging.json You can use environmental variables to control this further, and catch the environment in node. Code: export APP_ENV=development/staging/production 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'). RE: UNIX Diary - vompatti - 20-09-2014 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). RE: UNIX Diary - pizzaroll1 - 20-09-2014 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..... RE: UNIX Diary - srp - 21-09-2014 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 RE: UNIX Diary - kirby - 21-09-2014 (21-09-2014, 02:09 AM)vypr Wrote: Deer µNix Diary 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. RE: UNIX Diary - venam - 30-09-2014 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. RE: UNIX Diary - xero - 08-10-2014 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 *CLI-LIFE 4-LIFE* RE: UNIX Diary - cjm - 09-10-2014 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 :). RE: UNIX Diary - kirby - 09-10-2014 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. RE: UNIX Diary - JerrySpringerIsMyDad - 24-10-2014 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. RE: UNIX Diary - xero - 28-10-2014 @JerrySpringerIsMyDad yes exactly! i have tons of old programs i wrote that emulate other programs just to see if i could. keep hacking :D RE: UNIX Diary - venam - 28-10-2014 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. RE: UNIX Diary - venam - 04-11-2014 (09-09-2014, 12:21 PM)venam Wrote: Dear Unix Diary, 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. RE: UNIX Diary - neeasade - 09-01-2015 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. RE: UNIX Diary - z3bra - 09-01-2015 (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 !" RE: UNIX Diary - z3bra - 19-02-2015 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! RE: UNIX Diary - venam - 19-02-2015 (19-02-2015, 07:05 AM)z3bra Wrote: Dear Unix diary,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. RE: UNIX Diary - xero - 20-02-2015 (19-02-2015, 04:55 PM)venam Wrote: The piano thing is extremely cool. nothing is stopping you from using docker with vagrant! http://docs.vagrantup.com/v2/provisioning/docker.html RE: UNIX Diary - z3bra - 28-04-2015 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 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 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/ 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/ RE: UNIX Diary - bsdkeith - 29-04-2015 :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. :) RE: UNIX Diary - z3bra - 29-04-2015 This thread is my notebook ;) And I also copied the story on my blog, as a reminder |