Skip to content

Instantly share code, notes, and snippets.

View sohlich's full-sized avatar
🏠
Working from home

Rado Sohlich sohlich

🏠
Working from home
View GitHub Profile
Registered Name: https://zhile.io
License Key: 48891cf209c6d32bf4
@sohlich
sohlich / readme.md
Created January 28, 2020 06:23
Let's encrypt - generate SSL certificate manually via Cerbot DNS Challenge

Install Certbot

OSX

$ brew install certbot

Linux

<div [formGroup]="form">
<div class="container" formArrayName="optional">
<div class="row">
<div class="col-md">
<div class="buttons pull-right">
<button type="button" *ngIf="!showEdit" class="close" (click)="showEdit = true">
<span aria-hidden="true" class="fa fa-pencil"></span>
</button>
<div class="btn-edit-group">
@sohlich
sohlich / after_transaction_hook
Created May 28, 2018 06:03
spring - hook on transaction commit
TransactionSynchronizationManager.registerSynchronization(new TransactionSynchronizationAdapter(){
public void afterCommit(){
List<Ontology> markets = ontologyRepository.findAll(dtoList
.stream()
.map(MarketDTO::getMarketId)
.collect(Collectors.toList()));
log.info("Indexing markets after deferral configuration: {}",markets.size());
ontologyIndexRepository.indexList(markets);
}
});
@sohlich
sohlich / cmd_execute.go
Created March 12, 2018 05:54
executing command line cmds
cmd := "cat " + val.Name() + " | jq ."
out, err := exec.Command("bash", "-c", cmd).Output()
@sohlich
sohlich / db2_error_codes
Created October 3, 2017 07:40
DB2 error codes and reason description
DB2 SQL-Error: -007 SQLState: 42601
Short Description: STATEMENT CONTAINS THE ILLEGAL CHARACTER
The specified 'character' is not a valid character in SQL statements. System action: The statement cannot be executed. Programmer response: Correct the syntax and resubmit the statement. Refer to Chapter 2 of DB2 SQL Reference for information about the valid SQL character set.
DB2 SQL-Error: -010 SQLState: 42603
Short Description: THE STRING CONSTANT BEGINNING IS NOT TERMINATED
The statement contains a string constant, beginning with 'string', that is not terminated properly. System action: The statement cannot be executed. Programmer response: Examine the statement for missing quotation marks or apostrophes in the indicated string constant.
DB2 SQL-Error: -029 SQLState: 42601
Short Description: INTO CLAUSE REQUIRED
# Go parameters
GOCMD=go
GOBUILD=$(GOCMD) build
GOCLEAN=$(GOCMD) clean
GOTEST=$(GOCMD) test
GOGET=$(GOCMD) get
BINARY_NAME=mybinary
BINARY_UNIX=$(BINARY_NAME)_unix
@sohlich
sohlich / gist:6f3bb4385337d9459c4efe5da5e08e55
Created July 31, 2017 03:01
Uninstall XQuartz.app from OSX Yosemite/El Capitan/Sierra
launchctl unload /Library/LaunchAgents/org.macosforge.xquartz.startx.plist && \
sudo launchctl unload /Library/LaunchDaemons/org.macosforge.xquartz.privileged_startx.plist && \
sudo rm -rf /opt/X11* /Library/Launch*/org.macosforge.xquartz.* /Applications/Utilities/XQuartz.app /etc/*paths.d/*XQuartz && \
sudo pkgutil --forget org.macosforge.xquartz.pkg && \
rm -rf ~/.serverauth* && rm -rf ~/.Xauthorit* && rm -rf ~/.rnd && \
rm -rf ~/Library/Caches/org.macosforge.xquartz.X11 && rm -rf ~/Library/Logs/X11
@sohlich
sohlich / cookie_jar_golang
Created April 5, 2017 06:58 — forked from varver/cookie_jar_golang.go
Login to a website with this golang code using persistent cookies or cookie jar .
// Creates a new serve mux
mux := http.NewServeMux()
// Create room for static files serving
mux.Handle("/node_modules/", http.StripPrefix("/node_modules", http.FileServer(http.Dir("./node_modules"))))
mux.Handle("/html/", http.StripPrefix("/html", http.FileServer(http.Dir("./html"))))
mux.Handle("/js/", http.StripPrefix("/js", http.FileServer(http.Dir("./js"))))
mux.Handle("/ts/", http.StripPrefix("/ts", http.FileServer(http.Dir("./ts"))))
mux.Handle("/css/", http.StripPrefix("/css", http.FileServer(http.Dir("./css"))))