Skip to content

Instantly share code, notes, and snippets.

View ryanhs's full-sized avatar

ryan hs ryanhs

  • PT Astra Internasional
  • Jakarta
View GitHub Profile
@ryanhs
ryanhs / create_table.sql
Created January 9, 2024 17:04
twingate athena
CREATE EXTERNAL TABLE twingate_logs (
`event_type` string,
`event` struct<
`time`:string,
`action`:string,
`actor`:struct<`type`:string,`id`:string>,
`targets`:array<
struct<
`version`:string,
`type`:string,
@ryanhs
ryanhs / sh.sh
Created December 24, 2023 07:34
fixing helm pending upgrade
helm -n user-myappspace list --all
helm -n user-myappspace history myapp
> check for which revision is still truggling, example: 9 - preparing upgrade
helm -n user-myappspace rollback myapp 9
@ryanhs
ryanhs / postman_installation.md
Created October 7, 2023 16:12 — forked from Akhil-Suresh/postman_installation.md
Installing Postman on Ubuntu/Debian

Installing Postman

Step 1

If any version of postman is installed we need to remove it

sudo rm -rf /opt/Postman

Step 2

@ryanhs
ryanhs / index.html
Created October 2, 2023 06:24 — forked from nfarring/index.html
Ubuntu Apache default index.html file
<html><body><h1>It works!</h1>
<p>This is the default web page for this server.</p>
<p>The web server software is running but no content has been added, yet.</p>
</body></html>
@ryanhs
ryanhs / grant.sql
Last active May 10, 2023 04:18
postgre grants example
CREATE USER someuser WITH PASSWORD 'somepass';
GRANT ALL PRIVILEGES ON DATABASE somedb to someuser;
-- on database
GRANT ALL PRIVILEGES ON ALL TABLES IN SCHEMA public TO someuser;
GRANT ALL PRIVILEGES ON ALL SEQUENCES IN SCHEMA public TO someuser;
@ryanhs
ryanhs / .bashrc
Created April 11, 2023 08:03
bashrc nvm
# --------------------------------------------------------------------------------------------------
export LANGUAGE=en_US.UTF-8
export LC_ALL=en_US.UTF-8
export EDITOR=nano
# node comes first!
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
@ryanhs
ryanhs / cli.sh
Created March 21, 2023 07:47
azure cli on docker
docker run --rm -v "$HOME/.azure:/root/.azure:z" mcr.microsoft.com/azure-cli az account show
@ryanhs
ryanhs / hashes.js
Created March 11, 2023 05:12
nodejs hashes compare
// using node v16.19.1
const crypto = require('node:crypto');
const algos = crypto.getHashes();
const plain = 'abcd';
const results = algos
.map(algo => ({
algo,
syft packages dir:/var/lib/dpkg --output cyclonedx-json="$HOSTNAME.cdx.json"
syft packages dir:/var/lib/dpkg --output syft-json="$HOSTNAME.syft.json"
grype db status
grype db update
syft acme-web-1 --output syft-json=acme-web-1.syft.json
@ryanhs
ryanhs / chmod-ssh.sh
Created March 2, 2023 14:28
SSH .ssh fix permissions
#!/bin/sh
chmod 700 ~/.ssh
chmod 600 ~/.ssh/id_rsa
chmod 600 ~/.ssh/id_rsa.pub