Search files in subdirectories and add them to SVN recursively
svn status | grep "^\?" | awk '{print $2}' | xargs svn add
original link: http://abhishek.nagar.me/blogs/add-files-svn-recursively-command-line
svn status | grep "^\?" | awk '{print $2}' | xargs svn add
sudo /etc/init.d/mysql stop
sudo mysqld --skip-grant-tables &
mysql -u root mysql
UPDATE user SET Password=PASSWORD('YOURNEWPASSWORD') WHERE User='root'; FLUSH PRIVILEGES; exit;
cd /etc/init.d/ # (thanks Alfonso)
sudo touch svnserve
sudo vi svnserve
svnserve -d -r /usr/local/svn/repository_name
sudo chmod +x svnserve
sudo update-rc.d svnserve defaults
Adding system startup for /etc/init.d/svnserve ...
/etc/rc0.d/K20svnserve -> ../init.d/svnserve
/etc/rc1.d/K20svnserve -> ../init.d/svnserve
/etc/rc6.d/K20svnserve -> ../init.d/svnserve
/etc/rc2.d/S20svnserve -> ../init.d/svnserve
/etc/rc3.d/S20svnserve -> ../init.d/svnserve
/etc/rc4.d/S20svnserve -> ../init.d/svnserve
/etc/rc5.d/S20svnserve -> ../init.d/svnserve
/home/svn
or
/usr/local/svn
for this purpose, and you can choose either. I
personally prefer /usr/local/svn
over /home/svn
, as I
like to keep /home for home directories of real users of the system.svn
./usr/local/svn/repos
to the
new group using the chgrp
command:svn
group also need write access to the
repos
directory, so use chmod
to add the write
permission for the group:repos
directory (in other words, anything committed
to the repositories) will also be owned by the group. To
accomplish this, use chmod
again to set the set-group-ID bit on
the directory, which causes any file created inside it to have the same group
ownership as the directory itself. Effectively, everything in
repos
will belong to the svn
group.svn
group. Go ahead and add yourself to
the group:repos
directory,
and will have its group ownership set to svn
(thanks to the
chmod g+s
you did earlier). However, that's not all – you also
need to make sure the repository will be group writable, so that the other
members of the svn
group will be able to commit files. To do this,
set the umask to 002
:022
and it corresponds to read/write permissions for the file
owner, and read permissions for the group and others. The new value,
002
, also gives write permissions to the group, which is just what
you need.svnadmin
command:test
. Go ahead and create a simple "hello world" text file in that
directory:svn add
command:svn commit
:hello.txt
file is now in the repository.svnserve
, a Subversion server program. Each repository has a
svnserve
configuration file (stored in the conf
subdirectory) which controls how the repository can be accessed with svnserve
.root
), so change its
mode to 600
:svnserve
configuration file in the test
repository:anon-access = none
line denies access to the repository to
unauthenticated users (by default, they are allowed read access, so they can do
checkouts). The password-db
setting tells svnserve where to look
for the passwords file when authenticating users, and the realm
setting defines the name of the authentication realm. svnserve
.svnserve
to run in daemon mode
(-d
) as a foreground process (--foreground
), and to
look for repositories in the repos
dir that was created earlier
(-r /usr/local/svn/repos
). Normally the program should be running
in the background (that's what daemon processes do), but at this moment you
only need to test it, so it's more convenient to run it in the foreground,
where you can easily kill it with Ctrl
+C
. cd
to some
other location.svn checkout
command, replacing
192.168.10.11
with the IP address of your Subversion server (if
you're testing on the same machine, you can use 127.0.0.1
):hello.txt
with a text editor and add some text:svnserve
program. Assuming you have a SSH server
running on the Subversion machine, and the other developers can login to it,
you don't have to configure anything – just set up the repository.passwd-team
file.svn
protocol.svnserve
in the long run, you
probably don't want to start it from the command-line every time the
server is rebooted. The proper way to start system services is with init
scripts located in the /etc/init.d
directory./etc/init.d/svnserve
and make it executable:/usr/local/svn/repos
for the repositories directory, make sure to change the path in the init script.update-rc.d
to install the script:svnserve
will be started automatically when your system boots up. To start it manually, run this command: sudo chmod g+w /media/datadrive
sudo chmod +t /media/datadrive
The last "chmod +t" adds the sticky bit, so that people can only delete their own files and sub-directories in a directory, even if they have write permissions to it (see man chmod).
sudo gedit /etc/fstab
sudo passwd
Sudo will prompt you for your password, and then ask you to supply a new password for root as shown below:
[sudo] password for username: (enter your own password)
Enter new UNIX password: (enter a new password for root)
Retype new UNIX password: (repeat new password for root)
passwd: password updated successfully
sudo passwd -l root
man sudo
sudo adduser username
sudo deluser username
sudo passwd -l username sudo passwd -u username
sudo addgroup groupname sudo delgroup groupname
sudo adduser username groupname
R: Switch to XLATE mode
E: Send Terminate signal to all processes except for init
I: Send Kill signal to all processes except for init
S: Sync all mounted file-systems
U: Remount file-systems as read-only
B: Reboot
REISUB is BUSIER backwards, as in "The System is busier than it should be", if you need to remember it. Or mnemonically - R eboot; Even; If; System; Utterly; Broken.~/.profile
:
~/.bashrc
:
/etc/profile
:
/etc/profile.d/
: ~/.MacOSX/environment.plist
: this is read by login window on
login. It applies to all applications, including GUI ones, except those
launched by Spotlight in 10.5 (not 10.6). It requires you to logout and
login again for changes to take effect. This file is no longer
supported as of OS X 10.8. launchd
instance: this applies to all programs launched by the user, GUI and
CLI (command line interface). You can apply changes at any time by using
the setenv
command in launchctl
. In theory, you should be able to put setenv
commands in ~/.launchd.conf
, and launchd
would read them automatically when the user logs in, but in practice
support for this file was never implemented. Instead, you can use
another mechanism to execute a script at login, and have that script
call launchctl
to set up the launchd
environment.
/etc/launchd.conf
: this is read by launchd when the system
starts up and when a user logs in. They affect every single process on
the system, because launchd is the root process. To apply changes to the
running root launchd you can pipe the commands into sudo launchctl
.