Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/python
"""
Port Knocking with scapy example.
Knock on port 42304
Knock on port 53768
Knock on port 3297
HTTP request to port 19760
Now, to get the flag, we just need to write a small scrip to implement all this logic. We will use the scapy python library to perform the port knocking and curl for the HTTP request part:
mike@rbci:~$ psql -U postgres
psql (9.0.3)
Type "help" for help.
postgres=# update pg_database set datallowconn = TRUE where datname = 'template0';
UPDATE 1
postgres=# \c template0
You are now connected to database "template0".
template0=# update pg_database set datistemplate = FALSE where datname = 'template1';
UPDATE 1
@snj
snj / key_translator.js
Created April 29, 2015 17:51
Translated from US into Dvorak
// Copyright 2010-2015, Google Inc.
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
@snj
snj / Amazon Machine Learning 概要
Created June 3, 2015 04:13
AWS Summit 2015 Day2
機械学習の導入を容易にする。
例:スパム判定。送信者ドメインやIP,時刻、言語といったファクト(教師データ)をもとにモデルをトレーニングし、未来予測対象のデータのスパム判定を行う。二項分類。
例2:ECサイトの商品のカテゴライズ。商品名、価格、メーカーなどの教師データをもとに、日用品なのか、食品、本なのかなどを予測対象データにたいして判定する。
例3:明日の売上はどのくらいか。過去の売上データ群から、一番もっともらしい範囲で。曜日、天気、気温などの要素。数値を元に。線形回帰分析。
スマートアプリケーションを作るには
1.機械学習への理解
2.R,Pythonなどの知識
3.特定のビジネス分野への知見(金融、広告など)
# ===================================================================
# like emacs
# ===================================================================
'atom-workspace atom-text-editor:not([mini])':
# ファイルの先頭へ移動
'ctrl-up': 'core:move-to-top'
# ファイルの最後へ移動
"*":
core: {}
editor:
invisibles: {}
showIndentGuide: true
showInvisibles: true
softWrap: true
welcome:
showOnStartup: false
import requests
from requests.auth import HTTPBasicAuth
import re
from StringIO import StringIO
JIRA_URL = 'https://your-jira-url.tld/'
JIRA_ACCOUNT = ('jira-username', 'jira-password')
# the JIRA project ID (short)
JIRA_PROJECT = 'PRO'
GITLAB_URL = 'http://your-gitlab-url.tld/'
@snj
snj / Emmet.sublime-settings
Created March 13, 2017 00:47
Sublime Text 3 の Emmet で ctrl+e では展開させずに行末移動させる
# Preferences - Package Settings - Emmet - Key Bindings(User)
[
{
"keys": [
"shift+space"
],
"args": {
"action": "expand_abbreviation"
},
"command": "run_emmet_action",
[
{"keys": ["ctrl+k"], "command": "jove_move_then_delete", "args": {"move_cmd": "jove_move_for_kill_line"}},
{"keys": ["ctrl+y"], "command": "jove_yank"},
{ "keys": ["ctrl+shift+f"], "command": "show_panel", "args": {"panel": "find", "reverse": false} },
{ "keys": ["ctrl+shift+h"], "command": "show_panel", "args": {"panel": "replace", "reverse": false} },
{ "keys": ["ctrl+a"], "command": "move_to", "args": {"to": "bol", "extend": false} },
{ "keys": ["ctrl+e"], "command": "move_to", "args": {"to": "eol", "extend": false} },
{ "keys": ["ctrl+b"], "command": "move", "args": {"by": "characters", "forward": false} },
{ "keys": ["ctrl+f"], "command": "move", "args": {"by": "characters", "forward": true} },
{ "keys": ["ctrl+p"], "command": "move", "args": {"by": "lines", "forward": false} },