The First SHA1 Collision

CWI Institute in Amsterdam and Google genrate two PDF documents with the same SHA-1 digest. Google security blog - Announcing the first SHA1 collision SHA-1 collistion and Git If a file A with X hash in local repository and with X hash in remote (SHA-1 collistion between local and remote), would overwrite the local version? Nope. If it has the same SHA1, it means that when we receive the object from the other end, we will not overwrite the object we already have....

March 3, 2017 · 4 min · oopsmonk

Using Git With Multiple SSH Keys and Accounts

Generating SSH keys for GitHub Here are github account and work account. GitHub: SSH Key: github_id_rsa Account: oopsmonk Work: SSH Key: work_id_rsa Account: SamChen Add SSH config File Modify ~/.ssh/config # Default github Host github.com HostName github.com PreferredAuthentications publickey IdentityFile ~/.ssh/github_id_rsa # Work git server Host work.gitserver.com HostName work.gitserver.com PreferredAuthentications publickey IdentityFile ~/.ssh/work_id_rsa Git Repository Configuation GitHub Project: $ git clone https://github.com/abc/projectA.git $ cd projectA #github account $ git config user....

December 12, 2014 · 1 min · oopsmonk

GitHub SVN Upstream (on Ubuntu12.04)

This is a git tutorial, create svn upstream on GitHub. Use MOC project as a example. #Checkout SVN and push to GitHub. Install packages $ sudo apt-get install subversion git-svn Create git repository (it will take a long time) $ git svn clone svn://daper.net/moc/trunk --no-metadata ./moc-svn-git $ cat moc-svn-git/.git/config [core] repositoryformatversion = 0 filemode = true bare = false logallrefupdates = true [svn-remote "svn"] noMetadata = 1 url = svn://daper.net/moc/trunk fetch = :refs/remotes/git-svn Update SVN repository...

August 26, 2013 · 2 min · oopsmonk

Add Git SHA1 property in Apache ANT build.xml

Create git.SHA1 property in build.xml file. <available file=".git" type="dir" property="git.present"/> <target name="git.info" description="Store git info" if="git.present"> <exec executable="git" outputproperty="git.SHA1" failifexecutionfails="false" errorproperty=""> <arg value="log"/> <arg value="--pretty=oneline"/> <arg value="-n1"/> </exec> <condition property="git.version" value="${git.SHA1}" else="unknown"> <and> <isset property="git.SHA1"/> <length string="${git.SHA1}" trim="yes" length="0" when="greater"/> </and> </condition> <echo message="print git log : " /> <echo message="${git.SHA1}" /> </target> Reference: How to lookup the latest git commit hash from an ant build script

June 13, 2013 · 1 min · oopsmonk