UNIX Diary - Psychology, Philosophy, and Licenses
pizzaroll1
Dear Unix Diary,

I decided to set up gitolite on my server. I had already done this once before, a few years ago, but that was on a different OS, so things could be different (I now use OpenBSD for everything).

The first step was obviously to get gitolite. First, I made a git user with home directory and cloned gitolite there
Code:
$ sudo useradd -m git
$ cd ~git
$ git clone git://github.com/sitaramc/gitolite.git

The installation procedure for gitolite was pretty simple - you need an admin's SSH public key first, though, so I got that first, then ran gitolite's install script to install the gitolite script into /usr/local/bin.

Code:
(on my laptop) $ scp ~/.ssh/id_rsa.pub server:~/kaashif.pub
$ ssh server
$ cd ~git
$ sudo gitolite/install -ln /usr/local/bin

So now I have the gitolite script, I need to actually set up the repos and give myself access.

Code:
$ sudo -u git -i
$ gitolite setup -pk ~kaashif/kaashif.pub

So now there is an .ssh/authorized_keys, repositories directory and .gitolite.rc in /home/git. Great! At this point, it's possible to clone and push to repos. So let's try that!

Code:
(on my laptop) $ git clone git@server:testing.git
Cloning into 'testing'
...
warning: You appear to have cloned an empty repository.

That's what I like to see! I really don't like having all my repos in one place, so I need some way to sync my repos between my server and GitHub (could also be BitBucket, Gitorious etc, but this is the most convenient). Luckily, there's a way to do that with git hooks! I'll just set up gitolite to add a post-receive hook to every repo to push to the repo of the same name on GitHub.

Code:
$ cat >> ~git/.gitolite/hooks/common/post-receive << EOF
git push -f --mirror git@github.com:kaashif-hymabaccus/${GL_REPO}.git
EOF
$ chmod +x ~git/.gitolite/hooks/common/post-receive

Now every time I push to a repo, I get something like this:

Code:
$ git push
Pushing to git@kaashif.co.uk:muon-lib.git
Counting objects: 5, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (2/2), done.
Writing objects: 100% (3/3), 312 bytes | 0 bytes/s, done.
Total 3 (delta 1), reused 0 (delta 0)
remote: To git@github.com:kaashif-hymabaccus/muon-lib.git
remote:    ca73f16..8237c09  master -> master
To git@kaashif.co.uk:muon-lib.git
   ca73f16..8237c09  master -> master
updating local tracking ref 'refs/remotes/origin/master'

That bit in the middle, where the lines start with "remote:" is my server pushing the repo to GitHub.

Now I'm not completely reliant on GitHub, which has gone down in the past. In the future, I might switch to Gitorious or GitLab, because...GitHub isn't run on free software. Shocking, I know.
my website: kaashif.co.uk
z3bra
I really love the idea of using hooks to mirrors pushes to another place ! Thanks for the idea !
cjm
Dear Unix Diary,

Today I have had the epiphany to why I hate the Windows world so much, and as such to why I have become a Free and Open Source software advocate. I have just recently started school to become a software engineer. I have moved into the college dorms, and as such was prompted to go to the Orientation. Now I do not get me wrong I loved the orientation full heartedly. It was full of people that I enjoyed talking to, and my professors were great. The only problem was as they were going through the different slides and such. I was told that it was a Windows centric environment. Now part of the course is learning about Linux development,and personally I am looking forward to it. But the problem is I do NOT have a Windows machine to run for this course. I have been trying to torrent things, and get licenses for the last few hours to no avail. I will keep trying, but I think this proves to all of us that being a Nixer is much more about simplicity and FUN. It is just much easier to install a unix than it is to install a MS based machine. And this is why I will continue to advocate free and open source software, with the Unixes being the prime example.
----
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.
----
xero
in the states (i'm not sure where you live) most schools have a windows license program. you can get a copy for free of extremely low cost. ask one of your professors about it.
venam
Dear Unix diary,
These days I've learned and done quite a lot of things.
I finished 2 books, "Extreme Perl" and "Learn C The Hard Way", and started reading 2 others, one related to programming "Practical PostgreSQL" and the other unrelated.
PostgreSQL is extremely nice, I had previously bad experiences with dbms but this is changing my mind.
If you remember I wrote a "walkman" script to listen to music from my laptop while it's closed and automatically stop it when I unplug the earphones, I did that because I had no other way to listen to music. However, recently, I just got a brand new Android device. (ノ´ヮ´)ノ*:・゚✧
The first day I had fun customizing the interface, I installed Numix icons, and Apex launcher (Yeah, I know but they do look sweet on cellphones). The second day I noticed that, after someone calls me, even when I set the ringtone in the audio option, it goes back to the default one. I tried resetting to factory default and some other things in vain. Then before sleeping I got this idea: "If it doesn't work globally make it work locally". I opened the contact list and tried setting a ringtone for a single individual... it worked and overrides the default one. After that I created a group with everyone in it and installed an application that allows me to directly set the ringtone for a group. What a nifty hack!
I had other nice moments this week with the phone. I installed qpython, tried the default programs, and tested if the ricer project program could run on the phone. It did but the screen is too small to be able to read anything.
In the bunch of programs I installed I have telegram, it's an IM. I'm used to easily paste emoji (https://github.com/venam/emoji) from the keyboard and I wanted that for my phone. I knew there already was some """apps""" on the store to do that but I wanted to port what I wrote to my cellphone. Thus, I did:
[Image: uTCJk21.jpg]
[Image: HN2sK63.jpg]
[Image: fQ3C1XX.jpg]
Moreover, I coded a telegram bot that I used to run on the desktop https://github.com/venam/tg-bot so I wanted to finally use it for useful things like querying my home machine when I'm away. I cleaned up the code a bit by using a table of functions. Lua is such a nice language.

I really hope this ricer project comes out soon.
kirby
(30-08-2014, 01:47 AM)venam Wrote: I finished 2 books, "Extreme Perl" and "Learn C The Hard Way", and started reading 2 others, one related to programming "Practical PostgreSQL" and the other unrelated.

How was 'Extreme Perl'? I've read 'Learning Perl' and am on the next book in the series, 'Intermediate Perl', which I'm enjoying, but it'd be cool to get a viewpoint from a different author as well. Plus how can you not be enticed by the prospect of extreme Perl.
venam
(30-08-2014, 09:56 AM)kirby Wrote:
(30-08-2014, 01:47 AM)venam Wrote: I finished 2 books, "Extreme Perl" and "Learn C The Hard Way", and started reading 2 others, one related to programming "Practical PostgreSQL" and the other unrelated.

How was 'Extreme Perl'? I've read 'Learning Perl' and am on the next book in the series, 'Intermediate Perl', which I'm enjoying, but it'd be cool to get a viewpoint from a different author as well. Plus how can you not be enticed by the prospect of extreme Perl.
It's a project manager book about XP (Extreme Programming) applied to Perl. It was very interesting but it wasn't the extreme I was looking for. Even though, it was a very good and useful read, I recommend it for anyone that's interested in those kind of things.
venam
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.
berk
Dear Unix Diary,

Today I learned how to use the Mechanize library in Python and wrote a scraper with it. There is a website which everybody constantly checks the exam results and everybody asks each other "how their results were", comparing, etc... I discovered a little URL trick which allowed me to look at everybody's results. I wrote a script to automatically download everybody's exam results. Managed to freak some friends out. :)
xero
(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/




Members  |  Stats  |  Night Mode