Skip to content

Instantly share code, notes, and snippets.

View themactep's full-sized avatar

Paul Philippov themactep

View GitHub Profile
U-Boot SPL 2013.07 (Mar 19 2021 - 11:29:15)
Timer init
CLK stop
PLL init
pll_init:366
@hutson
hutson / m4.patch
Last active February 2, 2022 16:52
m4 1.4.18
From c79aedf13fe693da0fc5c4ff727aed5bd43526dc Mon Sep 17 00:00:00 2001
From: Hutson Betts <hutson@hyper-expanse.net>
Date: Thu, 10 Dec 2020 21:13:54 -0600
Subject: [PATCH] glibc 2.28
diff --git a/lib/fflush.c b/lib/fflush.c
index ef2a7f1..787790d 100644
--- a/lib/fflush.c
+++ b/lib/fflush.c
@LozanoMatheus
LozanoMatheus / get_ip.sh
Created November 30, 2020 21:41
Get Linux IP without any tool
#!/usr/bin/env bash
## Get the primary and secundary IPs
awk '/\|--/ && !/\.0$|\.255$/ {print $2}' /proc/net/fib_trie
## Get only the primary IPs
awk '/32 host/ { print i } {i=$2}' /proc/net/fib_trie
@unmanned-player
unmanned-player / detect-musl.sh
Last active May 26, 2023 23:05
Actually detecting musl library
#! /bin/sh
# SPDX-License-Identifier: WTFPL
# Actually detecting musl libc.
# How it works
# -------------
#
# WARNING - This is a hack and the concept will likely change in future.
@gabonator
gabonator / camera.md
Created June 4, 2016 13:48
Cheap chinese IP camera with H264 encoding based on Hisilicon 8M (Hi3518E) chip

Cheap chinese IP camera with H264 encoding based on Hisilicon 8M (Hi3518E) chip

Video stream url for VLC/DVR:

  • rtsp://192.168.1.93:554/user=admin&password=&channel=&stream=.sdp?real_stream--rtp-caching=100

Telnet access

  • telnet 192.168.1.10 23
  • Localhost login: root
  • Password: xmhdipc
@marcelstoer
marcelstoer / wifi-watch.lua
Last active October 24, 2016 21:50
Keep NodeMCU connected to WiFi
-- If you have a recent firmware from the dev branch you could do away with that ugly timer
-- by relying on WiFi events and (re-)acting accordingly. See wifi.sta.eventMonReg() at
-- https://github.com/nodemcu/nodemcu-firmware/wiki/nodemcu_api_en#wifistaeventmonreg
-- init all globals
...
wifiReady = 0
function configureWiFi()
@TakahikoKawasaki
TakahikoKawasaki / sinatra+thin+ssl.rb
Last active October 19, 2023 14:38
Sinatra + Thin + SSL
#!/usr/bin/env ruby
#
# This code snippet shows how to enable SSL in Sinatra+Thin.
#
require 'sinatra'
require 'thin'
class MyThinBackend < ::Thin::Backends::TcpServer
def initialize(host, port, options)
@renato-zannon
renato-zannon / patch.rb
Created March 20, 2014 19:21
Fix rails 2.3 filter_parameter_logging for ruby 2.x
# The filter_parameter_logging method, used to filter request parameters
# (such as passwords) from the log, defines a protected method called
# filter_parameter when called. Its existence is later tested using
# respond_to?, without the include_private parameter. Due to the respond_to?
# behavior change, the method existence is never detected, and parameter
# filtering stops working.
require 'action_controller'
module ParameterFilterPatch
def respond_to?(method, include_private = false)
@granoeste
granoeste / webkitmediasource-is-type-supported.html
Last active December 26, 2021 10:54
[JavaScript][HTML5][MediaSource] MediaSource.isTypeSupported
<!DOCTYPE html>
<html>
<head>
<script>
window.MediaSource = window.MediaSource || window.WebKitMediaSource;
function testTypes(types) {
for (var i = 0; i < types.length; ++i)
console.log("MediaSource.isTypeSupported(" + types[i] + ") : " + MediaSource.isTypeSupported(types[i]));
}
@sunny
sunny / paperclip_has_destroyable_file.rb
Created October 25, 2012 17:03
Rails Initializer to add destroyable attachments with Paperclip
# encoding: UTF-8
class ActiveRecord::Base
# Class method to add destroyable paperclip attachments.
#
# Example:
# has_attached_file :image
# has_destroyable_file :image
# attr_accessible :image_delete
#