Skip to content

Instantly share code, notes, and snippets.

View fx-kirin's full-sized avatar
🌴
Somewhere on the planet.

fx-kirin fx-kirin

🌴
Somewhere on the planet.
View GitHub Profile
@7kry
7kry / w32example.py
Last active November 6, 2018 02:44
手持ちのPython 3環境で動かしたらちょっと手直しが必要だったので、まずフォーク。
# -*- coding: utf-8 -*-
# http://algomarket.wikidot.com/win32-api-in-python
# `Hello world in python using win32py'
# 手持ちのPython 3環境で動かしたらちょっと手直しが必要だったので、まずフォーク。
from win32api import (GetModuleHandle,)
from win32gui import (WNDCLASS,
GetStockObject,
RegisterClass,
@eXenon
eXenon / scapy_bridge.py
Last active May 12, 2024 03:00
Use scapy as a modifying proxy
#!/usr/bin/python2
"""
Use scapy to modify packets going through your machine.
Based on nfqueue to block packets in the kernel and pass them to scapy for validation
"""
import nfqueue
from scapy.all import *
import os
@pbugnion
pbugnion / ipython_notebook_in_git.md
Last active October 22, 2023 12:25
Keeping IPython notebooks under Git version control

This gist lets you keep IPython notebooks in git repositories. It tells git to ignore prompt numbers and program outputs when checking that a file has changed.

To use the script, follow the instructions given in the script's docstring.

For further details, read this blogpost.

The procedure outlined here is inspired by this answer on Stack Overflow.

@zyzo
zyzo / configure-gmail-as-relay-smtp
Created December 30, 2014 13:24
configure gmail as relay smtp using postfix
Steps to configure this server to send mail via gmail relay
1. Download postfix and required packages
sudo apt-get install postfix mailutils libsasl2-2 ca-certificates libsasl2-modules
2. Configure gmail as relay host : in /etc/postfix/main.cf
relayhost = [smtp.gmail.com]:587
smtpd_sasl_auth_enable = yes
smtp_sasl_auth_enable = yes
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
smtp_sasl_security_options = noanonymous
@samhocevar
samhocevar / gist:00eec26d9e9988d080ac
Last active January 13, 2024 23:40
Configure sshd on MSYS2 and run it as a Windows service
#!/bin/sh
#
# msys2-sshd-setup.sh — configure sshd on MSYS2 and run it as a Windows service
#
# Please report issues and/or improvements to Sam Hocevar <sam@hocevar.net>
#
# Prerequisites:
# — MSYS2 itself: http://sourceforge.net/projects/msys2/
# — admin tools: pacman -S openssh cygrunsrv mingw-w64-x86_64-editrights
#
@mulhoon
mulhoon / Highcharts Cheat Sheet
Last active March 22, 2023 18:43
Highcharts Cheat Sheet
$('#container').highcharts({
chart: {
alignTicks: true, // When using multiple axis, the ticks of two or more opposite axes will automatically be aligned by adding ticks to the axis or axes with the least ticks.
animation: true, // Set the overall animation for all chart updating. Animation can be disabled throughout the chart by setting it to false here.
backgroundColor: '#FFF', // The background color or gradient for the outer chart area.
borderColor: '#4572A7', // The color of the outer chart border.
borderRadius: 5, // The corner radius of the outer chart border. In export, the radius defaults to 0. Defaults to 5.
borderWidth: 0, // The pixel width of the outer chart border.
className: null, // A CSS class name to apply to the charts container div, allowing unique CSS styling for each chart.
defaultSeriesType: 'line', // Alias of type.
@gerkey
gerkey / pcap_reader.py
Created April 19, 2016 16:25
Script to read pcap files and play them back as UDP packets (meant for Velodyne testing)
#!/usr/bin/env python
# Read a .pcap file full of UDP packets from a velodyne and play them back to
# localhost:2368, for consumption by the velodyne driver.
#
# TODO: error-checking and options (looping, etc.)
import dpkt
import sys
import socket
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@IntergalacticApps
IntergalacticApps / make_windows10_great_again.bat
Last active December 28, 2023 08:16
Make Windows 10 Great Again - stop Windows 10 spying!
@echo off
setlocal EnableDelayedExpansion
ver | find "10." > nul
if errorlevel 1 (
echo Your Windows version is not Windows 10... yet. Brace yourself, Windows 10 is coming^^!
pause
exit
)
@y3nr1ng
y3nr1ng / paramiko_ssh_config.py
Last active July 14, 2021 10:07
Paramiko with .ssh/config
client = paramiko.SSHClient()
client._policy = paramiko.WarningPolicy()
client.set_missing_host_key_policy(paramiko.AutoAddPolicy())
ssh_config = paramiko.SSHConfig()
user_config_file = os.path.expanduser("~/.ssh/config")
if os.path.exists(user_config_file):
with open(user_config_file) as f:
ssh_config.parse(f)