Hacker Newsnew | past | comments | ask | show | jobs | submit | ilozinski's commentslogin

I work on an m1 macbook and a lot of times using arm architecture breaks dependencies. I have two really basic functions in my .zshrc (should also work for bash):

# M1 compatibility switches

arm() { arch -arm64 "${@:-$SHELL}" }

x86() { arch -x86_64 "${@:-$SHELL}" }

This with the addition of `$(uname -m)` in my $PROMPT, has saved me a lot of time by letting me switch between arm and x86_64 architecture.


Does anyone have something similar to this for exec'ing into kubernetes pods? It's usually not the case that the container will have bash, vim, etc., but there is probably something to make it feel more like home.


You probably don't want either a fully functioning remote shell, or a malleable filesystem for injecting one, since that's precisely the kind of environment that is great for infiltrators to make a pod do something it's not intended to.


if you have a common base system it might be possible to copy/rsync/untar the tools you need and then use them. Ideally you'd want to restart the container/pod once you're done to ensure the tools aren't left around, or their presence causes other weird issues.


I keep this in my snippet manager to be pasted into a kubernetes pod I want to have the tools I'm used to:

    apt-get update; apt-get install -y tmux git ncdu psmisc iproute2 net-tools curl zsh vim; curl -Ls install.ohmyz.sh | sh; chsh -s $(which zsh); exec zsh
It's not automatic but it only takes a second for me to find it and about 10-15s to run.


What happens if the machine loses power on a hot summer day? Seems like either the dog would be incinerated or the door unlocks in a failure mode. Either scenario sounds like a nightmare.


Battery backup, alert owner, failsafe door unlock as last resort.


My name is also Ian and I have invented my own shoe-tying method independently from Ian Fleggen's method. I believe it's faster than the "Ian Knot". Once I come up with a name for it, I will publish it online.

Taking name suggestions...


Ianest Knot. The most Ian a knot can be.


The One True Ian Knot! ("Toti-knot" has a good infomercial ring to it I think too).


Not Ian's Knot


NINIK?


The Ia-knot


IIan knot.


Gorilla mux is way overrated and overused. I'm not sure why it's the first choice for so many people. There are much better alternatives such as https://github.com/julienschmidt/httprouter or https://github.com/gin-gonic/gin.


Care to explain why it's overused in comparison to other toolkits/frameworks/libraries? Taking in to account, of course, the target use-cases.


Along the same tone, httprouter doesn't allow defining these routes simultaneously

    users/:id
    users/watching
Was kind of surprised as we have many routes like that. Like gorilla/mux, I think it was just first (trie-based mux). Isn't gin based on httprouter?

There are even better muxes now. `pressly/chi` is used by heavy hitters in production and takes advantage of Go 1.7 HTTP context. `labstack/echo` is another highly recommended by others but I don't like the non-idiomatic echo.Context in handler signatures.

Back on topic, I hope the go web examples only imports built-in packages. The gorilla/mux example could easily be written to use built-in packages.


Part of the reason is that gorilla/mux uses identical API to the standard library.


I avoid httprouter because it doesn't adhere to the standard library interface for http handlers. I've not used gin, but it looks to also not follow the standard library interface here. Also, it does not appear to make use of newer developments in Go such as the context package (it imports the x/pkg version but does nothing with it I think).


I believe gorilla mux came out years before the others, so it's not really shocking that it is used more. I personally have never had any issues with it but to each there own.


Contradiction does not exist. :)


Now that timeouts are supported, I think it makes sense. I'm curious if you agree.


Yup, but I like contexts even more. Everything is better with contexts ;)


Corecursive factorial in javascript: https://gist.github.com/i/f75f21f6c56eb55c414c


I'm in your class!


A jorb well done.


Maybe your math skills aren't as good as you think.


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: