Let's have some command-line fun with curl, [jq][1], and the [new GitHub Search API][2].
Today we're looking for:
| git diff HEAD --ignore-space-at-eol |
| wget http://marc-stevens.nl/research/md5-1block-collision/message1.bin | |
| wget http://marc-stevens.nl/research/md5-1block-collision/message2.bin | |
| md5sum *.bin | |
| #008ee33a9d58b51cfeb425b0959121c9 message1.bin | |
| #008ee33a9d58b51cfeb425b0959121c9 message2.bin | |
| echo "some extra" > extra.txt | |
| cat message1.bin extra.txt | md5sum | |
| #c4dda4dbd429421349c0ca6172cc2e95 | |
| cat message2.bin extra.txt | md5sum | |
| #c4dda4dbd429421349c0ca6172cc2e95 |
Let's have some command-line fun with curl, [jq][1], and the [new GitHub Search API][2].
Today we're looking for:
| #!/usr/bin/env python | |
| import hashlib | |
| import optparse | |
| import paramiko | |
| from Crypto.PublicKey import RSA | |
| def insert_char_every_n_chars(string, char='\n', every=64): | |
| return char.join( |
Use case: You have repository A with remote location rA, and repository B (which may or may not have remote location rB). You want to do one of two things:
NB: Check out git subtree/git submodule and this Stack Overflow question before going through the steps below. This gist is just a record of how I solved this problem on my own one day.
Before starting, make sure your local and remote repositories are up-to-date with all changes you need. The following steps use the general idea of changing the remote origin and renaming the local master branch of one of the repos in order to combine the two master branches.
To remove a submodule you need to:
| #!/usr/bin/env python3 | |
| # -*- coding: utf-8 -*- | |
| ''' | |
| BMP Inspector: Prints BPM file information and pixel array statistics | |
| Copyright (C) 2015 Jan Marjanovic <jan@marjanovic.pro> | |
| This program is free software: you can redistribute it and/or modify | |
| it under the terms of the GNU General Public License as published by |
The repository for the assignment is public and Github does not allow the creation of private forks for public repositories.
The correct way of creating a private frok by duplicating the repo is documented here.
For this assignment the commands are:
git clone --bare git@github.com:usi-systems/easytrace.git
| # translated from: http://hg.openjdk.java.net/jdk8/jdk8/jdk/file/94cc251d0c45/src/share/npt/utf.c | |
| def utf8s_to_utf8m(string): | |
| """ | |
| :param string: utf8 encoded string | |
| :return: modified utf8 encoded string | |
| """ | |
| new_str = [] | |
| i = 0 | |
| while i < len(string): |