Skip to content

Instantly share code, notes, and snippets.

Avatar

david davols

View GitHub Profile
@davols
davols / PhonecallReceiver.java
Created Oct 5, 2017 — forked from ftvs/PhonecallReceiver.java
Detecting an incoming call coming to an Android device. Remember to set the appropriate permissions in AndroidManifest.xml as suggested in the Stackoverflow link. Usage example in comments. Source: http://stackoverflow.com/a/15564021/264619 Explanation: http://gabesechansoftware.com/is-the-phone-ringing/#more-8
View PhonecallReceiver.java
package com.gabesechan.android.reusable.receivers;
import java.util.Date;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.telephony.TelephonyManager;
public abstract class PhonecallReceiver extends BroadcastReceiver {
@davols
davols / arenamer.py
Created Mar 6, 2016
Script to rename files (graphics) from iOS format to Android dpi folders.
View arenamer.py
#!/usr/bin/python
# -*- coding: utf-8 -*-
import argparse
import os
import shutil
'''
call with a path that contains files that are named
according to iOS format. Renames and moves the files
@davols
davols / Apparmor bug
Last active May 28, 2019
AppArmor bug
View Apparmor bug
sudo apt-get install apparmor
Reading package lists... Done
Building dependency tree
Reading state information... Done
Suggested packages:
apparmor-docs apparmor-utils
The following NEW packages will be installed:
apparmor
0 upgraded, 1 newly installed, 0 to remove and 3 not upgraded.
Need to get 0 B/319 kB of archives.
View gist:f3524fc52378fb18e83d
zooklubba@Ubuntu-1404-trusty-64-minimal:~$ sudo apt-get install docker.io
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following extra packages will be installed:
aufs-tools cgroup-lite
The following NEW packages will be installed:
aufs-tools cgroup-lite docker.io
0 upgraded, 3 newly installed, 0 to remove and 3 not upgraded.
Need to get 0 B/3822 kB of archives.
View install-elasticsearch-debian
VERSION=0.20.6
sudo apt-get update
sudo apt-get install openjdk-6-jdk
wget https://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-$VERSION.deb
sudo dpkg -i elasticsearch-$VERSION.deb
# be sure you add "action.disable_delete_all_indices" : true to the config!!
You can’t perform that action at this time.