Skip to content

Instantly share code, notes, and snippets.

Cabia Rangris cab404

Block or report user

Report or block cab404

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View switch_touchpad
#!/bin/bash
id=$(xinput list --id-only "SynPS/2 Synaptics TouchPad")
is_on=$(xinput list-props $id | grep "Device Enabled" | tail -c 2 | grep 1)
echo $is_on
if (( $is_on ))
then
state=0;
@cab404
cab404 / cache
Created Feb 1, 2018
caching script for drone.io Volume Cache
View cache
#!/bin/bash
# drone.io cache simplifier by cab404, for using with Volume Cache plugin
# allows you to cache practically anything from anywhere, specifying only '.drone-cache' in mounts
# to pack something do "cache in (smthn)"
# to unpack all do "cache out"
#
# e.g you want to cache /root/.gradle/cache and /root/.gradle/wrapper (typical for android), you do
# get-cache:
# image: drillster/drone-volume-cache
# restore: true
View PrinterAPI.kt
package ru.todaydelivery.android
import android.bluetooth.BluetoothAdapter
import android.bluetooth.BluetoothDevice
import android.bluetooth.BluetoothSocket
import ru.todaydelivery.android.Printer3CottBT.PRINTER_UUID
import java.io.Closeable
import java.io.OutputStream
import java.nio.charset.Charset
import java.util.*
@cab404
cab404 / fiction-reader.html
Created Sep 2, 2017
Opens FB2 books from src url parameter. Modified version of https://gist.github.com/Kup3a/1ae3b114b3f07ee35d37
View fiction-reader.html
<!DOCTYPE html>
<html manifest="fiction-reader.appcache">
<head>
<meta charset="utf-8">
<title>FictionReader JS</title>
<meta name="viewport" content="width=device-width">
<!--<link rel="shortcut icon" href="bookonscreen.png">-->
<!--<link rel="apple-touch-icon-precomposed" href="fiction-reader.png">-->
<script type="text/javascript" src="fiction-reader.js"></script>
<script type="text/javascript">
View mini-itx-ryzen.md
тип название ссылка стоимость
GPU GTX 1060 https://market.yandex.ru/product/14187640 21000
CPU AMD Ryzen 5 1600X https://market.yandex.ru/product/1723154074 13000
MBD ASRock Fatal1ty https://market.yandex.ru/product/1732965279 9500
RAM 2x8Gb Corsair Vengeance https://market.yandex.ru/product/13485858 12000
SSD Samsung EVO 860 https://market.yandex.ru/product/1969039551 6000
CSE Fractal Design Node 304 https://market.yandex.ru/product/8516133 5000
PSU Corsair VS450 450W https://market.yandex.ru/product/7951165 3000
RAD Noctua NH-L9x65 https://market.yandex.ru/product/12664665 3000
View TestingSocketIO.kt
package com.cab404.testing
import io.socket.client.IO
import io.socket.client.Socket
import org.json.JSONObject
import java.io.FileWriter
import java.lang.Long
import java.text.SimpleDateFormat
import java.time.Instant
import java.util.*
@cab404
cab404 / Clusters.java
Created May 18, 2017
Simple greedy clustering algorithm supporting both directions of clustering
View Clusters.java
import java.util.ArrayList;
import java.util.Collections;
import java.util.LinkedList;
import java.util.List;
/**
* @author cab404
*/
public class Clusters<A> {
@cab404
cab404 / BlockingOverscrollView.java
Created Mar 29, 2017
Makes getting overscroll value from ListViews and other scrollables easy
View BlockingOverscrollView.java
package ru.mos.portal.android.design;
import android.content.Context;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.v4.view.MotionEventCompat;
import android.support.v4.view.ViewCompat;
import android.util.AttributeSet;
import android.util.Log;
import android.view.MotionEvent;
View CSVReader.java
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.Reader;
import java.nio.CharBuffer;
import java.util.ArrayList;
import java.util.Collections;
import java.util.LinkedList;
import java.util.List;
View airmon-ng.md

немного о включении режима мониторинга

короче

  1. сначала мы отключаем беспроводной интерфейс от менеджера системы (который думает, что мы очень хорошие, и хотим только свои пакеты) это мы делаем через
    	ifconfig <название интерфеса> down
You can’t perform that action at this time.