Skip to content

Instantly share code, notes, and snippets.

View popunbom's full-sized avatar

Fumiya ENDOU popunbom

  • Tokyo
View GitHub Profile
@popunbom
popunbom / Dockerfile
Last active June 29, 2024 14:42
YAFU (Yet Another Factoring Utility) on Docker
###########
# Stage-1 #
###########
FROM alpine:3 AS builder
# Add 'testing' repository
RUN echo '@testing http://dl-cdn.alpinelinux.org/alpine/edge/testing' >> /etc/apk/repositories
# Install build dependencies
RUN apk add \
@popunbom
popunbom / fix-clearscreen.patch
Created May 4, 2023 05:54
Fix github.com/longld/peda for Python 3.x
diff --git a/lib/utils.py b/lib/utils.py
index 8f2b038..827c3f1 100644
--- a/lib/utils.py
+++ b/lib/utils.py
@@ -150,6 +150,7 @@ def blue(text, attrib=None):
def clearscreen():
"""Clear terminal screen"""
sys.stdout.write("\x1b[2J\x1b[H")
+ sys.stdout.flush()
@popunbom
popunbom / settings.jsonc
Created November 15, 2021 00:24
[VSCode] tokenColorCustomizations
// Theme customization
"editor.tokenColorCustomizations": {
"textMateRules": [{
"scope": [
"storage.type",
"entity.name.function",
"keyword.control",
"keyword",
"constant.language",
],

C++初心者がC++を使って競技プログラミングするための備忘録のようなもの

この記事は、C++ (fork) Advent Calendar 2013の12日目の記事です。

はじめに

記事を書く人が居ないみたいなので、C++初心者ですが箸休め的な記事を書こうと思い立ち、いざ書き上げてみたら思いの外長くなりました。

この記事は、C++初心者な著者が、C++を用いて競技プログラミングをするために、調べたことや試した事などのまとめです。 記事中に誤り、問題点やご指摘、ご質問等ありましたら、@rigibunまでご連絡下さい(特にpush_bach)

githubのmarkdownを使いたかったことと、変更履歴が見られることからgistで書きました。

@popunbom
popunbom / growi2esaio.py
Created July 30, 2019 17:34
[Python] Porting Script: Growi <--> esa.io
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import pymongo as mongo
import re
import json
import requests as r
from pprint import pprint
import time
@popunbom
popunbom / angr_solver_stdin.py
Created May 29, 2019 13:07
[CTF] Reversing using angr (flag via stdin)
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import pdb
import sys
import angr
import claripy
argc, argv = len(sys.argv), sys.argv
@popunbom
popunbom / angr_solver_args.py
Last active May 29, 2019 13:08
[CTF] Reversing using angr (flag via args)
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import pdb
import sys
import angr
import claripy
argc, argv = len(sys.argv), sys.argv
@popunbom
popunbom / Dockerfile
Last active October 22, 2019 08:58
docker for CTF
FROM ubuntu:18.04
# [18.04] change apt repository to JP
# REF: https://linuxfan.info/ubuntu-18-04-server-basic-settings
RUN perl -p -i.bak \
-e 's%https?://(?!security)[^ \t]+%http://jp.archive.ubuntu.com/ubuntu/%g' \
/etc/apt/sources.list
# apt update && apt upgrade
RUN apt-get update && apt upgrade -y
@popunbom
popunbom / settings.json
Created April 16, 2019 07:42
[VSCode] settings.json : Python 補完を強化する
{
"python.pythonPath": "Python 実行ファイルへのパス (例: /Users/popunbom/.pyenv/shims/python3)",
"python.autoComplete.addBrackets": true,
"python.autoComplete.extraPaths": [
"使用したい Python バージョンの site-package ディレクトリへのパス (例: /Users/popunbom/.pyenv/versions/3.6.5/Python.framework/Versions/3.6/lib/python3.6/site-packages)"
],
"python.linting.pylintArgs": [
"--ignored-modules=numpy,cv2,matplotlib",
"--ignored-classes=numpy,cv2,matplotlib",
"--extension-pkg-whitelist=numpy,cv2,matplotlib"
@popunbom
popunbom / memoize_using_decorator.py
Created April 10, 2019 02:32
デコレータを使ったメモ化サンプル (Python 3.6)
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
from sys import argv
def memoize(func):
memo = dict()
def wrapper(*args, **kwargs):