Skip to content

Instantly share code, notes, and snippets.

Connecting to an Android device over SSH

Initial Setup on Android Device

Install Termux Android App from Google PlayStore or APK From F-Droid. Do Check out Termux GitHub

After installation

Installing and running SSH Server

@orellabac
orellabac / JSONGenie.py
Last active September 3, 2024 11:32
Streamlit Tool to help quickly build queries to flatten JSON into tables a.k.a JSONGenie
# Import python packages sqlparse snowflake-snowpark-python streamlit
# For this streamlit to work, I am assuming you have
# a database called JSON_GENIE_DB, and stage called JSON_GENIE_DB.PUBLIC.SAMPLES
# and a json file format called JSON_GENIE_DB.PUBLIC.JSON_GENIE_FILE_FORMAT.
# CREATE OR REPLACE FILE FORMAT JSON_GENIE_FILE_FORMAT
# TYPE = JSON
# NULL_IF = ()
#;
# The only thing that you need is to upload some sample files into the JSON_GENIE_DB.PUBLIC.SAMPLES stage.
(defun decompile (lines)
(let ((lines (mapcar (lambda (x)
(read-from-string (format nil "(~a)" x)))
lines)))
(let ((expr `(when (= z 0)
(return-from do-run choices)))
(inp 0))
(loop for line in (reverse lines) do
(destructuring-bind (cmd a &optional b) line
(let ((decl `(declare (type fixnum ,a))))
@nkarademir
nkarademir / RedisConfig.java
Created June 7, 2020 13:51
redis-demo-config-file
package com.trendyol.redisdemo.configuration;
import lombok.RequiredArgsConstructor;
import org.springframework.boot.autoconfigure.data.redis.RedisProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.redis.connection.RedisPassword;
import org.springframework.data.redis.connection.RedisSentinelConfiguration;
import org.springframework.data.redis.connection.lettuce.LettuceClientConfiguration;
import org.springframework.data.redis.connection.lettuce.LettuceConnectionFactory;
CALL {
USE fabric.persons
MATCH (person:Person {id: $Person})-[:KNOWS]-(friend)
RETURN collect(friend.id) AS personIds
}
WITH *, [g in fabric.graphIds() WHERE g <> 0] AS gids
UNWIND gids AS gid
CALL {
USE fabric.graph(gid)
@janweinschenker
janweinschenker / pom.xml
Last active October 8, 2020 11:05
Maven Shade plugin example
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
@gonzaloplaza
gonzaloplaza / minikube_ubuntu_installation.md
Last active February 17, 2022 06:14
Minikube installation on Ubuntu 16.04 LTS

Minikube Installation on Ubuntu 16.04 LTS

Overview:

  1. Install hypervisor (Virtualbox)
  2. Get and install Kubectl (repositories)
  3. Get and install Minikube last version
  4. Start and Test Minikube local cluster and expose demo service

Install VirtualBox hypervisor

@matthewpalmer
matthewpalmer / pod.yaml
Last active April 24, 2024 00:00
Example Kubernetes pod for the multi-container sidecar design pattern
# Example YAML configuration for the sidecar pattern.
# It defines a main application container which writes
# the current date to a log file every five seconds.
# The sidecar container is nginx serving that log file.
# (In practice, your sidecar is likely to be a log collection
# container that uploads to external storage.)
# To run:
@int128
int128 / RequestAndResponseLoggingFilter.java
Last active December 12, 2024 07:41
Spring Web filter for logging request and response
/*
Copyright 2017 Hidetake Iwata
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software