IMPORTANT!

Snipt is going open source. We've toyed with this idea for quite a while, and have finally decided it's the right way to move forward.

A few things:
  • The entire Snipt source code will be released on GitHub under the 3-clause BSD License on Friday, September 10th.
  • While we'd like to think we're perfect, we realize we're only human. By open sourcing the software that runs this website, certain bugs or security flaws may be discovered that could compromise the privacy of your snipts.
  • Only the Lion Burger team will be able to push commits to the Snipt.net site. Contributors should send a pull request to add new features or submit patches.
  • By using this site, you agree not to be too angry or take any legal action against Lion Burger should this whole thing go up in flames some day.
  • Follow us on Twitter for updates.
I agree, close this message
Sign up to create your own snipts, or login.

Latest 100 public snipts » svn The latest public svn snipts.

showing 1-20 of 72 snipts for svn
  • Htaccess Private Files (svn, cvs, sql, etc)
    # Drupal's way of denying access to delicate server files
    <FilesMatch "\.(engine|inc|info|install|make|module|profile|test|po|sh|.*sql|theme|tpl(\.php)?|xtmpl|svn-base)$|^(code-style\.pl|Entries.*|Repository|Root|Tag|Template|all-wcprops|entries|format)$">
      Order allow,deny
    </FilesMatch>
    

    copy | embed

    0 comments - tagged in  posted by jrguitar21 on Aug 27, 2010 at 1:48 p.m. EDT
  • svn ignore passwords
    # on production servers its often a good idea not to store svn passwords.
    # heres a one-liner to do just that:
    echo "store-passwords=no" >> ~/.subversion/servers && rm -f ~/.subversion/auth/svn.simple/*
    

    copy | embed

    0 comments - tagged in  posted by jrguitar21 on Aug 11, 2010 at 6:14 p.m. EDT
  • grep find
    # grep find excluding .svn directories
    # from http://wordaligned.org/articles/ignoring-svn-directories
    alias gf='find . -path "*/.svn" -prune -o -type f -print0 | xargs -0 grep -I -n'
    

    copy | embed

    0 comments - tagged in  posted by jrguitar21 on Jun 15, 2010 at 9:07 p.m. EDT
  • find exclude .svn
    # exclude .svn folders with find
    find . -name "myfile*.*" \( -not -iname "*.svn*" \)
    

    copy | embed

    0 comments - tagged in  posted by jrguitar21 on Jun 15, 2010 at 8:32 p.m. EDT
  • Recursive revert all external items on svn WC
    for i in $(svn status | grep ^Perf | cut -d\' -f 2); do svn revert -R $i ; done
    

    copy | embed

    0 comments - tagged in  posted by ftassi on Jun 10, 2010 at 12:42 p.m. EDT
  • Subversion command to change repo
    svn switch --relocation http://existing/url to http://new/url
    

    copy | embed

    0 comments - tagged in  posted by timsloan on May 11, 2010 at 12:57 a.m. EDT
  • drupal files folder svn externals
    # go to working copy
    cd ~/public_html/sites/default/
    
    # take a backup
    tar zcvf files.tar.gz --exclude=.svn files
    
    # move drupal files folder out of trunk, and replace with externals, to keep trunk lightweight.
    svn mv http://svn/project/trunk/sites/default/files http://svn/project/assets/files -m "moved files folder out of trunk to assets"
    
    # delete files on working copy
    svn up
    
    # setup the external reference
    svn propset svn:externals 'files http://svn/project/assets/files' .
    
    # fetch external file
    svn up
    

    copy | embed

    0 comments - tagged in  posted by jrguitar21 on May 04, 2010 at 6:50 p.m. EDT
  • svn quickies
    # recursive add
    $ svn status | grep "^\?" | awk '{print $2}' | xargs svn add
    
    #svn revert accidental rm
    $ svn revert --recursive example_folder
    
    #svn export a repository from one location to another
    $ svn export -r <release> PathOfSvnCheckOut NewPath
    
    # remove all .svn files and folders from a tree
    find . -name ".svn" -exec rm -rf {} \;
    

    copy | embed

    0 comments - tagged in  posted by tayhimself on Apr 12, 2010 at 6:17 p.m. EDT
  • Script que remove pastas .svn de uma árvore de diretórios
    #!/bin/bash
    echo "Este script remove todos os .svn da pasta atual e subpastas."
    echo "Deseja continuar? (s/n)"
    read opt
    
    if [ $opt = "s" ];
    then
        find . -name ".svn" -type d -exec rm -rf {} \;
    else
        echo "nada a fazer"
    fi
    

    copy | embed

    0 comments - tagged in  posted by italomaia on Apr 08, 2010 at 7:18 a.m. EDT
  • Correct permissions for svn files in project
    find -name .svn -exec sudo chmod 777 {} \;
    find $(find -name .svn) -type d -exec sudo chmod 777 {} \;
    find $(find -name .svn) ! -type d -exec sudo chmod 664 {} \;
    

    copy | embed

    0 comments - tagged in  posted by mailo on Mar 02, 2010 at 8:25 a.m. EST
  • install svn on shared host
    #Install subversion on a shared host
    
    
    curl -O http://subversion.tigris.org/downloads/subversion-1.6.9.tar.gz
    curl -O http://subversion.tigris.org/downloads/subversion-deps-1.6.9.tar.gz
    curl -O http://www.openssl.org/source/openssl-0.9.8l.tar.gz
    
    tar zxvf openssl-0.9.8l.tar.gz
    tar zxvf subversion-1.6.9.tar.gz
    tar zxvf subversion-deps-1.6.9.tar.gz
    
    cd openssl-0.9.8l/
    ./config shared --prefix=$HOME/installs && make clean && make && make install
    cd ../
    
    export CFLAGS="-O2 -g -I$HOME/installs/include"
    export LDFLAGS="-L$HOME/installs/lib"
    export CPP="gcc -E -I$HOME/installs/include"
    
    cd subversion-1.6.9/neon/
    ./configure --with-ssl=openssl --prefix=$HOME/installs
    cd ../
    ./configure --with-ssl --prefix=$HOME/installs --with-neon=$HOME/installs/bin/neon-config
    make clean && make && make install
    
    echo 'store-plaintext-passwords=no' >> ~/.subversion/servers
    

    copy | embed

    0 comments - tagged in  posted by jrguitar21 on Jan 28, 2010 at 8:01 p.m. EST
  • Copy all .svn directories recursively to /tmp/svn with their dir structure
    find -name .svn -print | xargs -n1 -i cp -R --parents {} /tmp/svn
    

    copy | embed

    0 comments - tagged in  posted by mailo on Jan 22, 2010 at 5:40 a.m. EST
  • clean local copy from SVN symfony project
    1 create batch_local.txt file in project folder with this content
    for DIR in `find -name sql -type d`; do svn propset svn:ignore '*' $DIR/; done;
    for DIR in `find -name log -type d`; do svn propset svn:ignore '*' $DIR/; done;
    for DIR in `find -name cache -type d`; do svn propset svn:ignore '*' $DIR/; done;
    for DIR in `find -name base -type d`; do svn propset svn:ignore '*' $DIR/; done;
    for DIR in `find -name om -type d`; do svn propset svn:ignore '*' $DIR/; done;
    for DIR in `find -name map -type d`; do svn propset svn:ignore '*' $DIR/; done;
    svn commit -m 'change svn properties'
    svn status
    
    2 $chmod +x batch_local.txt
    3 $./batch_local.txt
    

    copy | embed

    0 comments - tagged in  posted by toledot on Jan 15, 2010 at 6:21 a.m. EST
  • clean copy of symfony project for trac by using batch command
    1 create batch_trac.txt in project folder with this content
    mv config/databases.yml config/databases.yml.sample;
    mv config/ProjectConfiguration.class.php config/ProjectConfiguration.class.php.sample;
    rm -rf cache/* log/*;
    find -name *schema.sql -exec rm -rf {} \;
    for DIR in `find -name base -type d`; do rm -rf $DIR/*;done;
    for DIR in `find -name map -type d`; do rm -rf $DIR/*;done;
    for DIR in `find -name om -type d`; do rm -rf $DIR/*;done;
    echo Clean project sucessfully! please do not forget delete all unnecessary file in project folder, For Example: *.txt for batching
    
    2 $chmod +x batch_trac.txt
    3 $./batch_trac.txt
    4 you can import these code in trac system
    

    copy | embed

    0 comments - tagged in  posted by toledot on Jan 15, 2010 at 6:18 a.m. EST
  • remove .svn folders
    find . -name ".svn" -type d -exec rm -rf {} \;
    

    copy | embed

    0 comments - tagged in  posted by jrguitar21 on Jan 06, 2010 at 11:47 a.m. EST
  • outdated drupal module with svn
    ## In a nutshell, how to update a module from Drupal contrib, 
    ## on a production site that is under revision control (subversion).
    
    # If you turn on a module (that just happens to already be
    # present in the list on admin/build/modules), then you MUST
    # 1)  go to the update status page
    # 2)  find out if the module you just turned on is up to date
    # 3)  if it is,  fine (your done! stop here),  
    # 4)  if there are updates... then go to the drupal.org site first
    #     to see if there are any "gotchas" for the upgrade.  As you'll
    #     be turning the module on for the first time on a new site,
    #     then you shouldnt have to worry too much.
    # 5)  To run the updates: login via ssh
    
    ssh username@server.com
    
    # 6) go to the right folder and execute drush update
    
    cd domains/example.com/public_html/sites/all/modules
    drush --uri=example.com update modulename
    
    # 7) confirm that the update was successful on the site
    # 8) then check in the code
    
    svn commit -u username -m "updated modulename to the latest version"
    

    copy | embed

    0 comments - tagged in  posted by jrguitar21 on Dec 23, 2009 at 4:49 p.m. EST
  • svn:ignore
    svn propset svn:ignore dirname .
    
    # If you have multiple things to ignore, separate by newlines in the property value. In that case it's easier to edit the property value using an external editor:
    

    copy | embed

    0 comments - tagged in  posted by chawei on Dec 18, 2009 at 1:11 p.m. EST
  • protect svn/cvs in apache conf
    # Protect revision controlled web projects. This version is 
    # for Apache's global configuration (conf) file. Protection
    # can also be done if you dont have access to Apache conf, 
    # in any directorie's .htaccess file, in which case,  Apache 
    # conf must aleady be configured to use htaccess.
    <DirectoryMatch "^/.*/(\.svn|CVS)/">
      Order deny,allow
      Deny from all 
    </DirectoryMatch>
    

    copy | embed

    0 comments - tagged in  posted by jrguitar21 on Dec 15, 2009 at 7:57 a.m. EST
  • svn bash shortcuts
    alias .s='svn stat'
    alias .c='svn ci -m'
    alias .u='svn up'
    alias .a='svn stat | grep "^\?" | awk "{print \$2}" | xargs svn add'
    alias .d='svn stat | grep "^\!" | awk "{print \$2}" | xargs svn delete'
    

    copy | embed

    0 comments - tagged in  posted by jrguitar21 on Dec 14, 2009 at 2:48 p.m. EST
  • divide and conquer svn repo
    # The following structure exists:
    #
    #  originalrepository/
    #    project_name/
    #      trunk/
    #      branches/
    #      tags/
    #
    # I want to move it to its *own* repository and give the following structure:
    #
    #  newrepositoryname/
    #    trunk/
    #    branches/
    #    tags/
    #
    
    export LOCAL='file:/'
    export SVN_DIR='/home/bluespark/svn'
    export SVN_OLD_REPO='originalrepository'
    export SVN_PROJ='project_name'
    export SVN_REPO='newrepositoryname'
    
    cd $SVN_DIR
    
    ## Create dumps
    mkdir $SVN_DIR/dumps
    svnadmin dump $SVN_OLD_REPO > dumps/$SVN_OLD_REPO.dump
    
    ## Filter the specific project_name out of the dump
    svndumpfilter include $SVN_PROJ \
         --drop-empty-revs \
         --preserve-revprops \
         --renumber-revs \
         < dumps/$SVN_OLD_REPO.dump \
         > dumps/$SVN_PROJ.dump
    
    ## Create the new repository...
    ## NOTE: You may need to do this step in the cpanel!!
    ## Here is how to do it on the comand line:
    # svnadmin create $SVN_DIR/$SVN_REPO
    
    
    ## Load the new repository with the contents of the
    ## filtered dump file.
    svnadmin load $SVN_REPO < dumps/$SVN_PROJ.dump
    
    
    ## Move the contens of the project_name to the repo root.
    svn mv $LOCAL/$SVN_DIR/$SVN_REPO/$SVN_PROJ/branches \
           $LOCAL/$SVN_DIR/$SVN_REPO/$SVN_PROJ/tags \
           $LOCAL/$SVN_DIR/$SVN_REPO/$SVN_PROJ/trunk \
           $LOCAL/$SVN_DIR/$SVN_REPO/ \
           -m "moved $SVN_PROJ contents to root"
    
    ## Delete the old (empty) project directory.
    ## Note:  you need to make sure the directory 
    ##        is really empty before deleting!
    svn del $SVN_DIR/$SVN_REPO/$SVN_PROJ -m "removed old project directory"
    

    copy | embed

    0 comments - tagged in  posted by jrguitar21 on Dec 14, 2009 at 2:34 p.m. EST
Sign up to create your own snipts, or login.