Skip to content

Instantly share code, notes, and snippets.

View alibitek's full-sized avatar
🌱
Growing

Alex Bitek alibitek

🌱
Growing
View GitHub Profile
@alibitek
alibitek / copy_android_apks.sh
Last active August 29, 2015 13:56
Copy all system or non-system APKs from an Android device
# Copy all non-system apks
i=0; APK_DIR=$HOME/Downloads/Android_APKs; [ ! -f "$APK_DIR" ] && mkdir -p "$APK_DIR"; for package in $(adb shell pm list packages -f -3 | cut -d'=' -f1 | cut -d ':' -f2); do let i++; echo "$i ~> $package"; adb pull "$package" "$APK_DIR"; done
# List all non system apks
i=0; for package in $(adb shell pm list packages -f -3 | cut -d'=' -f1 | cut -d ':' -f2); do let i++; echo "$i ~> $package"; done
# Copy all system apks
i=0; APK_DIR=$HOME/Downloads/Android_APKs; [ ! -f "$APK_DIR" ] && mkdir -p "$APK_DIR"; for package in $(adb shell pm list packages -f | grep -P "(system/app|system/priv-app)" | cut -d':' -f2 | cut -d'=' -f1); do let i++; echo "$i ~> $package"; adb pull "$package" "$APK_DIR"; done
/* Copyright (C) 1997,1998,1999,2000,2001,2006 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
The GNU C Library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
@alibitek
alibitek / update_svn_recursive.sh
Created March 18, 2014 17:01
Update SVN repository recursive
#!/usr/bin/env bash
function update ()
{
#echo "Call to update ($1)"
if [ -d $1/.svn ]
then
echo "Updating $1..."
svn up $1
else
/*
* Copyright 2013 Phil Brown
*
* 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
@alibitek
alibitek / time_literals.cpp
Created June 7, 2014 15:10
A template for converting a uint64_t giving a duration in terms of T1 into a duration expressed as a T2.
/**
* A template for converting a uint64_t giving a duration in terms of T1 into
* a duration expressed as a T2.
*
* For example, MkTime<std::chrono::seconds> takes in a uint64_t of seconds
* and returns a std::chrono::microseconds.
*/
template <typename T1, typename T2 = std::chrono::microseconds>
T2 MkTime(uint64_t raw_time)
{
/* Copyright (C) 1997,1998,1999,2000,2001,2006 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
The GNU C Library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
#pragma once
#include <cstdint> // for standard integer types
#include <cmath> // for float_t and double_t
/*
* Fastest minimum-width integer types [C11 Standard (ISO/IEC 9899:2011) Section 7.20.1.3]
*
* Each of the following types designates an integer type that is usually fastest to operate
* with among all integer types that have at least the specified width.
#pragma once
#ifndef HTTP_CLIENT_HPP
#define HTTP_CLIENT_HPP
#include <string>
#include <map>
#include <algorithm>
#include <boost/range.hpp>
#include <boost/range/functions.hpp>
#include <boost/range/numeric.hpp>
#!/usr/bin/env ruby
require 'rubygems'
require 'net/https'
require 'openssl'
require 'uri'
require 'json'
require 'mongo'
USERNAME = ""
@alibitek
alibitek / WhitespacePath.java
Created June 7, 2014 15:20
Normalize white space in filepath
import java.io.BufferedInputStream;
import java.io.FileInputStream;
import java.io.IOException;
import java.nio.charset.Charset;
import java.nio.file.Path;
import java.nio.file.Paths;
public class TestWhiteSpace {
public static void main(String[] args) throws IOException {