User & group commands in -nix systems

To change permission
chmod -R 755 folder_name
with which,755 -> ABC
A = User
B = Group
C = Others
and -R = recursive to all sub-folders.

To change group and owner of folder
chown -R group:user folder_name

Create group
groupadd group_name

Create user
adducer user_name

Add an existing user to an existing group
usermod -a -G group_name user_name
with which -a=append, -G=supplementary_group, -g=primary_group

Remove an existing user from an existing group (will not delete the user nor the group)
deluser user_name group_name

Validate user group settings
id user_name, or
groups user_name

Longitude & Latitude

Did you know:
The Earth’s radius is 6371km
For longitude, 0.00001 is roughly 1 meter
For Latitude, 0.00001 is roughly 0.4 meter
Obviously, the civil GPS nowadays is not yet achieving this level of accuracy. But it is useful to know the scale.

Team: git with multi-user

git…gitolite…it is an important tool to development, but require some patience to setup.

No much neat tutorial written on web. I write mine.

1. Prepare a few things before start:

  • ssh login
  • all public key of users
  • repository hierarchical structure design

2. Install gitolite (previously gitosis)
$ apt-get install gitolite

3. Create a single user for the gitolite account
$ adduser gitolite

4. Run setup with gitolite user, providing the admin public key
$ su - gitolite
$ gl-setup your_key.pub

5. Server is setup. Next, configure it.
Go back to client. Clone the admin folder. This will work fine if you do the steps correctly.
$ git clone gitolite@server.com:gitolite-admin

6. Goto gitolite-admin
$ cd gitolite-admin

7. The folder has two subfolders. “conf" and “keydir".
What you have to do is to put all the user’s public key into the “keydir" folder, and then edit the file in conf/gitolite.conf.

8. The file is like this:
repo gitolite-admin
RW+ = admin

repo testing
RW+ = @all

repo repo-A
RW+ = admin
RW+ = userA

The name (admin, userA, etc..) is referring to the filename public keys in the “keydir" folder. The keyword “repo" refers to a new repository. If you add a new repo with the same format, the server will create repository accordingly. I create a new repo named repo-A in above file.

9. After changing the conf/gitolite.conf file, git-commit it.
$ git add .
$ git commit -a -m "commit"
$ git push origin master

The server settings are automatically updated after commit.

10. Now you can git clone the new repo. e.g. repo-A
$ git clone gitolite@server.com:repo-A

Done~

p.s.
The authentication part, individual user need not to have access right to the server where the gitolite is hosted. Just don’t put the public key into ~/.ssh folder, only put them in the keydir of gitolite-admin.
This tutorial is a bit complex, but much simpler than those available on other place now which I learn the tools from.

Cheers~

ssh public key authentication

On the web there isn’t a neatly written public key ssh authentication tutorial
Here I write mine:

This is related to the OpenSSH. There is another method related to OpenSSL.
1. Generate your key if they don’t exist in the client, after the command below, you may find it in ~/.ssh/
ssh-keygen -t rsa

2. in ~/.ssh/, “id_rsa.pub" is the public key, “id_rsa" is the private key. Always keep this folder secured.

3. Copy the file to the server, the home folder of the user to-be-login
scp id_rsa.pub userA@server.com:/home/userA/.ssh/id_rsa.pub

4. Login the server. Add the key to the list of authorized key
cat ~/.ssh/uploaded_key.pub` >> ~/.ssh/authorized_keys

5. Done. Login with this command:
ssh userA@server.com or
ssh -i ~/.ssh/id_rsa userA@server.com

iPad model numbers

iPad 3 – Black
MC705ZP/A – iPad 3 Wi-Fi only 16GB – Black
MC706ZP/A – iPad 3 Wi-Fi only 32GB – Black
MC707ZP/A – iPad 3 Wi-Fi only 64GB – Black

MD366ZP/A – iPad 3 Wi-Fi + 4G 16GB – Black
MD367ZP/A – iPad 3 Wi-Fi + 4G 32GB – Black
MD368ZP/A – iPad 3 Wi-Fi + 4G 64GB – Black

iPad 3 – White
MD328ZP/A – iPad 3 Wi-Fi only 16GB – White
MD329ZP/A – iPad 3 Wi-Fi only 32GB – White
MD330ZP/A – iPad 3 Wi-Fi only 64GB – White

MD369ZP/A – iPad 3 Wi-Fi + 4G 16GB – White
MD370ZP/A – iPad 3 Wi-Fi + 4G 32GB – White
MD371ZP/A – iPad 3 Wi-Fi + 4G 64GB – White

Source:
Apple iPad 3 (iPad 3rd generation) model numbers

Apple iPad 3 (iPad 3rd generation) model numbers