Skip to content

Instantly share code, notes, and snippets.

View niko-dunixi's full-sized avatar

Niko Dunixi niko-dunixi

View GitHub Profile
@niko-dunixi
niko-dunixi / SpringMVC X-UA-Compatible Header.java
Last active August 29, 2015 14:00
Spring MVC response header for X-UA-Compatible: IE=edge,chrome=1
@RequestMapping(value = "/", method = RequestMethod.GET)
public String home(@RequestHeader("User-Agent") String userAgent, HttpServletResponse response) {
logger.info(userAgent);
if (userAgent.contains("MSIE")) {
logger.info("Adding response header for IE");
response.addHeader("X-UA-Compatible", "IE=edge,chrome=1");
}
return "home";
}

How to change git's default branch

Ensure git is at least version 2.28.0

You need a recent enough version of git. If you're on ubuntu/debian, this will get the most recent stable version.

sudo add-apt-repository ppa:git-core/ppa
sudo apt-get update

Keybase proof

I hereby claim:

  • I am niko-dunixi on github.
  • I am nikodunixi (https://keybase.io/nikodunixi) on keybase.
  • I have a public key ASDxUhyLDLRAjbaF5d2INm9NVObRCyfEAskGAnq9x67LEQo

To claim this, I am signing this object:

@niko-dunixi
niko-dunixi / install-docker.md
Last active November 9, 2020 02:51 — forked from zulhfreelancer/install-docker.md
Install Docker oneliner script

Install Docker

$ curl -sSL https://get.docker.com/ | sh && sudo usermod -aG docker ${USER}

Install within a Dockerfile (Buildkit)

FROM ubuntu:latest
@niko-dunixi
niko-dunixi / readme.md
Last active November 18, 2020 23:12
Download portion of YouTube video

We can't do this with youtube-dl alone, we can pair this with ffmpeg to acomplish this task though. We use youtube-dl and ffmpeg to resolve the URL of the video, and then tell ffmpeg to download the range itself.

So to take a sound byte from this podcast and use it to create my ringtone:

$ audio_url="$(youtube-dl --audio-format mp3 --get-url https://youtu.be/s8tJ-R28HX8 | grep mime=audio | head -n 1)"
$ ffmpeg -ss 02:00:02.10 -i "${audio_url}" -t 00:00:12 -c:a mp3 paul-ringtone.mp3
@niko-dunixi
niko-dunixi / README.md
Created December 3, 2020 03:44
Ubuntu install SHADERed

SHADERed Installation for Ubuntu

$ [ ! -d /opt/SHADERed ] || sudo rm -rf /opt/SHADERed
$ sudo apt-get install -y libsfml-dev
$ cd /tmp
$ zip_url="$(curl https://api.github.com/repos/dfranx/SHADERed/releases | jq '.[0].assets[] | select(.name | contains("Linux.zip")) | .browser_download_url' -r)"
$ curl -JL "${zip_url}" -o shadered-linux.zip
$ unzip shadered-linux.zip
$ sudo mv SHADERed /opt/SHADERed
@niko-dunixi
niko-dunixi / readme.md
Last active January 6, 2021 21:45
Personal/Public docker mirrors

TODO: make this generic

  1. If you haven't, create your mirror ECRs. Make sure they're public
  2. Open the Cloud9 IDE
  3. Run the commands below to pull the public images and push them up for our own personal reuse
$ docker pull golang:1.15
$ docker pull python:3
$ docker pull amazonlinux:latest
@niko-dunixi
niko-dunixi / install-godoc.md
Created July 12, 2021 22:35
Install Go Doc

Install Go Doc

$ go get -v -u golang.org/x/tools/cmd/godoc
@niko-dunixi
niko-dunixi / readme.md
Created July 12, 2021 22:37
Install Go Hugo one-liner

Install Go Hugo one-liner

$ go get --tags extended github.com/gohugoio/hugo
@niko-dunixi
niko-dunixi / readme.md
Created September 30, 2021 15:41
AWS Cli Snippets

Get Account ID

$ aws sts get-caller-identity --query Account --output text

Get Current IAM User ARN

$ aws sts get-caller-identity --query Arn --output text