Skip to content

Instantly share code, notes, and snippets.

@ericbarch
ericbarch / chkraid.sh
Last active May 13, 2024 11:34
Dead simple alerts when your mdadm array degrades without setting up a full blown MTA
#!/bin/bash
# dead simple mdadm alerts via webhook
# by eric barch [v1.0 -- 2018.11.26]
# 1. place this file in ~/chkraid.sh
# chmod +x ~/chkraid.sh
# 2. drop this in your crontab:
@Verssae
Verssae / skip.js
Last active May 13, 2024 11:31
한양대학교 인권/폭력예방 교육시스템 스킵 스크립트
/**
[강의 영상 스킵]
1. 재생버튼을 눌러 한양대 로딩 영상이 끝나고(약 4초) 강의가 재생된 후 F12 버튼을 눌러 개발자 콘솔을 연 뒤 console 탭으로 이동한다.
2. 아래 스크립트를 붙여넣는다.
3. 사이트에서 나갈 것이냐고 묻는 창이 뜨면 '나가기'를 누른다.
4. 다시 영상이 로드되면 재생 버튼을 눌러 재생하고 영상 끝으로 컨트롤 버튼을 움직여 영상 시청을 완료한다.
**/
@rponte
rponte / sql_generator.sql
Created December 7, 2022 19:04
PostgreSQL: generating sample data
INSERT INTO proposal (
id, address, created_at, "document", email, "name", salary, status, updated_at
)
select
md5(random()::text || clock_timestamp()::text)::uuid as id
,'Rua das Tabajaras, ' || floor(random() * 9999)::int as address
,localtimestamp as created_at
,left(md5(random()::text), 16) as "document"
,left(md5(random()::text), 6) || '@zup.com.br' as email
,'Customer ' || left(md5(random()::text), 22) as "name"
@rponte
rponte / jaxws-enabled-logging.java
Created February 7, 2020 22:05
Enabling JAXWS request/response logging on console
/**
* Those parameters change depending on JAXWS implementation. In this case, I'm using
* Sun/Oracle implementation
*/
System.setProperty("com.sun.xml.ws.transport.http.client.HttpTransportPipe.dump", "true");
System.setProperty("com.sun.xml.ws.transport.http.HttpAdapter.dump", "true");
System.setProperty("com.sun.xml.internal.ws.transport.http.client.HttpTransportPipe.dump", "true");
System.setProperty("com.sun.xml.internal.ws.transport.http.HttpAdapter.dump", "true");
System.setProperty("com.sun.xml.internal.ws.transport.http.HttpAdapter.dumpTreshold", "999999");
@matthewpi
matthewpi / README.md
Last active May 13, 2024 11:25
Nix on Fedora

NixOS on Fedora

Please note that these instructions are not offically supported or condoned by Nix and are not guaranteed to always work, but from my testing everything seems to work perfectly fine.

These steps may not be required if NixOS/nix#2374 is resolved.

SELinux

These commands are required for both Fedora Workstation and Fedora Silverblue

@vsigler
vsigler / _readme.md
Last active May 13, 2024 11:24 — forked from stecman/_readme.md
Brother P-Touch PT-P300BT bluetooth driver python

Controlling the Brother P-Touch Cube label maker from a computer

The Brother PTP300BT label maker is intended to be controlled using the official Brother P-Touch Design & Print iOS/Android app. The app has arbitrary limits on what you can print (1 text object and up to 3 preset icons), so I thought it would be a fun challenge to reverse engineer the protocol to print whatever I wanted.

Python code at the bottom if you want to skip the fine details.

Process

Intitially I had a quick peek at the Android APK to see if there was any useful information inside. The code that handles the communication with the printer in Print&Design turned out to be a native library, but the app clearly prepares a bitmap image and passes it to this native library for printing. Bitmaps are definitely something we can work with.

/**
* Retrieves all the rows in the active spreadsheet that contain data and logs the
* values for each row.
* For more information on using the Spreadsheet API, see
* https://developers.google.com/apps-script/service_spreadsheet
*/
function readRows() {
var sheet = SpreadsheetApp.getActiveSheet();
var rows = sheet.getDataRange();
var numRows = rows.getNumRows();
@coldfire7
coldfire7 / Valorant Asia Pacific Servers & Ports
Last active May 13, 2024 11:23
Valorant Asia Pacific Servers & Ports
# Valorant Asia Pacific Servers
# Note most of the servers are AWS Global Accelerator anycast IP addresses
# https://aws.amazon.com/global-accelerator/features/#Static_anycast_IP_addresses
# https://en.wikipedia.org/wiki/Anycast
# Last Update: 2023-01-09
# ~CO7DFiRE
# All Asia Pacific Servers
13.248.193.101
13.248.197.71
@squarism
squarism / iterm2.md
Last active May 13, 2024 11:19
An iTerm2 Cheatsheet

Tabs and Windows

Function Shortcut
New Tab + T
Close Tab or Window + W (same as many mac apps)
Go to Tab + Number Key (ie: ⌘2 is 2nd tab)
Go to Split Pane by Direction + Option + Arrow Key
Cycle iTerm Windows + backtick (true of all mac apps and works with desktops/mission control)
@Chaser324
Chaser324 / GitHub-Forking.md
Last active May 13, 2024 11:18
GitHub Standard Fork & Pull Request Workflow

Whether you're trying to give back to the open source community or collaborating on your own projects, knowing how to properly fork and generate pull requests is essential. Unfortunately, it's quite easy to make mistakes or not know what you should do when you're initially learning the process. I know that I certainly had considerable initial trouble with it, and I found a lot of the information on GitHub and around the internet to be rather piecemeal and incomplete - part of the process described here, another there, common hangups in a different place, and so on.

In an attempt to coallate this information for myself and others, this short tutorial is what I've found to be fairly standard procedure for creating a fork, doing your work, issuing a pull request, and merging that pull request back into the original project.

Creating a Fork

Just head over to the GitHub page and click the "Fork" button. It's just that simple. Once you've done that, you can use your favorite git client to clone your repo or j