Skip to content

Instantly share code, notes, and snippets.

View wataash's full-sized avatar

Wataru Ashihara wataash

View GitHub Profile
import os
import sys
from wsgiref.simple_server import make_server
PORT = int(os.getenv("PORT") or "8080")
def app(environ, start_response):
path = environ["PATH_INFO"]
if path == "/sse":
@yoku0825
yoku0825 / please_clause_for_5651.patch
Created April 1, 2021 05:39
MySQL 5.6.51にPLEASE句を実装するパッチ
--- ./sql/sql_yacc.yy.orig 2021-01-05 19:19:59.000000000 +0900
+++ ./sql/sql_yacc.yy 2021-04-01 11:52:06.167953286 +0900
@@ -2,2 +2,3 @@
Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved.
+ Copyright (c) 2021, yoku0825. All rights reserved.
@@ -1570,2 +1571,3 @@
%token SSL_SYM
+%token PLEASE_SYM /* yoku0825 */
%token STARTING
@joanbm
joanbm / nvidia-fix-linux-5.11.patch
Last active February 21, 2021 11:36
Tentative fix for NVIDIA 460.32.03 driver for Linux 5.11-rc2
From b6272b5b9eb2546383e4590ebf8d9578f3e2b947 Mon Sep 17 00:00:00 2001
From: Joan Bruguera <joanbrugueram@gmail.com>
Date: Thu, 7 Jan 2021 18:40:33 +0100
Subject: [PATCH] Tentative fix for NVIDIA 460.32.03 driver for Linux 5.11-rc2
---
conftest.sh | 17 ++++++++++++-
nvidia-drm/nvidia-drm-crtc.c | 17 +++++++++++++
nvidia-drm/nvidia-drm-drv.c | 15 ++++++++++++
nvidia-drm/nvidia-drm-gem-user-memory.c | 24 +++++++++++++++++++
@vipulmathur
vipulmathur / PyCharmIntelliJShared.md
Last active February 5, 2024 10:24
Run PyCharm and IntelliJ IDEA on the same codebase

Problem

PyCharm and IntelliJ IDEA use the .idea directory to keep project information. While the two seem to be able to read each other's files, they (currently) don't understand the other's settings.

Solution

The work-around (till they learn to play better with each other) is to keep their .idea folders separate, while sharing a common project source tree. Instructions follow below.

PowerShell Gives You Wrongs

三年半の格闘の末に僕が見たもの、あるいは試行錯誤の覚書、すなわち二番煎じ。

はじめに

PowerShell 3.0以上のバージョンを使用すること。2.0以下のバージョンは、書き捨ては仕方ないとしても、保守対象のスクリプトを書くべきではないし、あらゆる言及に値しない。全力でバージョンアップをしろ。

式と文の常識を超えて

@extremecoders-re
extremecoders-re / qemu-networking.md
Last active March 31, 2024 17:19
Setting up Qemu with a tap interface

Setting up Qemu with a tap interface

There are two parts to networking within QEMU:

  • The virtual network device that is provided to the guest (e.g. a PCI network card).
  • The network backend that interacts with the emulated NIC (e.g. puts packets onto the host's network).

Example: User mode network

@devjin0617
devjin0617 / .manifest
Created May 19, 2017 15:15
chrome extension using a content script to access the `window` object
{
"content_scripts": [
{
"matches": ["http://*/*", "https://*/*"],
"js": ["inject.js"],
"all_frames": true
}
],
"web_accessible_resources": [
"content.js"
@jchandra74
jchandra74 / PowerShell Customization.md
Last active March 1, 2024 01:02
PowerShell, Cmder / ConEmu, Posh-Git, Oh-My-Posh, Powerline Customization

Pimping Up Your PowerShell & Cmder with Posh-Git, Oh-My-Posh, & Powerline Fonts

Backstory (TLDR)

I work as a full-stack developer at work. We are a Windows & Azure shop, so we are using Windows as our development platform, hence this customization.

For my console needs, I am using Cmder which is based on ConEmu with PowerShell as my shell of choice.

Yes, yes, I know nowadays you can use the Linux subsystem on Windows 10 which allow you to run Ubuntu on Windows. If you are looking for customization of the Ubuntu bash shell, check out this article by Scott Hanselman.

@rverton
rverton / cowroot.c
Created October 21, 2016 14:06
CVE-2016-5195 (DirtyCow) Local Root PoC
/*
* (un)comment correct payload first (x86 or x64)!
*
* $ gcc cowroot.c -o cowroot -pthread
* $ ./cowroot
* DirtyCow root privilege escalation
* Backing up /usr/bin/passwd.. to /tmp/bak
* Size of binary: 57048
* Racing, this may take a while..
* /usr/bin/passwd overwritten
@Integralist
Integralist / 1. linux utilities.md
Last active December 1, 2023 15:04
Different Linux utility commands (e.g. top, ps, strace, lsof, netstat, ifconfig, iftop, iptraf, tcpdump, wireshark)

Start up a container (whichever Linux flavour takes your fancy):

docker run -it ubuntu /bin/bash
docker run -it centos /bin/bash
  • top: check what CPU and Memory running processes are utilising
  • ps: see what processes are running
  • strace: monitor interactions between processes