Skip to content

Instantly share code, notes, and snippets.

@mdPlusPlus
mdPlusPlus / badblocks.txt
Last active June 20, 2024 13:28
How to check new hard drives with badblocks
badblocks -b 4096 -p 0 -s -t 0 -v -w DEVICE
-b block_size
-p num_passes
-s Show the progress of the scan
-t test_pattern
-v Verbose mode
-w Use write-mode test
@masemoel
masemoel / BuildGuide.txt
Last active June 28, 2024 20:11
How to build an A12+ ROM from scratch under Ubuntu 22.04 (or based) and higher
To build a A12+ (AOSP/LOS based) on Ubuntu 22.04+ (or distros based on it), there are four main steps:
(This guide is applicable for recoveries as well (TWRP, OFRP...))
Working on Android 12 and upper
#################################################################
# Step 1: Setup your environment #
#################################################################
****Setup Linux to build Android****
@gargomoma
gargomoma / gDriveLib.py
Last active May 5, 2020 08:35
A simple Python Class to handle basic interactions with GDrive (APIv3).
#Based on: https://github.com/samlopezf/google-drive-api-tutorial/blob/master/google-drive-api-tutorial-project/main.py
from __future__ import print_function
import os, io
import pickle
import os.path
from googleapiclient.discovery import build
from google_auth_oauthlib.flow import InstalledAppFlow
from google.auth.transport.requests import Request
from apiclient.http import MediaFileUpload, MediaIoBaseDownload
@samanshahmohamadi
samanshahmohamadi / MappingTest.sol
Created January 15, 2019 09:40
How to return whole mapping in solidity
pragma solidity ^0.4.25;
contract MappingTest {
mapping(uint=>address) public addresses;
uint addressRegistryCount;
function set(address userAddress) public{
addresses[addressRegistryCount] = userAddress;
addressRegistryCount++;
}
@joepie91
joepie91 / vpn.md
Last active June 29, 2024 17:36
Don't use VPN services.

Don't use VPN services.

No, seriously, don't. You're probably reading this because you've asked what VPN service to use, and this is the answer.

Note: The content in this post does not apply to using VPN for their intended purpose; that is, as a virtual private (internal) network. It only applies to using it as a glorified proxy, which is what every third-party "VPN provider" does.

  • A Russian translation of this article can be found here, contributed by Timur Demin.
  • A Turkish translation can be found here, contributed by agyild.
  • There's also this article about VPN services, which is honestly better written (and has more cat pictures!) than my article.
@kimondo
kimondo / Raspberry Pi Pi-Lite web counter
Created November 19, 2013 23:09
Raspberry Pi Pi-Lite web counter - grabs some stats off the wordpress stats API and then sends them to the serial port to be picked up by an arduino based LED display (ciseco.co.uk Pi-Lite or wharfe-education.com BelleVue)
import serial
import time
import urllib2
from BeautifulSoup import BeautifulSoup
# Configure Pi serial port
s = serial.Serial()
s.baudrate = 9600
s.timeout = 0
@dankrause
dankrause / ssdp.py
Last active April 25, 2024 13:14
Tiny python SSDP discovery library with no external dependencies
# Copyright 2014 Dan Krause
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,