- Create an hetzner server using Ubuntu
- Go to the Hetzner's Server dashboard > Images
- Click on "Mount" over the
alpine-linux-extended.iso
image - Shutdown the server
- Start the server
- Click the "Console" icon from the dashboard to open an interactive terminal session
- Login is
root
- Configure the interface using the command
setup-interfaces
- Pick to setup default
eth0
- Custom config:
no
import asyncio | |
import pycurl | |
import selectors | |
MULTI = pycurl.CurlMulti() | |
SELECTOR = selectors.DefaultSelector() | |
LOOP = asyncio.get_event_loop() | |
TIMER = None |
#include <time.h> // Robert Nystrom | |
#include <stdio.h> // @munificentbob | |
#include <stdlib.h> // for Ginny | |
#define r return // 2008-2019 | |
#define l(a, b, c, d) for (i y=a;y\ | |
<b; y++) for (int x = c; x < d; x++) | |
typedef int i;const i H=40;const i W | |
=80;i m[40][80];i g(i x){r rand()%x; | |
}void cave(i s){i w=g(10)+5;i h=g(6) | |
+3;i t=g(W-w-2)+1;i u=g(H-h-2)+1;l(u |
### | |
### | |
### UPDATE: For Win 11, I recommend using this tool in place of this script: | |
### https://christitus.com/windows-tool/ | |
### https://github.com/ChrisTitusTech/winutil | |
### https://www.youtube.com/watch?v=6UQZ5oQg8XA | |
### iwr -useb https://christitus.com/win | iex | |
### | |
### OR take a look at | |
### https://github.com/HotCakeX/Harden-Windows-Security |
from sre_parse import Pattern, SubPattern, parse as sre_parse | |
from sre_compile import compile as sre_compile | |
from sre_constants import BRANCH, SUBPATTERN | |
class Scanner(object): | |
def __init__(self, tokens, flags=0): | |
subpatterns = [] | |
pat = Pattern() |
At Vimeo, on the transcoding team, we work a lot with Go, and a lot with C, for various tasks such as media ingest. This means we use CGO quite extensively, and consequently, have run into bits that are perhaps not very well documented, if at all. Below is my effort to document some of the problems we've run into, and how we fixed or worked around them.
Many of these are obviously wrong in retrospect, but hindsight is 20/20, and these problems do exist in many codebases currently.
Some are definitely ugly, and I much welcome better solutions! Tweet me at @daemon404 if you have any, or have your own CGO story/tips, please! I'd love to learn of them.
Table of Contents
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
int addi(int a, int b) { | |
return a + b; | |
} | |
char *adds(char *a, char *b) { | |
char *res = malloc(strlen(a) + strlen(b) + 1); |
from ijson import common | |
from ijson.backends import YAJLImportError | |
from cffi import FFI | |
ffi = FFI() | |
ffi.cdef(""" | |
typedef void * (*yajl_malloc_func)(void *ctx, size_t sz); | |
typedef void (*yajl_free_func)(void *ctx, void * ptr); | |
typedef void * (*yajl_realloc_func)(void *ctx, void * ptr, size_t sz); |
// You don't want to serve HTTPS supporting for SSL3.0 any longer, see: | |
// http://googleonlinesecurity.blogspot.de/2014/10/this-poodle-bites-exploiting-ssl-30.html | |
import ( | |
"crypto/tls" | |
"net/http" | |
) | |
// This code supports SSL3.0, TLS1.0, TLS1.1 and TLS1.2 | |
// Chances are you currently do this but want to stop due to the POODLE | |
err := http.ListenAndServeTLS(addr, "crtfile", "keyfile", handler) |
So I got to playing 2048 a decent amount, and starting getting the feeling that there was a 'pattern' that would win this game for me. Perhaps you've had the same thought! As a result, I wrote a little snippet of code that that cycles throw the keys Up, Right, Down, Left (feel free to create your own pattern).
Copy and paste this into your Chrome/Firefox console to automate 2048!
function pressKey(i) {
var evt = document.createEvent("KeyboardEvent");
evt.initKeyEvent ("keydown", true, true, window, 0, 0, 0, 0, 37+i%4, 37+i%4);
document.dispatchEvent(evt);