Skip to content

Instantly share code, notes, and snippets.

Lomanic

Block or report user

Report or block Lomanic

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@Lomanic
Lomanic / Readme.md
Created Feb 4, 2020 — forked from fracz/Readme.md
Restore intentionally deleted commits in Git
View Readme.md

Restore intentionally deleted commits in Git (remote)

Situation

  1. You own a Git repository server and the developers do not have access to it (i.e. they can only read & write to the repo, but not gc it).
  2. You had a developer that wrote a project for you.
  3. He got angry for whatever reason and deleted all branches from the remote repo. He also push -fed the master branch leaving only one silly commit there.
  4. He escaped from the country leaving you without any code at all (at least this is what he believe in).
  5. You have never cloned the repo to other machine. There were only two copies of it: the developer's one and the server's one.
@Lomanic
Lomanic / sonoff_s20_blinky_led.ino
Created Sep 21, 2019
Make Sonoff S20 internal LED blink
View sonoff_s20_blinky_led.ino
#define RELAY_PIN 12
#define LED_PIN 13
void setup() {
Serial.begin(115200);
Serial.println("START");
pinMode(LED_PIN, OUTPUT);
View sonoff_s20_wifimanager_with_button_reset.ino
#include <ESP8266WiFi.h> //https://github.com/esp8266/Arduino
//needed for library
#include <DNSServer.h>
#include <ESP8266WebServer.h>
#include <WiFiManager.h> //https://github.com/tzapu/WiFiManager
//for LED status
#include <Ticker.h>
Ticker ticker;
@Lomanic
Lomanic / send-magic-packet.sh
Last active Jun 21, 2019 — forked from SteveMarshall/send-magic-packet.sh
Wake-On-Lan Magic Packet using netcat in bash
View send-magic-packet.sh
#!/usr/bin/env bash
mac_address=$1
# Strip colons from the MAC address
mac_address=$(echo $mac_address | sed 's/://g')
broadcast=$2
port=4343
# Magic packets consist of 12*`f` followed by 16 repetitions of the MAC address
@Lomanic
Lomanic / connect.md
Created Jan 2, 2019
Easily connect to _SNCF_WIFI_INOUI hotspots
View connect.md

This is as simple as curl -X POST https://wifi.sncf/router/api/connection/activate/auto.

No need to give your ticket number.

Not using a Unix-like OS (say, on mobile)? Just head over to the "chatbot" at https://wifi.sncf/fr/internet/bot and accept the EULA (french: CGU) and tell the bot that you have a foreign ticket.

@Lomanic
Lomanic / utmstrip.user.js
Last active Nov 7, 2018 — forked from paulirish/utmstrip.user.js
userscript: Drop the UTM params from a URL when the page loads
View utmstrip.user.js
// ==UserScript==
// @name UTM param stripper
// @author Paul Irish, Sam Hasler, Lomanic
// @namespace http://github.com/paulirish
// @version 1.3
// @description Drop the UTM params from a URL when the page loads.
// @extra Cuz you know they're all ugly n shit.
// @include /^http.*\?.*[?&]utm_.*$/
// @run-at document-start
// @updateURL https://gist.github.com/Lomanic/cf1158a9bfb90d8b5dbbb4d05483e857/raw/utmstrip.user.js
@Lomanic
Lomanic / common.sh
Created Feb 13, 2018 — forked from jeckel/common.sh
Common bash functions
View common.sh
#!/bin/bash
# ----------------------------------------------------------
# Define common colors and styles
#
readonly RED='\033[0;31m'
readonly GREEN='\033[0;32m'
readonly ORANGE='\033[0;33m'
readonly BLUE='\033[0;34m'
readonly PURPLE='\033[0;35m'
View gist:9afe9d43e6337ff0dbeeaadf466d33d8
31683AD77BFC47A1D1A4F30959FDDE26|0001 - Electroplankton (Japan).nds
4E24E5D333A91F948265A177B2FF9DB2|0001 - Electroplankton (Japan) (1).nds
283631768B2213227FBBEE91154C688F|0002 - Need for Speed - Underground 2 (USA) (En,Fr,De,Es,It).nds
C7B2F7A5861F7D4BC94FF050D0B4FBD0|0002 - Need for Speed - Underground 2 (USA) (En,Fr,De,Es,It) (1).nds
D57CB3335F228F3DB869003766D10970|0002 - Need for Speed - Underground 2 (USA) (En,Fr,De,Es,It) (2).nds
C8065C4B4A21337C2928A14973218D26|0003 - Yoshi Touch & Go (USA).nds
827CBAB11FB04D1C87389077CB5809BE|0003 - Yoshi Touch & Go (USA) (1).nds
90C6F561CAFB5EDE611398E2F5CA88BD|0003 - Yoshi Touch & Go (USA) (2).nds
6796156F49B5ED663EF986B379FFD4EA|0003 - Yoshi Touch & Go (USA) (3).nds
FD920DBC37C332D392B547B1D7D5839D|0004 - Feel the Magic - XY-XX (USA) (En,Ja).nds
@Lomanic
Lomanic / stdout.txt
Created Jan 4, 2018
go test ./... github.com/shirou/gopsutil ; HEAD 7ec06ec ; GOOS=windows GOARCH=amd64
View stdout.txt
go test ./...
? github.com/shirou/gopsutil [no test files]
--- FAIL: TestCPUPercentIntervalZeroPerCPU (1.69s)
cpu_test.go:124: CPUPercent value is invalid: 1100.000000
FAIL
FAIL github.com/shirou/gopsutil/cpu 5.957s
--- FAIL: TestDisk_partitions (0.01s)
disk_test.go:26: error Accès refusé.
FAIL
FAIL github.com/shirou/gopsutil/disk 1.039s
@Lomanic
Lomanic / open_process.go
Created Nov 12, 2017 — forked from castaneai/open_process.go
WinAPI OpenProcess in Golang
View open_process.go
package main
import (
"fmt"
"syscall"
"unsafe"
)
type Process uintptr
You can’t perform that action at this time.