Skip to content

Instantly share code, notes, and snippets.

View hashhar's full-sized avatar
🐰
Working on Trino

Ashhar Hasan hashhar

🐰
Working on Trino
View GitHub Profile
@schmich
schmich / pwned-interactive.rb
Last active October 15, 2021 14:44
Check if a password has been pwned with the Pwned Passwords V2 API
# Check a single password interactively.
# Usage: ruby pwned-interactive.rb
require 'io/console'
require 'open-uri'
require 'digest'
puts "The 5-character prefix of the password's SHA-1 hash will be sent."
puts "For details, see https://www.troyhunt.com/ive-just-launched-pwned-passwords-version-2/"
print 'Password (hidden): '

Source: https://gist.github.com/findepi/04c96f0f60dcc95329f569bb0c44a0cd .

quick build

./mvnw -T2C clean install -nsu -DskipTests -Dmaven.javadoc.skip=true -Dmaven.source.skip=true -Dair.check.skip-all=true -pl '!:trino-server-rpm,!:trino-docs,!:trino-proxy,!:trino-verifier,!:trino-benchto-benchmarks'

run Trino in a container, quickly

docker rm -f trino; docker run --rm -it --name trino -p 8080:8080 trinodb/trino:438
@twolfson
twolfson / README.md
Last active April 19, 2021 01:10
generals.io strategies

We played generals.io over the weekend. It gives some solid adrenaline rushes but we are prob going to take a break from it due to that and other priorities.

Quick tips:

  • Use click + WASD to queue up traversals quickly (on your own squares you can chain it multiple times)
  • Cities repopulate if not fully captured, be sure to have +2 to city count (1 for wipe out, 1 for move in)

Here is what we learned as some strategies:

  • In 1v1, maps are set up with generals at 2 sides (e.g. North/South, East/West, Northwest/Southeast)
@bitjockey42
bitjockey42 / Ubuntu 16.04 systemd-boot.md
Last active September 25, 2019 10:07
Ubuntu 16.04 using systemd-boot instead of grubby

You do not need a separate /boot partition unless you have an LVM setup (used in dm-crypt setups).

Run ubiquity -b to open the installer with the option of skipping grub installation (since we're using systemd-boot).

When you get to the screen "Ubuntu has finished installation" choose Continue testing.

Open a Terminal.

Chroot into the new system.

@davidfowl
davidfowl / Example1.cs
Last active March 28, 2024 20:36
How .NET Standard relates to .NET Platforms
namespace Analogy
{
/// <summary>
/// This example shows that a library that needs access to target .NET Standard 1.3
/// can only access APIs available in that .NET Standard. Even though similar the APIs exist on .NET
/// Framework 4.5, it implements a version of .NET Standard that isn't compatible with the library.
/// </summary>INetCoreApp10
class Example1
{
public void Net45Application(INetFramework45 platform)
@cb372
cb372 / query.json
Created March 9, 2016 18:40
Using the Elasticsearch scroll API
{
"sort": ["_doc"],
"size": 100,
"query": {
"bool": {
"must": {
"match_all": {}
},
"filter": {
...
@jakub-g
jakub-g / hn.md
Last active January 19, 2023 04:21
Hacker News Links

Hacker News "hidden" URLs

Many of HN URLs are not easily discoverable as there are no links to them in a prominent part on the page, or sometimes even nowhere. The following is a list of links to standard and "special" HN pages. The ones is bold are the less discoverable ones.

See also: https://github.com/minimaxir/hacker-news-undocumented

Posts

@TiddoLangerak
TiddoLangerak / getCurrentWindowCWD.sh
Last active February 19, 2022 08:07
Script to get the CWD of the current active window, with support for shells running tmux. This can be used to launch new terminals in the same cwd as the current one.
#!/bin/bash
# i3 thread: https://faq.i3wm.org/question/150/how-to-launch-a-terminal-from-here/?answer=152#post-id-152
# Inspired by https://gist.github.com/viking/5851049 but with support for tmux
CWD=''
# Get window ID
ID=$(xdpyinfo | grep focus | cut -f4 -d " ")
# Get PID of process whose window this is
@shaiay
shaiay / screenlock.sh
Created September 23, 2015 19:16
a screen locker for use with xautolock which enables locking without password when connected to home wifi
#!/bin/sh
#
# example usage:
# xautolock -locker /full/path/to/screenlock.sh -corners 00-+ -detectsleep
#
# depends on xssstate which is part of suckless-tools:
# http://tools.suckless.org/ or
# apt-get suckless-tools on debian
#