Skip to content

Instantly share code, notes, and snippets.

View roolebo's full-sized avatar

Roman Bolshakov roolebo

  • Sri Lanka
  • 11:15 (UTC +05:30)
  • X @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 : [email protected] <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 November 3, 2024 04:19
(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 August 7, 2024 14:39
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):

@wombat
wombat / README.MD
Last active July 2, 2024 06:31
Nighthawk M1 AT commands

Connect Nighthawk M1 via USB to your computer. Open up a terminal and connect to the Nighthawk M1 via telnet (IP MAY VARY): telnet 192.168.1.1 5510.

You can check the current status of the LTE via the AT!gstatus? command.

To add more options to your cellular list in the Nighthawk M1 settings, copy/paste the following commands and paste them in the telnet session (you might need to hit ENTER one or two times - just as long until no "OK" comes back):

AT!BAND=3,"1800 Only (B3)",0,4
AT!BAND=4,"2600 Only (B7)",0,40
@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
@githubfoam
githubfoam / Mellanox OFED cheat sheet
Last active November 7, 2024 23:24
Mellanox OFED cheat sheet
--------------------------------------------------------------------------
# ofed_info -s
--------------------------------------------------------------------------
Find Mellanox Adapter Type and Firmware/Driver version
ConnectX-4 card
# lspci | grep Mellanox
0a:00.0 Network controller: Mellanox Technologies MT27500 Family [ConnectX-3]
# lspci -vv -s 0a:00.0 | grep "Part number" -A 3
# lspci | grep Mellanox | awk '{print $1}' | xargs -i -r mstvpd {}
@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 {