Skip to content

Instantly share code, notes, and snippets.

@ktuukkan
ktuukkan / maven-settings.xml
Last active September 20, 2018 13:11
Maven config for snapshot dependencies / Sonatype Nexus
<settings>
...
<activeProfiles>
<activeProfile>nexus</activeProfile>
</activeProfiles>
...
<profiles>
<profile>
<id>nexus</id>
<repositories>
@nilswindisch
nilswindisch / update_nativefier.sh
Created January 28, 2017 10:49
Update nativefier
#!/bin/bash
echo "Updating nativefier globally"
npm update -g nativefier@latest
echo "nativefier updated"
@antonio-petricca
antonio-petricca / SVN_Git_Mirror.md
Created October 3, 2018 09:36 — forked from ticean/SVN_Git_Mirror.md
SVN Git Mirror

Create Git Mirror from SVN Repository

This guide will demonstrate how to mirror an SVN into a Git repo. You're the target audience if you're an SVN user, just getting started with Git and need to coax your project team over to Git.

The branching scenario has been simplified for clarity.

References

@c0mpiler
c0mpiler / install-docker-rhel7.sh
Created March 6, 2018 19:47
Install Docker CE on RHEL
# pre-requisite for container-selinux-2.9-4.el7.noarch.rpm
sudo yum install policycoreutils-python
wget http://mirror.centos.org/centos/7/extras/x86_64/Packages/container-selinux-2.21-1.el7.noarch.rpm
sudo rpm -i container-selinux-2.21-1.el7.noarch.rpm
#Set up the Docker CE repository on RHEL:
sudo yum install -y yum-utils
sudo yum install -y device-mapper-persistent-data lvm2
sudo yum-config-manager --enable rhel-7-server-extras-rpms
@shahpoojan
shahpoojan / usb.cpp
Created July 6, 2011 12:57
A code to send data on the USB port for Windows
#include <iostream>
#include <string>
#include <Windows.h>
#include <tchar.h>
#include <stdio.h>
#include <Winbase.h>
HANDLE hCom;
DWORD sendData (const char* data, DWORD size)
@samarpanda
samarpanda / Debugging_Nginx.md
Last active March 16, 2020 13:24
Debugging Nginx Configuration!

Debugging Nginx Configuration

  • Set Nginx log-level to debug

    server {  
      error_log /var/logs/nginx/samar.error.log  debug;  
    }  
    # Word of caution: Don't forget to revert debug-level for error_log on a *very* high traffic site.  
@treyturner
treyturner / parseUri.groovy
Last active April 9, 2020 09:30
Groovy: Parse a URL while including a handy map of the query string
/**
* Created by tturner on 7/22/15.
*/
import groovy.json.*
static def parseQueryString(String string) {
string.split('&').collectEntries{ param ->
param.split('=', 2).collect{ URLDecoder.decode(it, 'UTF-8') }
}
@matthewmccullough
matthewmccullough / settings.xml
Created April 13, 2009 19:41
Maven settings.xml Mirror Setup for Nexus
<mirrors>
<mirror>
<!--This is used to direct the public snapshots repo in the profile below over to a different nexus group -->
<id>nexus-public-snapshots</id>
<mirrorOf>public-snapshots</mirrorOf>
<url>http://localhost:8081/nexus/content/groups/public-snapshots</url>
</mirror>
<mirror>
<!--This sends everything else to /public -->
<id>nexus-public-releases</id>
@I3rixon
I3rixon / Main.java
Created July 29, 2013 00:46
pretty output of hexdump like in Java
public static void prettyOut(byte[] msg) {
for (int j = 1; j < msg.length+1; j++) {
if (j % 8 == 1 || j == 0) {
if( j != 0){
System.out.println();
}
System.out.format("0%d\t|\t", j / 8);
}
System.out.format("%02X", msg[j-1]);
if (j % 4 == 0) {
@christophercurrie
christophercurrie / Polymorph.java
Created February 11, 2014 17:20
Example of Polymorphic Deserialization using Jackson
import com.fasterxml.jackson.annotation.JsonSubTypes;
import com.fasterxml.jackson.annotation.JsonTypeInfo;
import com.fasterxml.jackson.databind.PropertyNamingStrategy;
import com.fasterxml.jackson.databind.annotation.JsonNaming;
@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type")
@JsonSubTypes({
@JsonSubTypes.Type(value=AudioAttachment.class, name="audio"),
@JsonSubTypes.Type(value=LinkAttachment.class, name="link")