Skip to content

Instantly share code, notes, and snippets.

@jwmcgettigan
jwmcgettigan / bitwarden_duplicate_cleaner.py
Last active July 20, 2024 06:59
Identifies and removes duplicate 'items' and 'folders' from your Bitwarden vault. 🎃
#!/usr/bin/env python3
# Copyright © 2023 Justin McGettigan
# Permission is hereby granted, free of charge, to any person obtaining a copy of this software
# and associated documentation files (the “Software”), to deal in the Software without
# restriction, including without limitation the rights to use, copy, modify, merge, publish,
# distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the
# Software is furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all copies or
@aymericbeaumet
aymericbeaumet / delete-likes-from-twitter.md
Last active July 20, 2024 14:26
[Recipe] Delete all your likes/favorites from Twitter

Ever wanted to delete all your likes/favorites from Twitter but only found broken/expensive tools? You are in the right place.

  1. Go to: https://twitter.com/{username}/likes
  2. Open the console and run the following JavaScript code:
setInterval(() => {
  for (const d of document.querySelectorAll('div[data-testid="unlike"]')) {
    d.click()
 }
@lizthegrey
lizthegrey / attributes.rb
Last active February 24, 2024 14:11
Hardening SSH with 2fa
default['sshd']['sshd_config']['AuthenticationMethods'] = 'publickey,keyboard-interactive:pam'
default['sshd']['sshd_config']['ChallengeResponseAuthentication'] = 'yes'
default['sshd']['sshd_config']['PasswordAuthentication'] = 'no'
@licatajustin
licatajustin / city-lights.terminal
Created June 26, 2018 01:25
City Lights - macOS Terminal theme
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>ANSIBlackColor</key>
<data>
YnBsaXN0MDDUAQIDBAUGKyxYJHZlcnNpb25YJG9iamVjdHNZJGFyY2hpdmVyVCR0b3AS
AAGGoKcHCBMZHSQoVSRudWxs1QkKCwwNDg8QERJcTlNDb21wb25lbnRzVU5TUkdCXE5T
Q29sb3JTcGFjZV8QEk5TQ3VzdG9tQ29sb3JTcGFjZVYkY2xhc3NPECgwLjIwNzg0MzEz
NzMgMC4yNDcwNTg4MjM1IDAuMjg2Mjc0NTA5OCAxTxAnMC4xNTc1NDY3NDM4IDAuMTg4
@puregarlic
puregarlic / deployment.js
Last active June 15, 2018 08:37
Get the latest Now deployment for a given project and write the URL to a .env file. Useful for linking dev and staging deployments together.
const fs = require('fs')
const https = require('https')
function sortDeployments ({ deployments }, name) {
const matches = deployments.filter(deployment => {
if (deployment.name === name) {
return {
created: deployment.created,
url: deployment.url
}
@ceejbot
ceejbot / esm_in_node_proposal.md
Last active June 20, 2024 10:45
npm's proposal for supporting ES modules in node

ESM modules in node: npm edition

The proposal you’re about to read is not just a proposal. We have a working implementation of almost everything we discussed here. We encourage you to checkout and build our branch: our fork, with the relevant branch selected. Building and using the implementation will give you a better understanding of what using it as a developer is like.

Our implementation ended up differing from the proposal on some minor points. As our last action item before making a PR, we’re writing documentation on what we did. While I loathe pointing to tests in lieu of documentation, they will be helpful until we complete writing docs: the unit tests.

This repo also contains a bundled version of npm that has a new command, asset. You can read the documentation for and goals of that comma

@se35710
se35710 / find-java.ps1
Last active November 25, 2023 18:08
PowerShell script to locate Java on Windows, optionally sets JAVA_HOME and JRE_HOME.
<#
.SYNOPSIS
Locates Java versions and optionally sets JAVA_HOME and JRE_HOME.
.DESCRIPTION
The Find-Java function uses PATH, JAVA_HOME, JRE_HOME and Windows Registry to retrieve installed Java versions.
If run with no options, the first Java found is printed on the console.
.PARAMETER Vendor
Selects Java vendor, currently supports Oracle, OpenJDK and IBM. Defaults to Any.
.PARAMETER Architecture
What processor architecture to match. Valid options are 32, 64, Match and All. Match detects what integer size is used for the PowerShell process, and matches the architecture. If Wow64 is available, 64 bit versions of Java are selected first.
@cowboy
cowboy / sudo-keepalive-example.sh
Created July 15, 2012 20:55
Bash: Sudo keep-alive (good for long-running scripts that need sudo internally but shouldn't be run with sudo)
#!/bin/bash
# Might as well ask for password up-front, right?
sudo -v
# Keep-alive: update existing sudo time stamp if set, otherwise do nothing.
while true; do sudo -n true; sleep 60; kill -0 "$$" || exit; done 2>/dev/null &
# Example: do stuff over the next 30+ mins that requires sudo here or there.
function wait() {
@nicoulaj
nicoulaj / build-zsh.sh
Created November 25, 2010 20:19
Build Zsh from sources on Ubuntu
#!/bin/sh​
# Build Zsh from sources on Ubuntu.
# From http://zsh.sourceforge.net/Arc/git.html and sources INSTALL file.
# Some packages may be missing
sudo apt-get install -y git-core gcc make autoconf yodl libncursesw5-dev texinfo
git clone git://zsh.git.sf.net/gitroot/zsh/zsh
cd zsh