Skip to content

Instantly share code, notes, and snippets.

View ipoddubny's full-sized avatar

Ivan Poddubny ipoddubny

  • ipnordic
  • Denmark
View GitHub Profile
@rootkea
rootkea / spectre.c
Created January 4, 2018 15:36
PoC from Spectre Attacks: Exploiting Speculative Execution (https://spectreattack.com/spectre.pdf)
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#ifdef _MSC_VER
#include <intrin.h> /* for rdtscp and clflush */
#pragma optimize("gt",on)
#else
#include <x86intrin.h> /* for rdtscp and clflush */
#endif
@ErikAugust
ErikAugust / spectre.c
Last active May 22, 2024 23:07
Spectre example code
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#ifdef _MSC_VER
#include <intrin.h> /* for rdtscp and clflush */
#pragma optimize("gt",on)
#else
#include <x86intrin.h> /* for rdtscp and clflush */
#endif
@eedugon
eedugon / gitlab-registry.gc.sh
Created July 13, 2017 10:30 — forked from pbabics/gitlab-gc.sh
Manual garbage collector for gitlab registry, it removes old revisions that are not referenced by any tag
#!/bin/bash
# This is a modification of gitlab-gc.sh script created by Peter Bábics (pbabics/gitlab-gc.sh)
# Improvements
# - Searching in all BASE_PATH, not fixing the search to a depth of 2
# - Directories without valid tags or revisions directories won't be processed (to avoid unexpected issues)
# - Logging in case there's nothing to delete
# - running registry-garbage-collect only when something has been deleted
@nicowilliams
nicowilliams / fork-is-evil-vfork-is-good-afork-would-be-better.md
Last active May 18, 2024 14:10
fork() is evil; vfork() is goodness; afork() would be better; clone() is stupid

I recently happened upon a very interesting implementation of popen() (different API, same idea) called popen-noshell using clone(2), and so I opened an issue requesting use of vfork(2) or posix_spawn() for portability. It turns out that on Linux there's an important advantage to using clone(2). I think I should capture the things I wrote there in a better place. A gist, a blog, whatever.

This is not a paper. I assume reader familiarity with fork() in particular and Unix in general, though, of course, I link to relevant wiki pages, so if the unfamiliar reader is willing to go down the rabbit hole, they should be able to come ou

@mistakster
mistakster / FollowFriday_2015-07-10.md
Last active August 29, 2015 14:24
#FollowFriday list (2015-07-10)

Список #FollowFriday от 2015-07-10 по версии @jsunderhood

Ещё один энтузиаст React. Великолепно, что опыты Дэна @dan_abramov делают счастливыми не только его, но и нас.

Вячеслав @vslinko экспериментирует с React и не пишет в твиттер всяких глупостей. Только JS, только хардкор!

Любознательный разработчик Алексей @alexeyraspopov и его гитхаб https://github.com/alexeyraspopov

Ингвар @RReverser рассказывает по-английски про инструменты разработки JS-программиста

@lelandbatey
lelandbatey / whiteboardCleaner.md
Last active June 16, 2024 13:44
Whiteboard Picture Cleaner - Shell one-liner/script to clean up and beautify photos of whiteboards!

Description

This simple script will take a picture of a whiteboard and use parts of the ImageMagick library with sane defaults to clean it up tremendously.

The script is here:

#!/bin/bash
convert "$1" -morphology Convolve DoG:15,100,0 -negate -normalize -blur 0x1 -channel RBG -level 60%,91%,0.1 "$2"

Results

@harith
harith / shellmarks.sh
Last active September 18, 2022 07:50
Utilities to let you easily reach frequently visited but deeply nested directories.
# Utilities for quickly accessing frequently used directories in bash.
# Usage:
# $ cd /path/to/project/src/
# $ mark code # Will create a new shortcut.
# # Becomes interactive if a shortcut already exists
# # m is an alias for mark. You can also `m code`
#
# $ code # From now on, running this anywhere in the shell
# # will put you in /path/to/project/src/code
@willurd
willurd / web-servers.md
Last active June 26, 2024 11:15
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
@tyre
tyre / gist:5561992
Last active December 17, 2015 05:59
Stop developing for the 90% use case

TLDR:

Please stop overvaluing your time at the expense of your users. It is easy to get caught up in a features pissing contest with that other startup down the road, but don't lose sight of your mission. Take one problem that people have and solve it. Well. All of it. All of the time.

Last year I read the wonderfully concise essay Half, Not Half-Assed by the 37 Signals team.

It took me more than five minutes to figure it out, but the time spent thinking was definitely worth it. Talking with coworkers, friends, or conference attendees about those handful of paragraphs reinforces this.

@freeformz
freeformz / WhyILikeGo.md
Last active October 6, 2022 23:31
Why I Like Go

A slightly updated version of this doc is here on my website.

Why I Like Go

I visited with PagerDuty yesterday for a little Friday beer and pizza. While there I got started talking about Go. I was asked by Alex, their CEO, why I liked it. Several other people have asked me the same question recently, so I figured it was worth posting.

Goroutines

The first 1/2 of Go's concurrency story. Lightweight, concurrent function execution. You can spawn tons of these if needed and the Go runtime multiplexes them onto the configured number of CPUs/Threads as needed. They start with a super small stack that can grow (and shrink) via dynamic allocation (and freeing). They are as simple as go f(x), where f() is a function.