Skip to content

Instantly share code, notes, and snippets.

View andrewshulgin's full-sized avatar
👾

Andrew Shulgin andrewshulgin

👾
View GitHub Profile
@mcdamo
mcdamo / ipmi-updater.py
Last active January 5, 2025 03:09 — forked from HQJaTu/ipmi-updater.py
Supermicro IPMI certificate updater
#!/usr/bin/env python3
# vim: autoindent tabstop=4 shiftwidth=4 expandtab softtabstop=4 filetype=python
# This file is part of Supermicro IPMI certificate updater.
# Supermicro IPMI certificate updater is free software: you can
# redistribute it and/or modify it under the terms of the GNU General Public
# License as published by the Free Software Foundation, version 2.
#
# This program is distributed in the hope that it will be useful, but WITHOUT
@varhub
varhub / Android - Enable ADB from recovery.md
Created December 23, 2016 17:54
Android - Enable ADB from recovery

Android - Enable ADB from recovery

Credits to @TheOnlyAnil-@Firelord[^stackoverflow]

  • Requirements: a) stock recovery + rooted phone b) custom recovery

  • Files changed:

import android.app.Service;
import android.content.Intent;
import android.graphics.ImageFormat;
import android.hardware.camera2.CameraAccessException;
import android.hardware.camera2.CameraCaptureSession;
import android.hardware.camera2.CameraCharacteristics;
import android.hardware.camera2.CameraDevice;
import android.hardware.camera2.CameraManager;
import android.hardware.camera2.CaptureRequest;
import android.media.Image;
@gabonator
gabonator / password.txt
Last active March 9, 2025 02:17
HiSilicon IP camera root passwords
Summary of passwords by sperglord8008s, updated November 1. 2020. For login try "root", "default", "defaul" or "root"
00000000
059AnkJ
4uvdzKqBkj.jg
7ujMko0admin
7ujMko0vizxv
123
1111
1234
@gilyes
gilyes / Backup, restore postgres in docker container
Last active January 18, 2025 00:57
Backup/restore postgres in docker container
Backup:
docker exec -t -u postgres your-db-container pg_dumpall -c > dump_`date +%d-%m-%Y"_"%H_%M_%S`.sql
Restore:
cat your_dump.sql | docker exec -i your-db-container psql -Upostgres
@JonathonReinhart
JonathonReinhart / SConstruct
Last active October 30, 2024 03:53
mkdir -p implemented in C
env = Environment(
CCFLAGS = ['-Wall', '-Werror'],
)
env.Program('mkdir_p_test', ['mkdir_p.c', 'test.c'])
@tailriver
tailriver / dlopen_sample.c
Created November 18, 2015 04:21
A sample of using dlopen library.
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <dlfcn.h>
int main(int argc, char** argv)
{
void *handle;
void (*func_print_name)(const char*);

Установка и конфигурация KVM (libvirt) на CentOS 7

Установка пакетов

yum -y install qemu-kvm libvirt virt-install dnsmasq

Настройка libvirt

vi /etc/polkit-1/localauthority/50-local.d/50-libvirt-wheel.pkla

#!/usr/bin/env bash
VIDEO=${1}
IMAGE=${2}
TITLE=${3}
TEXT=${4}
NAME=${5}
TIME_FROM_END=${6}
OUTPUT=${7}
FRAME_FONT="frame-font.ttf"
FRAME_COLOR="#313781"
@andyearnshaw
andyearnshaw / README.md
Created April 26, 2014 23:32
Simple KeyboardEvent.key polyfill

Recently, I've been working on a Smart TV application targeted at both LG and Samsung models. I had problems keeping the main code platform independent because the key codes on events generated by the remote controls differed between the vendors. While LG's remote control keys generated fairly sane codes, Samsung's didn't, with the codes for numeric keys seeming completely random (for example, the numeric key 1 has the key code 101, but 5 has 9).

I eventually decided to polyfill KeyboardEvent.key, and allow passing a map to the polyfill so that the platform-dependent code could define their own keysets.

The property exposes itself on both the KeyEvent (non-standard) and KeyboardEvent (standard) objects and is ideal for use in specific, targeted environments.