Skip to content

Instantly share code, notes, and snippets.

@sweetcard
sweetcard / InstanceRegistrationResource.java
Created May 6, 2024 04:07 — forked from PierreBesson/InstanceRegistrationResource.java
Eureka microservice manual registration
@RestController
@RequestMapping("registration")
public class InstanceRegistrationResource {
private final InstanceRegistrationService instanceRegistrationService;
public InstanceRegistrationResource(InstanceRegistrationService instanceRegistrationService) {
this.instanceRegistrationService = instanceRegistrationService;
}
@PostMapping("register")
###########################
# Installing Python 2.7.9 #
###########################
# https://github.com/h2oai/h2o-2/wiki/Installing-python-2.7-on-centos-6.3.-Follow-this-sequence-exactly-for-centos-machine-only
yum -y groupinstall "Development tools"
yum -y install zlib-devel
yum -y install bzip2-devel
yum -y install openssl-devel
@sweetcard
sweetcard / gist:881c4d33fd8c9a2b4462c9b6cb8dbc87
Created May 4, 2021 12:47 — forked from govert/gist:1378887
Excel-DNA Dynamic Code from string
<DnaLibrary Name="ExcelDna Test Dynamic Method" Language="C#">
<Reference Name="System.Windows.Forms" />
<![CDATA[
using System;
using System.CodeDom.Compiler;
using System.Collections.Generic;
using System.IO;
using System.Reflection;
using System.Windows.Forms;
using Microsoft.CSharp;
@sweetcard
sweetcard / Hyperlinks in a table.EXCEL.yaml
Created January 9, 2021 02:45 — forked from jakobpn/Hyperlinks in a table.EXCEL.yaml
Add hyperlinks to a column in a table.
@sweetcard
sweetcard / manual-uninstall-paragon-ntfs.sh
Created February 24, 2019 09:57 — forked from guycalledseven/manual-uninstall-paragon-ntfs.sh
Manually remove Paragon NTFS v15 leftovers MacOS
# after appcleaner does his magic, do this
sudo rm -rf "/Library/Application Support/Paragon Software/"
sudo rm /Library/LaunchDaemons/com.paragon-software.installer.plist
sudo rm /Library/LaunchDaemons/com.paragon-software.ntfs.loader.plist
sudo rm /Library/LaunchDaemons/com.paragon-software.ntfsd.plist
sudo rm /Library/LaunchAgents/com.paragon-software.ntfs.notification-agent.plist
sudo rm -rf /Library/Filesystems/ufsd_NTFS.fs/
sudo rm -rf /Library/PrivilegedHelperTools/com.paragon-software.installer
sudo rm -rf /Library/Extensions/ufsd_NTFS.kext/
@sweetcard
sweetcard / manual-uninstall-paragon-ntfs.sh
Created February 24, 2019 09:57 — forked from guycalledseven/manual-uninstall-paragon-ntfs.sh
Manually remove Paragon NTFS v15 leftovers MacOS
# after appcleaner does his magic, do this
sudo rm -rf "/Library/Application Support/Paragon Software/"
sudo rm /Library/LaunchDaemons/com.paragon-software.installer.plist
sudo rm /Library/LaunchDaemons/com.paragon-software.ntfs.loader.plist
sudo rm /Library/LaunchDaemons/com.paragon-software.ntfsd.plist
sudo rm /Library/LaunchAgents/com.paragon-software.ntfs.notification-agent.plist
sudo rm -rf /Library/Filesystems/ufsd_NTFS.fs/
sudo rm -rf /Library/PrivilegedHelperTools/com.paragon-software.installer
sudo rm -rf /Library/Extensions/ufsd_NTFS.kext/
@sweetcard
sweetcard / Communicator.h
Created December 16, 2017 12:34 — forked from rjungemann/Communicator.h
How to open a TCP socket in Objective-C
#import <Foundation/Foundation.h>
@interface Communicator : NSObject <NSStreamDelegate> {
@public
NSString *host;
int port;
}
- (void)setup;
@sweetcard
sweetcard / go_port_forwarding.go
Created June 20, 2017 09:43 — forked from qhwa/go_port_forwarding.go
network port forwarding in go lang
package main
import (
"fmt"
"io"
"net"
)
func main() {
ln, err := net.Listen("tcp", ":8080")
@sweetcard
sweetcard / main.go
Created June 20, 2017 08:55 — forked from zupzup/main.go
Go TCP Proxy / Port Forwarding Example (https://zupzup.org/go-port-forwarding/)
package main
import (
"flag"
"fmt"
"io"
"log"
"net"
"os"
"os/signal"
package pool
type Task interface {
Execute(id int)
}
type Pool struct {
tasks chan Task
kill chan bool
}