Montag, 17. März 2014

Subversion chrashcourse

    
In your repository..:

     svn update

..updates your repo to the newest revision

     svn log 

see the latest changes and the comments attached to them

now you can edit any file in your repositories directory, if you are finished, save the file and type

     svn ci

svn ci is short for svn commit and stands for itself: you want to commit the changes you made.

You will be propted into your console's default editor and may now attach a comment in the section above the -- ignored -- section. Save again to commit your changes.


     svn update & svn log

..to view & verify the changes you made.


Adding a new file / removing files from the repository's inventory:

     svn add <file>

where <file> is your filename or directory containing files you wish to add to version control, and

     svn del <file>

is your file or directory to be removed from version control.
Now..

     svn ci

..comment and commit to save the changes you made as always.






Dienstag, 11. März 2014

Deleting/removing/revoking a User from a MySQL Database

Depending on the version of MySQL you use, there are different methods of deleting a user.
As of MySQL 5.0.2, you can remove an account and its privileges as follows:

   DROP USER user;


If this does not work, try:

   DROP USER 'user'@'localhost';


In older versions of MySQL you need to 'revoke' granted priviledges from a user:

   REVOKE ALL PRIVILEGES, GRANT OPTION FROM user;


..which drops all global, database, table, column, and routine privileges for the named user.

To see the priviledges granted for a given account simply:


   SHOW GRANTS FOR 'user'@'localhost';

Before MySQL 4.1.1, DROP USER is not available. You should first revoke the account privileges using SHOW GRANTS and REVOKE as just described. Then delete the user table row and flush the grant tables as shown here:

   DELETE FROM mysql.user WHERE User='user' and Host='localhost';

Update the priviledges with FLUSH:

       FLUSH PRIVILEGES;

See https://dev.mysql.com/doc/refman/5.0/en/drop-user.html
and https://dev.mysql.com/doc/refman/4.1/en/drop-user.html for further documentation.

Sonntag, 9. März 2014

sudo apt-get install anarchism


From the 'Les Tanneries'-Squat in Dijon, France

$sudo apt-get install anarchism
..installs the 'Anarchism-FAQ' on most debian-based OS

$sudo apt-get install bible-kjv
..on the other hand installs the word of god translated by 'king james' in 1611 ..

Donnerstag, 6. März 2014

user@machine:~$ sudo chmod 777 somefile


Examples:
user@machine:~$ touch somefile
user@machine:~$ ls -lh
total 0
-rw-r--r-- 1 user user 0 Mar  7 02:47 somefile
user@machine:~$ sudo chmod 777 somefile
[sudo] password for user: 
user@machine:~$ ls -lh
total 0
-rwxrwxrwx 1 user user 0 Mar  7 02:47 somefile

the permissions are mapped as followed:
Owner Group Other(Everyone)
read write execute read write execute read write execute
rwx rwx rwx

decimal      unix                   binary
770 -> rwxrwx---  111 111 000     
700 -> rwx------  111 000 000
110 -> --x--x---  001 001 000
100 -> --x------  001 000 000
222 -> -w--w--w-  010 010 010
220 -> -w--w----  010 010 000
200 -> -w-------  010 000 000
333 -> -wx-wx-wx  011 011 011
444 -> r--r--r--  100 100 100
356 -> -wxr-xrw-  011 101 110
755 -> rwxr-wr-w  111 101 101

Numerical permissions
#Permissionrwx
7full111
6read and write110
5read and execute101
4read only100
3write and execute011
2write only010
1execute only001
0none000



A storytelling cow in the Bash Console using Fortune and Cowsay

you'll need 'cowsay' and 'fortune', both in the debian default repositories:

sudo apt-get install cowsay fortune

#!/usr/bin/bash

while (true); do
      text=$(fortune); 
      cowsay $text;
      length=$(echo $text | wc -w);
      let length=$(expr $length);
      sleep $length;
done;


sample output:

user@machine:~$ sh cowsayloop.sh


IP address via Curl

simple as that: user@machine:~$ curl ipcurl.com