Skip to content

Instantly share code, notes, and snippets.

View roolebo's full-sized avatar

Roman Bolshakov roolebo

View GitHub Profile
@logost
logost / iscsi_abort.py
Created April 7, 2021 12:28
Send ABORT over iSCSI
#!/usr/bin/env python3
# -*- coding: UTF-8 -*-
# Author : tintinweb@oststrom.com <github.com/tintinweb>
'''
A simple TCP three-way handshake example
#> python scapy_tcp_handshake.py
DEBUG:__main__:init: ('oststrom.com', 80)
DEBUG:__main__:start
DEBUG:__main__:SND: SYN
#include <errno.h>
#include <stdio.h>
#include <string.h>
#include <sys/mman.h>
void print_prot_bits(int prot) {
printf((prot & PROT_READ) == 0 ? "-" : "R");
printf((prot & PROT_WRITE) == 0 ? "-" : "W");
printf((prot & PROT_EXEC) == 0 ? "-" : "X");
}
@IsaacXen
IsaacXen / README.md
Last active May 2, 2024 09:57
(Almost) Every WWDC videos download links for aria2c.
@knightsc
knightsc / build-xnu-6153.11.26.sh
Created February 18, 2020 15:08
A script to build XNU version 6153.11.26 (macOS Catalina 10.15).
#! /bin/bash
#
# build-xnu-6153.11.26.sh
# Scott Knight
#
# Based on the script by Brandon Azad
# https://gist.github.com/bazad/654959120a423b226dc564073b435453
#
# A script showing how to build XNU version 6153.11.26 on macOS Catalina
# 10.15 with Xcode 11.13.1.
@bbqtd
bbqtd / macos-tmux-256color.md
Last active May 2, 2024 04:41
Installing tmux-256color for macOS

Installing tmux-256color for macOS

  • macOS 10.15.5
  • tmux 3.1b

macOS has ncurses version 5.7 which does not ship the terminfo description for tmux. There're two ways that can help you to solve this problem.

The Fast Blazing Solution

Instead of tmux-256color, use screen-256color which comes with system. Place this command into ~/.tmux.conf or ~/.config/tmux/tmux.conf(for version 3.1 and later):

@karrick
karrick / flock.go
Last active November 12, 2020 18:03
Examples of using advisory locking with golang.org/x/sys/unix
// These funcitons ought to come with a huge warning. Using them without
// understanding the differences between blocking and non-blocking, or
// between exclusive and shared access, and when to use them will cause
// problems that do not necessarily manifest right away, but rather
// fester in your program and rear their ugly head in the middle of the
// night when you're sleeping.
//
// If you use advisory file locking, *always* use Shared locking every
// single time you read the file, and *always* use Exclusive locking every
// single time you write the file. Period. There are no exceptions. Heed
@mbbx6spp
mbbx6spp / config
Created November 22, 2017 16:19
Blocked SSH port, GitHub workaround
# Put in your ~/.ssh/config
### Problem
#
# You are on a public WiFi network that blocks SSH ports but you don't want to switch
# to pushing your Github changes to GH remotes via HTTPS nor do you want to change the
# remote hostname in all your repos.
Host github.com
Hostname ssh.github.com
@tknerr
tknerr / ci_jobs.groovy
Created October 6, 2017 10:00
JobDSL example for setting up master / release branch builds + PR builds via bitbucket-branch-source-plugin (using the generated JobDSL)
// define the bitbucket project + repos we want to build
def bitbucket_project = 'awesome'
def bitbucket_repos = ['foo','bar','baz']
// create a pipeline job for each of the repos and for each feature branch.
for (bitbucket_repo in bitbucket_repos)
{
multibranchPipelineJob("${bitbucket_repo}-ci") {
// configure the branch / PR sources
branchSources {
@CyberShadow
CyberShadow / osx.org
Last active October 29, 2023 18:08
Setting up OS X from scratch

Setting up OS X from scratch (on libvirt/QEMU/KVM)

Motivation

  • I have a MacBook1,1, but its HDD died.
  • I need an instance of OS X mainly to build OS X binaries of some of my open-source software.

OS X 10.4 (Tiger)

  1. Obtain installation medium