Blog Spot!


SVN: How to setup a Subversion server

Links

Setup

Steps I did to set up a working SVN server on my Linux server.

Installation

sudo apt-get install subversion

Set up the repository directory

# create the directory for your repositories
sudo mkdir -p /var/svn/repos

Set needed permissions

# create a group to manage the repository
# and set the ownership and permissions
sudo addgroup svn
sudo chown -R :svn /var/svn/repos/
sudo chmod -R 2775 /var/svn/repos/
# add your user to this group
sudo adduser ${USER} svn
# add the group to your user
sudo usermod -aG svn ${USER}

Create a new repository using svnadmin

svnadmin create /var/svn/repos/project_name

You can connect to the repository using the svn+ssh protocol. The URL would be in this format: svn+ssh://your-ip/var/svn/repos/projec_name.

If you are on the same machine you can directly target the repo directory - svn co file:///var/svn/repos/demo/.

In each repository there is a directory called conf where you can set permissions and credentials.

conf/svnserve.conf

anon-access = none
auth-access = write
password-db = passwd

conf/passwd

# add users in the format : user = password
tony = mypassword

Start the SVN Server as Daemon

svnserve -d

To import a project

svn import /projects/projec_name svn://your-ip/var/svn/repos/projec_name`.

To checkout a repository

svn co svn://your-ip/var/svn/repos/projec_name

Since we set anon-access to none you should be prompted for username and password which you created in the file conf/passwd.

Added on 11.Nov.2025
Tags: svn subversion server

GNU/Linux Screen shortcuts

Key bindings from the article. Short version.

Added on 02.Mar.2023
Tags: screen shortcuts linux terminal

Use .htaccess to redirect to URL provided as a query string

When we hit http://domain1.com/?url=domain2.com server must redirect to http://domain2.com/

.htaccess content

RewriteEngine on
RewriteBase /
RewriteCond %{QUERY_STRING} ^url=(.*)$ [NC]
RewriteRule ^$ http://%1? [NC,L,R]

Added on 01.Dec.2022
Tags: htaccess apache URL redirect

Middleware execution variations

middleware is an Array of fn(req, res, next)

Sequential execution

for (const fn of middleware) {
    await new Promise(r => fn(req, res, () => r(true)))
}

Concurrent execution

return Promise.all(middleware.map(fn => {
    return new Promise(resolve => {
        fn(req, res, () => resolve(true));
    })
}));

Added on 23.Nov.2022
Tags: code middleware js quark sequential concurrent

Command to display Memory usage, Disk Usage and CPU Load

#!/bin/sh
free -m | awk 'NR==2{printf "Memory Usage: %s/%sMB (%.2f%%)\n", $3,$2,$3*100/$2 }'
df -h | awk '$NF=="/"{printf "Disk Usage: %d/%dGB (%s)\n", $3,$2,$5}'
top -bn1 | grep load | awk '{printf "CPU Load: %.2f\n", $(NF-2)}' 

Save the above as a script and run it, you will get:

$ ./foo.sh 
Memory Usage: 4986/7994MB (62.37%)
Disk Usage: 23/68GB (35%)
CPU Load: 0.78
  • Note that the script above is giving the disk usage for the / partition.
  • The details may vary depending on the implementation of these tools in the OS.

stackexchange

Added on 17.Aug.2022
Tags: linux load telemetry bash script

Search


PHP Libraries


Carbon lib / docs
Idiorm lib / docs
Image Workshop lib / docs
lorenzos/Minixed lib / docs
Parsedown lib / docs
PHP Paginator lib / docs
PHP Redis lib / docs
QrCode lib / docs
Requests lib / docs
Slim lib / docs
Spyc lib / docs
TWIG lib / docs
Upload lib / docs
Validation lib / docs
Zebra Image lib / docs

JS Libraries


AJV lib / docs
BackboneJS lib / docs
Bootstrap Notify lib / docs
C3.js lib / docs
ChartJS lib / docs
FastMD5 lib / docs
HighlightJS lib / docs
jQuery-Storage lib / docs
JS-Cookie lib / docs
Leaflet JS lib / docs
LowDB lib / docs
Marked lib / docs
NeedlyJS lib / docs
ParcelJS lib / docs
RequireJS lib / docs
Swig lib / docs
Toastr lib / docs
Underscore lib / docs
ValidateJS lib / docs
top