Skip to content

Instantly share code, notes, and snippets.

Nikita Abdullin 0xABD

  • Planet Earth
Block or report user

Report or block 0xABD

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
@0xABD
0xABD / copyDeps.gradle
Last active May 22, 2019 — forked from n-belokopytov/copyDeps.gradle
Gradle script that generates a task to copy all build variant's dependencies to a certain directory for use with Nexus IQ Server. It copies exploded AARs too, renaming the classes.jar file into "<aar_dependency_name>.jar".
View copyDeps.gradle
apply plugin: 'com.android.application'
android.applicationVariants.all { variant ->
task "copyDependencies${variant.name.capitalize()}"() {
outputs.upToDateWhen { false }
doLast {
println "Executing copyDependencies${variant.name.capitalize()}"
variant.getCompileClasspath().each { fileDependency ->
def sourcePath = fileDependency.absolutePath
def destinationPath = project.projectDir.path + "/build/dependencies/${variant.name}/"
@0xABD
0xABD / bakts.bat
Created Feb 12, 2019
Create a *.bak copy with timestamp
View bakts.bat
@ECHO OFF
for /f %%a in ('time_stamp.exe') do (set ts=%%a)
copy %1 %1.%ts%.bak
View simple-https-server.py
# taken from http://www.piware.de/2011/01/creating-an-https-server-in-python/
# generate server.xml with the following command:
# openssl req -new -x509 -keyout key.pem -out server.pem -days 365 -nodes
# run as follows:
# python simple-https-server.py
# then in your browser, visit:
# https://localhost:4443
import BaseHTTPServer, SimpleHTTPServer
import ssl
@0xABD
0xABD / android-fix-dcim-timestamp.sh
Created Nov 24, 2013
android: fix photo and video timestamps from their filenames
View android-fix-dcim-timestamp.sh
#!/bin/sh
#
# android - fix photo and video timestamps from their filenames
#
# IMG_YYYYMMDD_HHMMSS.jpg
# PANO_YYYYMMDD_HHMMSS.jpg
# VID_YYYYMMDD_HHMMSS.mp4
#
cd /sdcard/DCIM/Camera/
for i in IMG*.jpg; do touch -t ${i:4:8}.${i:13:6} $i; done;
View keepawake.py
import time
import sys
import os
import ctypes
ES_CONTINUOUS = 0x80000000
ES_AWAYMODE_REQUIRED = 0x00000040
ES_SYSTEM_REQUIRED = 0x00000001
ES_DISPLAY_REQUIRED = 0x00000002
@0xABD
0xABD / battlife.vbs
Created Jan 10, 2012
windows: this vbscript returns the remaining battery percentage
View battlife.vbs
On Error Resume Next
strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set colItems = objWMIService.ExecQuery("Select * from Win32_Battery",,48)
For Each objItem in colItems
Wscript.Echo objItem.EstimatedChargeRemaining&"%"
Next
@0xABD
0xABD / file_change_notify_to_ftp.ps1
Created Jan 28, 2012
windows: PowerShell: watch for file changes and upload them to FTP
View file_change_notify_to_ftp.ps1
#
# Watch for files in $watchDir that a match a filer $watchFilter
# and upload them to FTP $ftpUrl when they are changed (modified)
#
$ftpUrl = "ftp://username:password@example.com/pub/incoming/"
$watchDir = "C:\temp"
$watchFilter = "*.txt"
function uploadFile($fullFileName)
@0xABD
0xABD / hexdump.py
Last active Jan 10, 2017 — forked from 1mm0rt41PC/hexdump.py
hexdump with full support for python2.x and python 3.x
View hexdump.py
def hexdump( src, length=16, sep='.' ):
'''
@brief Return {src} in hex dump.
@param[in] length {Int} Nb Bytes by row.
@param[in] sep {Char} For the text part, {sep} will be used for non ASCII char.
@return {Str} The hexdump
@note Full support for python2 and python3 !
'''
result = [];
@0xABD
0xABD / bakts.bat
Created Sep 7, 2015
backup file "filename.ext" to "filename.ext.YYYYMMDDHHMISS.bak" using timestamp.exe
View bakts.bat
@ECHO OFF
for /f %%a in ('timestamp.exe') do (set ts=%%a)
copy /V "%1" "%1.%ts%.bak"
View simple-https-server.py
# taken from http://www.piware.de/2011/01/creating-an-https-server-in-python/
# generate server.xml with the following command:
# openssl req -new -x509 -keyout server.pem -out server.pem -days 365 -nodes
# run as follows:
# python simple-https-server.py
# then in your browser, visit:
# https://localhost:4443
import BaseHTTPServer, SimpleHTTPServer
import ssl
You can’t perform that action at this time.