This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.example.android.apis.graphics; | |
import java.nio.IntBuffer; | |
import javax.microedition.khronos.egl.EGLConfig; | |
import javax.microedition.khronos.opengles.GL10; | |
import android.app.Activity; | |
import android.content.Context; | |
import android.opengl.GLSurfaceView; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
protected static Uri getRandomExternalImageContent(Context c) { | |
ContentResolver resolver = c.getContentResolver(); | |
if (resolver == null) | |
return null; | |
String [] proj = { MediaStore.Images.Media.DATA }; | |
Cursor cursor = resolver.query(Images.Media.EXTERNAL_CONTENT_URI, proj, null, null, null); | |
int count = cursor.getCount(); | |
int position = (int) (Math.random() * count); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
adb shell am | |
usage: am [subcommand] [options] | |
usage: am start [-D] [-W] [-P <FILE>] [--start-profiler <FILE>] | |
[--R COUNT] [-S] [--opengl-trace] <INTENT> | |
am startservice <INTENT> | |
am force-stop <PACKAGE> | |
am kill <PACKAGE> | |
am kill-all | |
am broadcast <INTENT> | |
am instrument [-r] [-e <NAME> <VALUE>] [-p <FILE>] [-w] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
adb='/cygdrive/c/Android/sdk/platform-tools/adb.exe' | |
$adb shell screencap -p | perl -pe 's/\x0D\x0D\x0A/\x0A/g' > screen.png | |
STAMP=`date +"%Y%m%d_%H%M%S"` | |
mv -f screen.png screen-$STAMP.png |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# not working | |
#7za a -r -t7z -m=Deflate64 -mt=12 $FILE_OUT $A_DIR | |
7za a -r -t7z -m0=LZMA2 -mmt=on $FILE_OUT $A_DIR | |
#http://7zip.bugaco.com/7zip/MANUAL/switches/method.htm#ZipMultiThread | |
#mt=[off | on | {N}] | |
#Sets multithread mode. If you have a multiprocessor or multicore system, you can get a speed increase with this switch. This option #affects only compression with BZip2, Deflate and Deflate64 methods and decompression of BZip2 streams. | |
#Each thread in the multithread mode uses 32 MB of RAM for buffering. If you specify {N}, 7-Zip tries to use N threads. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sub myline(x1, x2, l) | |
Dim i As Integer | |
Dim shp As Shape | |
Dim sld As Slide | |
Set sld = Application.ActiveWindow.View.Slide | |
Set shp = sld.Shapes.AddShape(37, x1, 10 * l, x2 - x1, 0) | |
shp.Fill.ForeColor.RGB = RGB(137, 143, 75) | |
shp.Fill.BackColor.RGB = RGB(137, 143, 75) | |
shp.ShapeStyle = 10002 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
( tail -n 0 -f --follow=name --retry $* \ | |
/var/log/audit/audit.log \ | |
/var/log/messages \ | |
/var/log/httpd/*log \ | |
/var/log/tomcat/catalina.out \ | |
/var/log/tomcat-rewrite.log \ | |
/var/log/nginx/*log \ | |
/var/log/firewalld \ | |
/var/log/secure \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
/bin/socat TCP-LISTEN:23455,fork SYSTEM:"/root/monitor" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
( tail -n 0 -f --follow=name --retry $* \ | |
/var/lib/containers/storage/overlay-containers/68dd6c9415c7988fff9eee72253caa8a0165b7d06e1854e81a3366db6daee271/userdata/ctr.log & \ | |
journalctl --no-pager --follow --full & ) \ | |
2>&1 \ | |
| grep -v -i "audit.*res=success" | |
| grep -v -i "\(Completed 200 OK in\|Processing by Gitlab\)" | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE TABLE usertickets ( | |
email varchar(128) NOT NULL default '', | |
ticket varchar(32) NOT NULL default '', | |
repositorygrants integer NOT NULL default '0' | |
); | |
CREATE TABLE usersgroups ( | |
userid integer default '0', | |
groupid integer default '0' | |
); | |
CREATE TABLE users ( |
OlderNewer