Skip to content

Instantly share code, notes, and snippets.

View e-kotov's full-sized avatar
🎯
Focusing

Egor Kotov e-kotov

🎯
Focusing
View GitHub Profile
@halilim
halilim / Homebrew OpenSSH with macOS keychain.md
Created December 29, 2023 20:50
Homebrew OpenSSH with macOS keychain

Problem:

  1. macOS (14.2.1) ssh (OpenSSH_9.4p1, LibreSSL 3.3.6) is vulnerable to Terrapin attack (as reported by the scanner).
  2. The regular OpenSSH (e.g. via Homebrew) doesn't support the UseKeychain option

Workaround:

  1. Automator > new Application > Run Shell Script: ~/bin/login-script, save as Login script.app
  2. Create a new file ~/bin/login-script with contents:
@Yanivmd
Yanivmd / LateX Diff with Overleaf
Last active May 18, 2024 10:27
LateX Diff with Overleaf
Follow this:
https://github.com/comaniac/latex-proj-tool
After install, you do:
python3 -m latex_proj_tool flat old_project/main.tex --output old.tex
main.tex points to main file, the script will find the rest.
For latexdiff, use this online tool:
https://3142.nl/latex-diff/
@pudquick
pudquick / brew.md
Last active April 6, 2024 21:42
Lightly "sandboxed" homebrew on macOS

brew is a bad neighbor

This isn't a guide about locking down homebrew so that it can't touch the rest of your system security-wise.

This guide doesn't fix the inherent security issues of a package management system that will literally yell at you if you try to do something about "huh, maybe it's not great my executables are writeable by my account without requiring authorization first".

But it absolutely is a guide about shoving it into its own little corner so that you can take it or leave it as you see fit, instead of just letting the project do what it likes like completely taking over permissions and ownership of a directory that might be in use by other software on your Mac and stomping all over their contents.

By following this guide you will:

  • Never have to run sudo to forcefully change permissions of some directory to be owned by your account

{{title}}

![[%(metadataFileName)#Metadata]]

Other files: {{mdnotesFileName}} {{metadataFileName}}

Zotero links

{{localLibrary}}

@ferblape
ferblape / ine_intercensal.rb
Created May 23, 2019 12:10
Scrap INE > Alteraciones de los municipios en los Censos de Población desde 1842
# Fetch data from https://www.ine.es/dyngs/INEbase/es/operacion.htm?c=Estadistica_C&cid=1254736176998&menu=resultados&idp=1254735572981
require "nokogiri"
require "byebug"
require "json"
url = "https://www.ine.es/intercensal/intercensal.do"
uri = URI.parse(url)
data = {}
INE::Places::Province.all.each do |province|
@zbeekman
zbeekman / GH-CF-strict-SSL-w-CDN.md
Last active May 14, 2024 16:11
Setting up GH-pages with custom domain, strict (end-to-end) SSL with CloudFlare DNS & CDN

Custom domains, GH-pages, Cloudflare and strict SSL end-to-end encryption

Why I wrote this

Before Github supported SSL encryption for github pages sites, many people were using CloudFlare (CF) as their DNS provider and CDN proxy. CF allowed users to enable SSL encryption from the CDN end points/proxies to the end user. This was great and it allowed visitors to your website to connect with a secure connection between their browser and the cloudflare CDN box that was serving your content. However, with this setup one (significant) link in the chain remained unencrypted and

@rCarto
rCarto / mtq.R
Last active August 21, 2023 19:06
library(raster)
library(cartography)
library(sf)
library(SpatialPosition)
mtq <- st_read(system.file("shape/martinique.shp", package="cartography"))
# use WGS84 proj
mtq_latlon <- st_transform(mtq, 4326)
# this call throw an error but seems to work...
getData('SRTM', lon=-61, lat=14)
library(sf)
library(spatstat)
library(sp)
library(maptools)
library(raster)
library(cartography)
library(SpatialPosition)
## import dataset
feat <- sf::st_read("https://gist.githubusercontent.com/rCarto/747164575e3f216a123c3092d0ce9162/raw/f12390464f255b5f9760c577ab6bf5456cf61a40/iris75.geojson")
@napsternxg
napsternxg / LatexDiffOverleaf.md
Last active May 18, 2024 10:26
Doing diff for latex projects on Overleaf

Steps for doing latexdiff

  • Download 2 versions from overleaf
  • Compile them using the TexStudio. I should create a bbl file.
  • Create a new tex file where you replace the bibliography section with the contents of the bbl file.
  • Do the same for the other version of the file.
  • Check that the new tex file for both version compiles to the same contents of the original tex files.
  • Open https://3142.nl/latex-diff/ and paste the contents of the new tex files from both versions in the text boxes.
  • Click the box named "Generate LateX document showing differences"
  • It will take some time and then create the diff file.
@agentcooper
agentcooper / 0.README.md
Last active April 9, 2024 19:27
Telegram chat backup/export

How to use

  1. Login to https://web.telegram.org
  2. Copy-paste contents of telegram-scripts.js into JS console
  3. Run showContacts() to get the list of contacts with ids
  4. Run saveChat(userId) where userId is the id from step 3

Process can take a while, check console for progress. Occasionall FLOOD_WAIT errors are expected. Once done, browser will download the JSON file.

Motivation