Skip to content

Instantly share code, notes, and snippets.

@zodsoft
zodsoft / Graph.scala
Created June 13, 2022 14:50 — forked from FreddieSanchez/Graph.scala
bfs/dfs implementation of a graph in Scala 3
import scala.annotation.tailrec
class Graph[A](m: Map[A, Set[A]]):
type Vertex = A
type GraphMap = Map[Vertex, Set[Vertex]]
private def neighbors(v: Vertex): List[Vertex] =
m.get(v).map(_.toList).getOrElse(List.empty[Vertex])
def search(start: Vertex, end: Vertex): Boolean =
@tailrec
def bfs(toVisit: List[Vertex], visited: List[Vertex]): Boolean =
@zodsoft
zodsoft / hex2bytes.h
Created June 23, 2022 15:33 — forked from arnobaer/hex2bytes.h
C++ infinite hex string to bytes (of any junk size)
/*
* hex2bytes - hex string of unlimited length to a continous block of bytes
* Copyright (C) 2018 Bernhard Arnold <bernhard.arnold@cern.ch>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
@zodsoft
zodsoft / AdbCommands
Created June 24, 2022 13:14 — forked from dswapnil104/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

Install Android SDK CLI Ubuntu 20.04 WSL2 (Work in Progress)

Install Java 8

sudo apt install openjdk-8-jdk-headless

Android SDK

@zodsoft
zodsoft / gist:2ae1807aa5d147a19ad0a51d93541252
Created August 30, 2023 02:54 — forked from binura-g/single-line-cert.sh
Convert Certificates ( .pem, / .crt / etc ) into single-line strings for JSON payloads
awk 'NF {sub(/\r/, ""); printf "%s\\n",$0;}' cert-name.pem
@zodsoft
zodsoft / gist:74cc552d94f0b50a1142e637747f3896
Created August 30, 2023 02:54 — forked from binura-g/single-line-cert.sh
Convert Certificates ( .pem, / .crt / etc ) into single-line strings for JSON payloads
awk 'NF {sub(/\r/, ""); printf "%s\\n",$0;}' cert-name.pem

Install Zsh and Oh-my-zsh on CentOS 7

Based on this article

ALL INSTALLATIONS ASSUME YES WHEN PROMPTED, that's what -y does

This script can be copy paste to ssh as is. No hands installation. :-)

yum install zsh -y