Skip to content

Instantly share code, notes, and snippets.

Avatar

Warun Kietduriyakul scalopus

View GitHub Profile
@scalopus
scalopus / fswatch-pdf.sh
Created Apr 17, 2020
File System Monitoring : PDF and then automatic decrypted the file to the new folder
View fswatch-pdf.sh
# Useful for the Bank transaction / Statement / or same password
# which it enable us to just download to the folder and then the
# script will automatic decrpyted the password and store the new
# file without password needs.
# Pre-requirement
# apt install qpdf fswatch
export PASSWORD=<pdfpasswordhere>
export EXPORTDIR=./decrypt
fswatch --insensitive --include "\\.pdf$" --exclude ".*" \
View Appium Issue: ADB Log
➜ log adb logcat
--------- beginning of main
03-01 14:40:17.692 1760 1774 E memtrack: Couldn't load memtrack module
03-01 14:40:17.692 1760 1774 W android.os.Debug: failed to get memory consumption info: -1
03-01 14:40:17.704 1760 1774 E memtrack: Couldn't load memtrack module
03-01 14:40:17.704 1760 1774 W android.os.Debug: failed to get memory consumption info: -1
03-01 14:40:17.714 1760 1774 E memtrack: Couldn't load memtrack module
03-01 14:40:17.715 1760 1774 W android.os.Debug: failed to get memory consumption info: -1
03-01 14:40:19.379 1760 7015 D WificondControl: Scan result ready event
03-01 14:40:26.678 7614 7614 D AndroidRuntime: >>>>>> START com.android.internal.os.RuntimeInit uid 0 <<<<<<
View Appium Issue : Appium Console Log
[info] [Appium] Welcome to Appium v1.7.2
[info] [Appium] Appium REST http interface listener started on 0.0.0.0:4723[info] [HTTP] --> POST /wd/hub/session {"desiredCapabilities":{"app":"/Users/warun/dev/scb-appium-tests/apps/app-automation-debug.apk","automationName":"uiautomator2","platformName":"Android","deviceName":"Android","platformVersion":"8.0"}}
[debug] [MJSONWP] Calling AppiumDriver.createSession() with args: [{"app":"/Users/warun/dev/scb-appium-tests/apps/app-automation-debug.apk","automationName":"uiautomator2","platformName":"Android","deviceName":"Android","platformVersion":"8.0"},null,null]
[debug] [BaseDriver] Event 'newSessionRequested' logged at 1519915023626 (21:37:03 GMT+0700 (+07))
[info] [Appium] Creating new AndroidUiautomator2Driver (v0.11.0) session
[info] [Appium] Capabilities:
[info] [Appium] app: /Users/warun/dev/scb-appium-tests/apps/app-automation-debug.apk
[info] [Appium] automationName: uiautomator2
[info] [Appium] platformName: Android
[info] [Appium] deviceName: Andro
@scalopus
scalopus / tcp-dump.sh
Last active Oct 17, 2016
TCPDump: Monitoring `locahost` for Graylog, statsd, fluentd (MacOS)
View tcp-dump.sh
sudo tcpdump -A -s0 -ilo0 port 24224 or port 12201 or port 8125
@scalopus
scalopus / My-IP-to-Slack.sh
Created Jan 27, 2016
Current IP Address from `ifconfig` to Slack Channel Integration
View My-IP-to-Slack.sh
#!/bin/bash
# Tested on Ubuntu 14.04 LTS
ifconfig |grep '192.168.9'|cut -d: -f2 |awk '{print "{\"text\":\""$1"\"}"}' |curl -X POST -H 'Content-type: application/json' --data @- https://hooks.slack.com/services/<SLACKTOKEN>
View ca-certificates.crt
-----BEGIN CERTIFICATE-----
MIICTTCCAbYCCQDlDv0nlSxWRDANBgkqhkiG9w0BAQUFADBqMQswCQYDVQQGEwJT
RzETMBEGA1UECAwKU29tZS1TdGF0ZTEhMB8GA1UECgwYSW50ZXJuZXQgV2lkZ2l0
cyBQdHkgTHRkMSMwIQYDVQQDDBphcGkubG9jYWwucHJvcGVydHlndXJ1LmNvbTAg
Fw0xMzEwMDkwNzQyNDFaGA8yMTEzMDkxNTA3NDI0MVowajELMAkGA1UEBhMCU0cx
EzARBgNVBAgMClNvbWUtU3RhdGUxITAfBgNVBAoMGEludGVybmV0IFdpZGdpdHMg
UHR5IEx0ZDEjMCEGA1UEAwwaYXBpLmxvY2FsLnByb3BlcnR5Z3VydS5jb20wgZ8w
DQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBAMA4Mq3gDfYNw7kbbMefaIUbc9JfMOCt
YP71R6jPIKBdT3KYke3OgnNePDBvVvReeODC3YKRSXGJx0V258HBaxVFOyh6Qa/Q
af6pkjh7JSgBr+cqzya82IC56mD6FzC+U4V3FcNgBxDfijE5tG1eKcq6Zxtur7y8
@scalopus
scalopus / compare.sql
Created Sep 3, 2015
Compare Schema on Two Table
View compare.sql
SELECT table_name,column_name,ordinal_position,data_type,column_type,column_default,
is_nullable,
CHARACTER_MAXIMUM_LENGTH,
CHARACTER_OCTET_LENGTH,
NUMERIC_PRECISION,
NUMERIC_SCALE,
DATETIME_PRECISION,
CHARACTER_SET_NAME,
COLLATION_NAME,
EXTRA FROM
@scalopus
scalopus / cap
Created Jul 16, 2015
Record Screen as Git Image
View cap
#!/bin/bash
# AUTHOR: (c) Rob W 2012, modified by MHC (http://askubuntu.com/users/81372/mhc)
# NAME: GIFRecord 0.1
# DESCRIPTION: A script to record GIF screencasts.
# LICENSE: GNU GPL v3 (http://www.gnu.org/licenses/gpl.html)
# DEPENDENCIES: byzanz,gdialog,notify-send (install via sudo add-apt-repository ppa:fossfreedom/byzanz; sudo apt-get update && sudo apt-get install byzanz gdialog notify-osd)
# Time and date
TIME=$(date +"%Y-%m-%d_%H%M%S")
@scalopus
scalopus / common-config.sh
Created Feb 27, 2015
PHP-Build After Script to make common config on one major version example
View common-config.sh
#!/bin/bash
PHP_MINOR=`echo $PREFIX | sed 's:.*/::' | sed 's:[0-9]\.[0-9]\.::'`
COMMON_DIR_PREFIX=`echo $PREFIX | sed 's:\.[0-9]\+\$::'`
COMMON_DIR="$COMMON_DIR_PREFIX.0"
if [ "$PHP_MINOR" == "0" ]; then
echo "Major version.... skipped";
sed -i.bak 's:\(memory_limit \= \)[0-9]\+M:\12048M:' $PREFIX/etc/php.ini
sed -i.bak 's:\;\(date\.timezone \=\):\1 Asia\/Bangkok:' $PREFIX/etc/php.ini
@scalopus
scalopus / common-config.sh
Created Feb 27, 2015
php-build-common-config
View common-config.sh
#!/bin/bash
# Copy this file to ./php-build/share/php-build/after-install.d
# This file is to keep all minors version use the same configuration file.
# This will required you to install the base version.
# Ex.
# 5.4.10 use 5.4.0 as configuration
# you have to install 5.4.0 at first.
You can’t perform that action at this time.