Skip to content

Instantly share code, notes, and snippets.

View tolpp's full-sized avatar
😎

Tolga Okur tolpp

😎
View GitHub Profile
@tolpp
tolpp / replace-filenames.md
Created August 26, 2022 22:47
replacing filenames using pattern and find command
find . -name '*.txt' -exec sh -c 'x="{}"; mv "$x" "${x//2010/2022}"' \;

Whats under the hood?

  • find command finds the files that ending with *.txt using -name parameter
  • -exec parameter executes move (mv) command for each found file
  • second move argument ${x//2010/2022} replaces string 2010 with 2022 in file names using shell parameter expansion
@tolpp
tolpp / ubuntu-server-increase-disk-size.md
Last active April 30, 2021 20:05
Few easy step to increase disk size of a ubuntu server.

Ubuntu Server Increase Disk Size

  1. run df -h to display disk info.

The disk that we want to increase is /dev/sda2 for our case.

  1. run cfdisk as root.
  2. select disk and resize from bottom menu.
  3. Write and Quit.
  4. run resize2fs for desired disk. resize2fs /dev/sda1 for our case.
@tolpp
tolpp / list-all-files-with-global-read-permission.sh
Created June 22, 2020 07:00
Lists all regular files with global read permission.
find / -perm -o=r -exec test -f {} \; -exec ls -Al {} \; 2>/dev/null
@tolpp
tolpp / android_okhttp_version.txt
Created February 21, 2020 11:50
Bundled OkHttp versions in Android distributions
Android 4.4.1 -> OkHttp 1.1.2
Android 5.0.0 -> OkHttp 2.0.0
Android 6.0.1 -> OkHttp 2.0.0
Android 7.1.2 -> OkHttp 2.5.0
Android 8.1.0 -> OkHttp 2.6.0
Android 9.0.0 -> OkHttp 2.6.0
Android 10.0.0 -> OkHttp 2.6.0
@tolpp
tolpp / adb-find-apps-with-permissions.sh
Created December 13, 2019 13:26
Script that lists Android applications with BIND_ACCESSIBILITY_SERVICE or SYSTEM_ALERT_WINDOW permissions.
#!/bin/bash
packageList=$(adb shell pm list packages | sed s/package://g)
while IFS='' read -r line <&4
do
adb shell "echo $line"
adb shell dumpsys package "$line" | egrep ".*(BIND_ACCESSIBILITY_SERVICE|SYSTEM_ALERT_WINDOW).*"
done 4<<< "$packageList"
@tolpp
tolpp / ffmpeg-merge.sh
Created November 9, 2019 21:59
ffmpeg script for merging multiple files into one mp4 file
#!/bin/bash
input_file_find_pattern="'\./$1.*'"
find_command="find . -regex $input_file_find_pattern"
input_files=()
while IFS= read -r line; do
input_files+=( "$line" )
done < <( eval $find_command )
ffmpeg_merge_command='ffmpeg -loglevel error'
@tolpp
tolpp / Main.java
Created July 29, 2019 18:21
ANSI X9.62 elliptic curve prime256v1 (aka secp256r1, NIST P-256), SHA512withECDSA Signature verification using Java.
import java.security.*;
import java.security.spec.X509EncodedKeySpec;
import java.util.Base64;
/*
ANSI X9.62 elliptic curve prime256v1 (aka secp256r1, NIST P-256), SHA512withECDSA Signature verification using Java.
## Some useful OpenSSL commands in order to create keys and sign messages:
@tolpp
tolpp / FRP iOS Learning resources.md
Created March 14, 2019 13:11 — forked from JaviLorbada/FRP iOS Learning resources.md
The best FRP iOS resources.

Videos

@tolpp
tolpp / android-send-push-locally-using-adb.adoc
Last active April 4, 2024 16:33
This gist explains how to send push notification locally using ADB without need network connection.

Requirements:

  • Device should be a rooted (simulator’s are rooted by default)

  • adbd should be started as root. (Rub command: adb root )

Now, send local push message using command: