Skip to content

Instantly share code, notes, and snippets.

View SeongJuMoon's full-sized avatar

Seongju Mun SeongJuMoon

View GitHub Profile
@SeongJuMoon
SeongJuMoon / arm64-on-Win10.md
Created October 27, 2024 06:00 — forked from billti/arm64-on-Win10.md
ARM64 Linux on Win10

Below are the steps to get an ARM64 version of Ubuntu running in the QEMU emulator on Windows 10.

Install QEMU

Install for Windows from https://qemu.weilnetz.de/w64/ (I used qemu-w64-setup-20181211.exe)

Put C:\Program Files\qemu on your PATH, and run the below to check it's working (which will list out the CPUs the AArch64 emulator can emulate):

qemu-system-aarch64 -M virt -cpu help

Brew Bundle Brewfile Tips

Copyright & License

Unless otherwise noted (either in this file or in a file's copyright section) the contents of this gist are Copyright ©️2020 by Christopher Allen, and are shared under spdx:Creative Commons Attribution Share Alike 4.0 International (CC-BY-SA-4.) open-source license.

Sponsor

If you more tips and advice like these, you can become a monthly patron on my GitHub Sponsor Page for as little as $5 a month; and your contributions will be multipled, as GitHub is matching the first $5,000! This gist is all about Homebrew, so if you like it you can support it by donating to them or becoming one of their Github Sponsors.

@SeongJuMoon
SeongJuMoon / ..git-pr.md
Created July 26, 2022 06:56 — forked from gnarf/..git-pr.md
git pr - Global .gitconfig aliases for Pull Request Managment

Install

Either copy the aliases from the .gitconfig or run the commands in add-pr-alias.sh

Usage

Easily checkout local copies of pull requests from remotes:

  • git pr 4 - creates local branch pr/4 from the github upstream(if it exists) or origin remote and checks it out
  • git pr 4 someremote - creates local branch pr/4 from someremote remote and checks it out
@SeongJuMoon
SeongJuMoon / install-squid.sh
Created July 20, 2022 03:34 — forked from bl4ck5un/install-squid.sh
Install a basic squid proxy with authentication on Centos 6 x64. Just modify the variables at the top and run the script on a clean system.
#!/bin/sh
PROXY_USER=user
PROXY_PASS=password
PROXY_PORT=3128
# Clear the repository index caches
yum clean all
# Update the operating system
@SeongJuMoon
SeongJuMoon / HdfsUtil.scala
Created December 13, 2021 08:34 — forked from rubanm/HdfsUtil.scala
Finding webhdfs endpoint for a file with HA namenode
import org.apache.hadoop.hdfs.DFSUtil
import org.apache.hadoop.mapred.JobConf
import org.slf4j.LoggerFactory
import java.net.{ HttpURLConnection, InetSocketAddress, URL }
import scala.collection.JavaConverters._
import scala.util.Try
/**
* Detects the currently active namenode and returns its webhdfs url for the specified path.
const http = require('http');
const envWriter = (res) => {
for (const item in process.env) {
res.write(`${item} = ${process.env[item]}\n`);
}
};
http.createServer((req, res) => {
res.writeHead(200);
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
#!/bin/bash
LIST=$(echo "<spec1>,<spec2>," | tr "," "\n")
if [ -z $(which yq) ]; then
echo "yq is not installed"
exit 128
else
for DISCOVERY in $LIST
do
package main
import (
"fmt"
"strings"
)
type StringFunc func(a string) string
func Compose(f StringFunc, g StringFunc) StringFunc {
@SeongJuMoon
SeongJuMoon / packer-ami-id
Created December 18, 2019 01:20 — forked from danrigsby/packer-ami-id
Get AMI ID from a packer build
packer build packer.json 2>&1 | sudo tee output.txt
tail -2 output.txt | head -2 | awk 'match($0, /ami-.*/) { print substr($0, RSTART, RLENGTH) }' > sudo ami.txt