Skip to content

Instantly share code, notes, and snippets.

@markus2120
markus2120 / ts-finished
Created January 4, 2020 10:45 — forked from v6ak/ts-finished
A handler for Task spooler
#!/bin/bash
# Copyright (C) 2012 Vít Šesták <v6ak.com>
# This program is free software. It comes without any warranty, to
# the extent permitted by applicable law. You can redistribute it
# and/or modify it under the terms of the Do What The Fuck You Want
# To Public License, Version 2, as published by Sam Hocevar. See
# http://www.wtfpl.net/ for more details.
# This utility notifies about completed messages of Task spooler (see http://viric.name/soft/ts/).
# Just add the path to this utility to $TS_ONFINISH.
@markus2120
markus2120 / wget.sh
Created May 16, 2019 16:26
default useragent of wget
wget -d http://www.google.com -O/dev/null 2>&1 |grep ^User-Agent
#User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/70.0.3538.77 Chrome/70.0.3538.77
#User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/70.0.3538.77 Chrome/70.0.3538.77
#Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/73.0.3683.86 Chrome/73.0.3683.86 Safari/537.36
wget -d --user-agent="Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/73.0.3683.86 Chrome/73.0.3683.86 Safari/537.36 http://www.google.com -O/dev/null 2>&1 |grep ^User-Agent
@markus2120
markus2120 / getall.py
Created May 16, 2019 16:23
use geckodriver for getting webpage
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# core modules
import codecs
import os
# 3rd party modules
from selenium import webdriver
from selenium.webdriver import Firefox
@markus2120
markus2120 / zt_VPN.md
Last active January 17, 2023 05:51
Route all traffic with a raspberry pi like a VPN
@markus2120
markus2120 / newpipe_disable_brighness_and_immersive_mode.patch
Created November 8, 2018 17:18
https://github.com/TeamNewPipe/NewPipe/ This patch disabled immersive mode and messing with brightness for newpipe
diff --git a/app/build.gradle b/app/build.gradle
index b507fd8..ec743ee 100644
--- a/app/build.gradle
+++ b/app/build.gradle
@@ -6,7 +6,7 @@ android {
defaultConfig {
applicationId "org.schabi.newpipe"
- minSdkVersion 15
+ minSdkVersion 21
@markus2120
markus2120 / redacted-le-ssl.conf
Last active September 26, 2018 15:30
Edit apache.conf file at /etc/apache2/sites-enabled/redacted-le-ssl.conf THis file was based on https://securityheaders.com
<IfModule mod_ssl.c>
<VirtualHost 1.2.3.4:443>
ServerAdmin webmaster@localhost
DocumentRoot /var/www/something
ServerName something.example.com
Header always set Strict-Transport-Security "max-age=31536000; includeSubdomains;"
Header always set X-Frame-Options "SAMEORIGIN"
Header always set X-Xss-Protection "1; mode=block"
Header always set X-Content-Type-Options "nosniff"
Header always set Referrer-Policy "same-origin"
/etc/php/7.0/cli/php.ini
;;;;;;;;;;;;;;;;;
; Miscellaneous ;
;;;;;;;;;;;;;;;;;
; Decides whether PHP may expose the fact that it is installed on the server
; (e.g. by adding its signature to the Web server header). It is no security
; threat in any way, but it makes it possible to determine whether you use PHP
; on your server or not.
; http://php.net/expose-php
import requests
from lxml import html
from lxml.etree import ParserError
import json
from time import sleep
import argparse
import unicodecsv as csv
import traceback
@markus2120
markus2120 / peregrine-nougat-frameworks-base.patch
Created July 27, 2018 08:22
peregrine-nougat-frameworks-base.patch
diff --git core/java/com/android/internal/os/RuntimeInit.java core/java/com/android/internal/os/RuntimeInit.java
index 4b6e6d8..6f6193a 100644
--- core/java/com/android/internal/os/RuntimeInit.java
+++ core/java/com/android/internal/os/RuntimeInit.java
@@ -177,7 +177,7 @@ public class RuntimeInit {
StringBuilder result = new StringBuilder(64);
result.append("Dalvik/");
result.append(System.getProperty("java.vm.version")); // such as 1.1.0
- result.append(" (Linux; U; Android ");
+ result.append(" (Linux; U; ");
@markus2120
markus2120 / ExifOutputStream.java
Created July 27, 2018 08:21
src/com/android/camera/exif/ExifOutputStream.java
diff --git src/com/android/camera/exif/ExifOutputStream.java src/com/android/camera/exif/ExifOutputStream.java
index d7c8320..5887269 100644
--- src/com/android/camera/exif/ExifOutputStream.java
+++ src/com/android/camera/exif/ExifOutputStream.java
@@ -207,37 +207,7 @@ class ExifOutputStream extends FilterOutputStream {
}
private void writeExifData() throws IOException {
- if (mExifData == null) {
return;