Skip to content

Instantly share code, notes, and snippets.

@kaiwren
kaiwren / net_http_debug.rb
Created September 22, 2010 12:48
Enable debug for all Ruby HTTP requests
require 'net/http'
module Net
class HTTP
def self.enable_debug!
raise "You don't want to do this in anything but development mode!" unless Rails.env == 'development'
class << self
alias_method :__new__, :new
def new(*args, &blk)
instance = __new__(*args, &blk)
instance.set_debug_output($stderr)
@acarril
acarril / bootable-win-on-mac.md
Created November 18, 2022 17:49
Create a bootable Windows USB using macOS

For some reason, it is surprisingly hard to create a bootable Windows USB using macOS. These are my steps for doing so, which have worked for me in macOS Monterey (12.6.1) for Windows 10 and 11. After following these steps, you should have a bootable Windows USB drive.

1. Download a Windows disc image (i.e. ISO file)

You can download Windows 10 or Windows 11 directly from Microsoft.

2. Identify your USB drive

After plugging the drive to your machine, identify the name of the USB device using diskutil list, which should return an output like the one below. In my case, the correct disk name is disk2.

@akemin-dayo
akemin-dayo / virtualapple-utm-link
Last active April 24, 2024 18:34
A cleaned up version of an internal script that I've been using while working on TotalFinder to create VirtualApple virtual machine instances that are hardlinked to a UTM virtual machine instance. It's particularly useful for entering One True recoveryOS (1TR) as well as using the other features found only in VirtualApple.
@iati-bot
iati-bot / errors
Last active November 9, 2019 14:56 — forked from Bjwebb/errors
4 amnesty amnesty-1 http://50jaar.amnesty.nl/IATIactivitystandaard_AINL_1stquarter2017.xml
4 amnesty amnesty-2 http://50jaar.amnesty.nl/IATIactivityorganisation_AINL1stquarter2017(f).xml
1 britishcouncil britishcouncil-activities
1 cafod cafod-latinamericageneral
8 cafod cafod-multipleglo http://www.cafod.org.uk/extra/data/iati/IATIFile_Multiple_GLO.xml
4 cafod cafod-yemenarabrepublic http://www.cafod.org.uk/extra/data/iati/IATIFile_Yemen_Arab_Republic.xml
1 cdc cdc-activity
8 ec-fpi ec-fpi-gm http://ec.europa.eu/europeaid/files/iati/XI-IATI-EC_FPI_C_GM.xml
1 ewb_canada ewb_canada-water_sanitation_2011
8 fco fco-20131231_4 https://www.gov.uk/government/uploads/system/uploads/attachment_data/file/322661/Official_Development_Assistance__ODA__Frontline_2013-14_Q3_-_XML_format.xml
@macshome
macshome / defang.md
Last active April 24, 2024 18:31
How to defang system protections on macOS

How to Defang macOS System Protections

If you want to change things on the root drive of a Mac you will need to take some steps to disable the built in security of the system. Most of these steps are the same regardless if you are on Intel or Apple Silicon. If there is a difference it is noted.

Note that all of these things put a Mac into an unsupported and less secure state.

Make sure you either perform these steps in a VM or that you reset the protections after you are done poking around

Protections and Terms

(This list is not exahustive on the details of each. Check the links at the end for more info.)

@CedrikHeusser
CedrikHeusser / practice.md
Last active April 24, 2024 18:23
Practice

anynines worksample exercises


Please use git for version control

Create a local git repo and commit every exercise to this repo.

0. Warmup

If necessary install ruby and then:

@neretin-trike
neretin-trike / pug.md
Last active April 24, 2024 18:22
Туториал по HTML препроцессору Pug (Jade)
@pahud
pahud / ecs-task-export-import.sh
Last active April 24, 2024 18:20
ECS Task export/import
# export the task def
family='TaskDefName'
$ aws ecs describe-task-definition --task-definition $family \
--query "taskDefinition.{family:family, taskRoleArn:taskRoleArn, executionRoleArn:executionRoleArn, networkMode:networkMode, containerDefinitions:containerDefinitions, volumes:volumes, placementConstraints:placementConstraints, requiresCompatibilities:requiresCompatibilities, cpu:cpu, memory:memory, tags:tags, pidMode:pidMode, ipcMode:ipcMode, proxyConfiguration:proxyConfiguration}" | jq 'del(.[] | nulls)' > taskDef.json
# import the task def into newFamily task family
$ aws ecs register-task-definition --cli-input-json file://taskDef.json --family newFamily
# one-liner
aws ecs describe-task-definition --task-definition $family \
@stroebs
stroebs / make-chr.sh
Last active March 16, 2024 06:13
Install Mikrotik CHR on a Digital Ocean droplet (Ubuntu 20.04 tested working 29/03/2022)
#!/bin/bash
#
# Digital Ocean Ubuntu 18.04 x64 Droplet with "Regular Intel" CPU.
# Running:
# git clone https://gist.github.com/54fc09734a3911e91eeeb43434f117df.git
# cd 54fc09734a3911e91eeeb43434f117df/
# chmod +x make-chr.sh
# ./make-chr.sh
#
# Once the reboot is done, login with root/CHANGEME and change the password!
@dnovik
dnovik / cities.csv
Created January 19, 2019 06:55 — forked from nalgeon/cities.md
Города России с координатами
We can make this file beautiful and searchable if this error is corrected: It looks like row 6 should actually have 21 columns, instead of 18. in line 5.
Индекс,Тип региона,Регион,Тип района,Район,Тип города,Город,Тип н/п,Н/п,Код КЛАДР,Код ФИАС,Уровень по ФИАС,Признак центра района или региона,Код ОКАТО,Код ОКТМО,Код ИФНС,Часовой пояс,Широта,Долгота,Федеральный округ,Население
385200,Респ,Адыгея,,,г,Адыгейск,,,0100000200000,ccdfd496-8108-4655-aadd-bd228747306d,4: город,0,79403000000,79703000001,0107,UTC+3,44.8783715,39.190172,Южный,12689
385000,Респ,Адыгея,,,г,Майкоп,,,0100000100000,8cfbe842-e803-49ca-9347-1ef90481dd98,4: город,2,79401000000,79701000001,0105,UTC+3,44.6098268,40.1006527,Южный,144055
649000,Респ,Алтай,,,г,Горно-Алтайск,,,0400000100000,0839d751-b940-4d3d-afb6-5df03fdd7791,4: город,2,84401000000,84701000,0400,UTC+7,51.9582681,85.9602957,Сибирский,62861
658125,край,Алтайский,,,г,Алейск,,,2200000200000,ae716080-f27b-40b6-a555-cf8b518e849e,4: город,0,01403000000,01703000,2201,UTC+7,52.4920914,82.7794145,Сибирский,28528
656000,край,Алтайский,,,г,Барнаул,,,2200000100000,d13945a8-7017-46ab-b1e6-ede1e89317ad,4: город,2,01401000000,01701000,2200,UTC+7,53.