Skip to content

Instantly share code, notes, and snippets.

View Hoto-Cocoa's full-sized avatar
🚙
Driving

Cocoa Hoto Hoto-Cocoa

🚙
Driving
View GitHub Profile
@masak
masak / explanation.md
Last active April 11, 2024 02:50
How is git commit sha1 formed

Ok, I geeked out, and this is probably more information than you need. But it completely answers the question. Sorry. ☺

Locally, I'm at this commit:

$ git show
commit d6cd1e2bd19e03a81132a23b2025920577f84e37
Author: jnthn <jnthn@jnthn.net>
Date:   Sun Apr 15 16:35:03 2012 +0200

When I added FIRST/NEXT/LAST, it was idiomatic but not quite so fast. This makes it faster. Another little bit of masak++'s program.

@richieforeman
richieforeman / makeauthority.sh
Created July 23, 2012 21:38
Issue Your Own Self-Signed S/MIME Certs with OpenSSL
# Run this once
openssl genrsa -des3 -out ca.key 4096
openssl req -new -x509 -days 365 -key ca.key -out ca.crt
@xtranophilist
xtranophilist / sms
Created April 12, 2013 18:24
Android SMS backup/restore w/ adb
#Backup:
adb remount
adb pull /data/data/com.android.providers.telephony/databases/mmssms.db mmssms.db
#Restore:
adb remount
adb push mmssms.db /data/data/com.android.providers.telephony/databases/mmssms.db
@vaskoz
vaskoz / StringHashCollisionGenerator.java
Created June 4, 2013 03:44
Generates Java Strings with the same hashCode.
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
public class StringHashCollisionGenerator {
public static void main(String[] args) {
if (args.length != 1) {
printUsage();
System.exit(1);
@plentz
plentz / nginx.conf
Last active April 24, 2024 11:15
Best nginx configuration for improved security(and performance)
# to generate your dhparam.pem file, run in the terminal
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048
@dduleone
dduleone / l+kemoi.txt
Created January 30, 2014 20:05
L&K Emoji
Raͩnͤsͣoͭmͪ
A
 aͣ bͣ cͣ dͣ eͣ fͣ gͣ hͣ iͣ jͣ kͣ lͣ mͣ nͣ oͣ pͣ qͣ rͣ sͣ tͣ uͣ vͣ wͣ xͣ yͣ zͣ
E
 aͤ bͤ cͤ dͤ eͤ fͤ gͤ hͤ iͤ jͤ kͤ lͤ mͤ nͤ oͤ pͤ qͤ rͤ sͤ tͤ uͤ vͤ wͤ xͤ yͤ zͤ
I
 aͥ bͥ cͥ dͥ eͥ fͥ gͥ hͥ iͥ jͥ kͥ lͥ mͥ nͥ oͥ pͥ qͥ rͥ sͥ tͥ uͥ vͥ wͥ xͥ yͥ zͥ
@protrolium
protrolium / YouTube API — getting video thumbnail
Created February 5, 2014 19:57
YouTube API — getting video thumbnail
Each YouTube video has 4 generated images. They are predictably formatted as follows:
http://img.youtube.com/vi/<insert-youtube-video-id-here>/0.jpg
http://img.youtube.com/vi/<insert-youtube-video-id-here>/1.jpg
http://img.youtube.com/vi/<insert-youtube-video-id-here>/2.jpg
http://img.youtube.com/vi/<insert-youtube-video-id-here>/3.jpg
The first one in the list is a full size image and others are thumbnail images. The default thumbnail image (ie. one of 1.jpg, 2.jpg, 3.jpg) is:
http://img.youtube.com/vi/<insert-youtube-video-id-here>/default.jpg
@johnko
johnko / gist:66515a2db2aa22aa51bd
Last active November 26, 2021 17:16
How to iPXE boot from http iso on www.vultr.com

If your custom iso is not mounting, and your console is at an iPXE shell, you can:

initrd http://mfsbsd.vx.sk/files/iso/10/amd64/mfsbsd-se-10.1-RELEASE-amd64.iso

While the iso is downloading, vultr's iPXE does not include memdisk, so we have to upload it ourselves to another host.

Here's one I found public, though I wouldn't recommend using it: http://preseed.panticz.de/ipxe/memdisk

@felquis
felquis / url-schemes.md
Last active April 15, 2024 06:38
iOS, Android browser apps URL Schemes to handle URL between browsers, and apps..

Assume the user is on a mobile device iOS Safari (Or other browser), but you want a link to open into any other specific mobile browser app like Chrome, Safari, Firefox, Opera, Arc... How do you do that?

Chrome

To open on Chrome

<a href="googlechrome://example.com">try it on Chrome</a>

check out Chrome iOS Docs for more information

Experimental Docker Libnetwork DHCP Driver

The DHCP driver is intended for users to be able to integrate Docker IP address management with their existing IPAM strategies that use DHCP for dynamic address assignment. DHCP enables users to allocate addresses in an organized fashion that will prevent overlapping IP address assignment by associating a unique MAC address from the container eth0 Ethernet interface to an IP address as determined by the DHCP pools defined in the DHCP configuration.

This driver only provides the DHCP client functionality. It does not include a DHCP server. The default driver offers single-host IPAM or for distributed multi-host orchestrated IPAM see the libnetwork overlay driver.

Getting Started