Skip to content

Instantly share code, notes, and snippets.

View tarhan's full-sized avatar

Dmitriy Lekomtsev tarhan

  • Moscow, Russian Federation
View GitHub Profile
@rise-worlds
rise-worlds / build_ffmpeg_aarch64_cross.sh
Last active April 18, 2024 15:44
build ffmpeg with openssl rtmp x264 fdk-aac opus
#!/bin/bash
# sudo apt install gcc-aarch64-linux-gnu g++-aarch64-linux-gnu
# sudo apt install gcc-arm-linux-gnueabi g++-arm-linux-gnueabi
# sudo apt install gcc-arm-linux-gnueabihf g++-arm-linux-gnueabihf
dpkg-query -l gcc-aarch64-linux-gnu > /dev/null || sudo apt install -y gcc-aarch64-linux-gnu g++-aarch64-linux-gnu
dpkg-query -l aria2 > /dev/null || sudo apt install -y aria2
export LOCAL_PATH=$(pwd)
@elmot
elmot / CMakeLists.txt
Last active April 29, 2024 01:26
CMake template for dual-core STM32 MCU
# CMakeLists.txt for dual-core STM32H7xx MCUs and CLion IDE
#
# DISCLAIMER: Experimental version, based on undocumented assumptions how STM32CubeMX works
# DISCLAIMER: THIS FILE IS PROVIDED UNDER "The Unlicense" LICENSE ON AN "AS IS" BASIS, WITHOUT WARRANTY OF ANY KIND
#
# Requirements:
# Toolchain binaries have to be in system path
# STM32CubeMX field "Project Manager | Code Generator | Target IDE" must be set to "STM32CubeIDE"
#
# Tested under environment:
@jamesfulford
jamesfulford / useLocalStorage.js
Last active December 2, 2021 08:32
useLocalStorage() React Hook (from https://usehooks.com/useLocalStorage/)
import { useState } from "react";
export function useLocalStorage<T>(key: string, initialValue: T): [T, (s: T) => void] {
// State to store our value
// Pass initial state function to useState so logic is only executed once
const [storedValue, setStoredValue] = useState<T>(() => {
try {
// Get from local storage by key
const item = window.localStorage.getItem(key);
// Parse stored json or if none return initialValue
@cristianadam
cristianadam / bundle_static_library.cmake
Created January 17, 2020 00:30
CMake function which bundles multiple static libraries into one
# MIT License
#
# Copyright (c) 2019 Cristian Adam
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
@raulqf
raulqf / Install_OpenCV4_CUDA11_CUDNN8.md
Last active July 22, 2024 15:30
How to install OpenCV 4.5 with CUDA 11.2 in Ubuntu 22.04

How to install OpenCV 4.5.2 with CUDA 11.2 and CUDNN 8.2 in Ubuntu 22.04

First of all install update and upgrade your system:

    $ sudo apt update
    $ sudo apt upgrade

Then, install required libraries:

@zodman
zodman / Steps to Obtain Client Secret.md
Created October 4, 2018 00:27 — forked from darthShadow/Steps to Obtain Client Secret.md
Mega Account Creator. Handles registration using megareg. Handles verification using Google Client API.
  1. Use this wizard to create or select a project in the Google Developers Console and automatically turn on the API. Click Continue, then Go to credentials.
  2. On the Add credentials to your project page, click the Cancel button.
  3. At the top of the page, select the OAuth consent screen tab. Select an Email address, enter a Product name (Mega Account Creator) if not already set, and click the Save button.
  4. Select the Credentials tab, click the Create credentials button and select OAuth client ID.
  5. Select the application type Other, enter the name "Mega Account Creator", and click the Create button.
  6. Click OK to dismiss the resulting dialog.
  7. Click the Download JSON button to the right of the client ID.
  8. Move this file to your working directory and rename it client_secret.json.
@unoexperto
unoexperto / patch_apk_for_sniffing.md
Last active July 5, 2024 02:41
How to patch Android app to sniff its HTTPS traffic with self-signed certificate

How to patch Android app to sniff its HTTPS traffic with self-signed certificate

  • Download apktool from https://ibotpeaches.github.io/Apktool/
  • Unpack apk file: java -jar /home/expert/work/tools/apktool.jar d net.flixster.android-9.1.3@APK4Fun.com.apk
  • Modify AndroidManifest.xml by adding android:networkSecurityConfig="@xml/network_security_config" attribute to application element.
  • Create file /res/xml/network_security_config.xml with following content:
<?xml version="1.0" encoding="utf-8"?>
<network-security-config>
    <base-config>
@udkyo
udkyo / Dockerfile
Last active May 1, 2024 12:51
Basic container for X11 forwarding goodness
FROM ubuntu
RUN apt update \
&& apt install -y firefox \
openssh-server \
xauth \
&& mkdir /var/run/sshd \
&& mkdir /root/.ssh \
&& chmod 700 /root/.ssh \
&& ssh-keygen -A \
&& sed -i "s/^.*PasswordAuthentication.*$/PasswordAuthentication no/" /etc/ssh/sshd_config \
@gregdel
gregdel / gogs-migrate.sh
Last active April 26, 2022 01:01
Gitlab to gogs migration
#!/bin/sh
set -e
_usage() {
echo "Usage: $0 [--user|org] USER_OR_ORG_NAME GOGS_REPO_NAME GITLAB_HTTPS_URL"
exit 0
}
MODE=$1