Skip to content

Instantly share code, notes, and snippets.

@dspinellis
dspinellis / cytrox-check.sh
Last active May 29, 2022 14:39
Display host names of Cytrox spyware-hosting sites visited with Firefox
#!/usr/bin/env bash
#
# Display host names of Cytrox spyware-hosting sites visited with Firefox
# See: https://github.com/AmnestyTech/investigations/tree/master/2021-12-16_cytrox
#
# Diomidis Spinellis, May 2022
#
if [ -z "$1" ] ; then
echo "Usage: $0 /path/to/Firefox/places.sqlite" 1>&2
@moyix
moyix / emojiauthor.tex
Created December 13, 2021 19:52
Example of using emoji for author marks in IEEETran
% This is for IEEEtran but should give an idea of how to do it for other styles
% Preamble
\usepackage{emoji}
% [...]
% This is the main piece; we just redefine the IEEEauthorrefmark command and
% replace the symbols. We have to remove the \ensuremath{} because emoji don't
% seem to work in math mode. You can of course replace these emoji with any of
% the ones defined by the emoji package:
@0xabad1dea
0xabad1dea / copilot-risk-assessment.md
Last active September 11, 2023 10:21
Risk Assessment of GitHub Copilot

Risk Assessment of GitHub Copilot

0xabad1dea, July 2021

this is a rough draft and may be updated with more examples

GitHub was kind enough to grant me swift access to the Copilot test phase despite me @'ing them several hundred times about ICE. I would like to examine it not in terms of productivity, but security. How risky is it to allow an AI to write some or all of your code?

Ultimately, a human being must take responsibility for every line of code that is committed. AI should not be used for "responsibility washing." However, Copilot is a tool, and workers need their tools to be reliable. A carpenter doesn't have to

Here's one of my favorite techniques for lateral movement: SSH agent forwarding. Use a UNIX-domain socket to advance your presence on the network. No need for passwords or keys.

root@bastion:~# find /tmp/ssh-* -type s
/tmp/ssh-srQ6Q5UpOL/agent.1460

root@bastion:~# SSH_AUTH_SOCK=/tmp/ssh-srQ6Q5UpOL/agent.1460 ssh [email protected]

user@internal:~$ hostname -f
internal.company.tld
@gullyn
gullyn / flappy.html
Last active January 24, 2025 00:41
Flappy bird in 205 bytes (improved!)
<body onload=z=c.getContext`2d`,setInterval(`c.width=W=150,Y<W&&P<Y&Y<P+E|9<p?z.fillText(S++${Y=`,9,9|z.fillRect(p`}*0,Y-=--M${Y+Y},P+E,9,W),P))):p=M=Y=S=6,p=p-6||(P=S%E,W)`,E=49) onclick=M=9><canvas id=c>
@moyix
moyix / README.txt
Created October 26, 2020 01:14
Recover edge information from afl-showmap
If you have a list of edge hashes produced by AFL (e.g. from something like this):
./afl-showmap -o foo.edges -t 500 -q -e -- ./program arg1
Re-run the program using gdb to trace the sequence of block IDs:
./collect_coverage.sh trace.txt ./program arg1
Print edges in the trace:
@muff-in
muff-in / resources.md
Last active April 16, 2025 15:12
A curated list of Assembly Language / Reversing / Malware Analysis / Game Hacking-resources
<#
.Requires -version 2 - Connect-MicrosoftTeams and then Run the script in Powershell
Updated on 28 Feb 2021
.SYNOPSIS
.\TeamsChannelMemberReport.ps1 - It Can Display all the Teams and its Channels and its members on a List
Or It can Export to a CSV file
With Export of Specific teams
@thrau
thrau / reasons-to-write-shell-scripts.md
Last active August 28, 2020 12:37
Why I write shell scripts

I write scripts to:

  • combine a sequence of commands i could type manually, but am too lazy to (example: proxy-chrome)
  • turn commands i need frequently but can't remember into ones i can (example: ex, ssh-forward, ishostup, rmcaps)
  • do things recursively on a file tree (rgit, mvnrc, chres)
  • perform transformation operations on many files that are too complicated for find (svg2pdf, imgscale)
  • systematize workflows into a script (mvn-release)
  • procrastinate (gdwc)

The given examples are a subset of all the scripts I have in my doftiles that can be found in thrau/dotfiles.

@dreynaud
dreynaud / error-handling.md
Last active November 15, 2024 03:31
Error Handling in Practice

Error Handling in Practice

My experience is mostly with Java backend services in the cloud, so the advice in this post will almost certainly be biased towards this kind of error handling. But hopefully, some of it will be generally applicable and help you maintain and debug your programs in the long run.

I don't claim that these are universal best practices, but I have found these to be useful as general guidelines. As always, use your best judgment and do things that make sense in your context.

Log the whole thing

In Java, a full exception is: