Skip to content

Instantly share code, notes, and snippets.

View max-mapper's full-sized avatar
🔰
✌( ͡ᵔ ͜ʖ ͡ᵔ )✌

Max max-mapper

🔰
✌( ͡ᵔ ͜ʖ ͡ᵔ )✌
View GitHub Profile
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@klingtnet
klingtnet / how-to-upgrade-nvmw-ssd-firmware-on-linux.md
Last active September 16, 2023 23:37
How to upgrade [Lenovo] NVMe SSD firmware on Linux

The instructions were tested on a Lenovo X1 Carbon 5th Gen (X1C5) on Arch Linux but should be applicable to other Lenovo models and Linux distributions.

BACKUP YOUR DATA! I created a bootable Ubuntu Image like this:

$ sudo sh -c 'curl --location --silent --fail "http://releases.ubuntu.com/18.04/ubuntu-18.04.1-desktop-amd64.iso" | pv > /dev/<your-usb-drive>'
# note that pv is only there to show progress, it is perfectly fine to redirect curl to the usb drive directly.

then I booted from this drive by pressing F12 on reboot and dumped my NVMe disk to an external hard drive like this:

@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)
@zougloub
zougloub / dvr.py
Last active May 13, 2023 07:58
Tiny DVR for RTSP/H264 cameras
#!/usr/bin/env python
# -*- coding:utf-8 vi:noet
# RTSP/H264 simple camera DVR
__author__ = "Jérôme Carretero <cJ-tub@zougloub.eu>"
__license__ = "MIT"
import sys, io, os, re, time, datetime
import gi
@john-science
john-science / smallest_lenses_for_sony_a7.md
Last active August 27, 2019 15:06
The smallest lenses adaptable to the Sony a7 (series)

Smallest Lenses Adaptable to the Sony a7

This has been moved to a blog post.

@jlord
jlord / index.sh
Last active February 9, 2016 06:20 — forked from max-mapper/index.sh
imagemagick script: image background is a larger, blurred copy of itself.
for f in *.jpg; do
convert ./"$f" -gravity center -resize 1137 -extent 1137x640 -blur 0x4 ./finalcat/"new-$f"
convert ./finalcat/"new-$f" -page +248 ./"$f" -flatten ./finalcat/"new-$f"
done
@rahuljiresal
rahuljiresal / openshift-node-force-domain.js
Last active July 22, 2016 08:53
This is a middleware for Connect and Express that redirects any requests to a default domain. Based on https://github.com/goloroden/node-force-domain, modified to work on Openshift platform.
/*
Openshift uses haproxy (haproxy.org) as a front proxy to route request to instances of the app.
This proxy does the job of unwrapping https and sets the 'x-forwarded-proto' header.
Because of this, the Node.JS app never sees the actual protocol of the request, unless it checks the presence of this header.
I modified the code written by goloroden (https://github.com/goloroden/node-force-domain) to check this header instead of ports.
This gist does exactly what his code does, except checks for actual protocol instead of relying on the port for the protocol.
*/
var rewrite = function (route, options) {
options = _.defaults({

From Fabrice Bellard, with minor name change (umulh):

// return the high 32 bit part of the 64 bit addition of (hi0, lo0) and (hi1, lo1)
Math.iaddh(lo0, hi0, lo1, hi1)

// return the high 32 bit part of the 64 bit subtraction of (hi0, lo0) and (hi1, lo1)
Math.isubh(lo0, hi0, lo1, hi1)

// return the high 32 bit part of the signed 64 bit product of the 32 bit numbers a and b
@bmpvieira
bmpvieira / heroku-dat-test.md
Created August 9, 2014 13:55
Test Dat on Heroku
  • Go to https://github.com/bmpvieira/heroku-dat-template and click Deploy;
  • Choose a name (like test-dat);
  • Wait for deploy to finish and click "View it" (http://test-dat.herokuapp.com);
  • Click import -> paste JSON -> Copy/Paste example;
  • Do dat clone http://test-dat.herokuapp.com and cd into folder;
  • Do dat serve and go to localhost:6461;
  • PROBLEM 1: No data;
  • Kill, do echo '{"hello":"world"}'|dat import --json and serve again;
  • Now there's some data, kill and do dat push http://test-dat.herokuapp.com
  • PROBLEM 2: Nothing changed on Heroku
@juliangruber
juliangruber / gist:8088601
Created December 22, 2013 21:22
pkginit
{
"name" : basename.replace(/^node-/, ''),
"description" : prompt(),
"version" : "0.0.0",
"repository" : {
"type" : "git",
"url" : "git://github.com/juliangruber/" + basename + ".git"
},
"homepage": "https://github.com/juliangruber/" + basename,
"main" : prompt('entry point', 'index.js'),