Skip to content

Instantly share code, notes, and snippets.

@tomkul
tomkul / AdbCommands
Created April 25, 2022 22:49 — forked from Pulimet/AdbCommands
Adb useful commands list
adb help // List all comands
== Adb Server
adb kill-server
adb start-server
== Adb Reboot
adb reboot
adb reboot recovery
adb reboot-bootloader
@tomkul
tomkul / Jenkinsfile
Created November 26, 2020 14:18 — forked from merikan/Jenkinsfile
Some Jenkinsfile examples
Some Jenkinsfile examples
@tomkul
tomkul / css-selectors.md
Created October 22, 2020 18:10 — forked from magicznyleszek/css-selectors.md
CSS Selectors Cheatsheet

CSS Selectors Cheatsheet

Element selectors

Element -- selects all h2 elements on the page

h2 {
    foo: bar;
@tomkul
tomkul / 0.suffixtree.cs
Created January 27, 2020 10:41 — forked from axefrog/0.suffixtree.cs
C# Suffix tree implementation based on Ukkonen's algorithm. Full explanation here: http://stackoverflow.com/questions/9452701/ukkonens-suffix-tree-algorithm-in-plain-english
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
namespace SuffixTreeAlgorithm
{
public class SuffixTree
{
@tomkul
tomkul / ScriptRunner.java
Created November 26, 2019 11:45 — forked from gustavohenrique/ScriptRunner.java
Run sql command from java
/*
* Slightly modified version of the com.ibatis.common.jdbc.ScriptRunner class
* from the iBATIS Apache project. Only removed dependency on Resource class
* and a constructor
*/
/*
* Copyright 2004 Clinton Begin
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@tomkul
tomkul / gremlin-cheat-sheet.md
Created October 8, 2019 07:53 — forked from jeremysears/gremlin-cheat-sheet.md
Gremlin Cheat Sheet in Groovy

Gremlin Cheat Sheet in Groovy

Gremin traversal examples taken from the excellent DS330: DataStax Enterprise Graph course.

Creating Vertices and Vertex Properties

Add a Vertex

Vertex u = graph.addVertex("user");
       u.property("userId","u2016");
 u.property("age",36);
@tomkul
tomkul / dse-graph-schema-cheat-sheet.md
Last active September 9, 2019 15:38 — forked from jeremysears/dse-graph-schema-cheat-sheet.md
DSE Graph Schema Management Cheat Sheet in Gremlin Groovy

DSE Graph Schema Management Cheat Sheet in Gremlin Groovy

DSE Graph schema management examples taken from the excellent DS330: DataStax Enterprise Graph course.

Graph Definition

List all graph names:

system.graphs();  // => KillrVideo

Describe all graphs:

@tomkul
tomkul / check-gzip.sh
Created August 7, 2019 10:24 — forked from timendum/check-gzip.sh
Check if gzip is enabled [ http bash curl ]
curl -I -H "Accept-Encoding: gzip,deflate" "$URL" --silent | grep -i "Content-Encoding:"
# OR
curl -H "Accept-Encoding: gzip,deflate" "$URL" --silent --write-out "%{size_download}" --output /dev/null
curl "$URL" --silent --write-out "%{size_download}" --output /dev/null
# 2nd must be greater the 1st
@tomkul
tomkul / README.md
Created August 6, 2019 20:23 — forked from ivan-loh/README.md
netcat tcp proxy, for mapping ports on a remote machine to a local machine

Helper script to map ports to other servers.

Use Case

had a database that was only accesible in the VPC on aws, so i created an dev intance and did a ssh tunnel to that dev instance with netcat mapping the port to the database

Sample Usage

Forward all request from local 5432 to remote host google.com port 80

./nc-proxy.sh 5432 google.com 80
@tomkul
tomkul / java_rsa.java
Created July 1, 2019 17:31 — forked from codeachange/java_rsa.java
RSA encrypt and decrypt in JAVA
package tests;
import org.apache.commons.codec.binary.Base64;
import javax.crypto.Cipher;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.security.KeyFactory;
import java.security.PrivateKey;