Skip to content

Instantly share code, notes, and snippets.

@sowich
sowich / test.py
Created November 22, 2016 12:16
test.py
# -*- coding: UTF-8 -*-
import threading
import Queue
import os
import datetime
import sys
import time
if __name__ == '__build__':
@sowich
sowich / danted_install_script.sh
Created June 9, 2018 10:06 — forked from duketwo/danted_install_script.sh
Dante-Server (danted) install script (Debian 8 - Jessie)
# Dante-Server install script (Debian 8 - Jessie)
# Start with 'chmod +x danted_install_script.sh && danted_install_script.sh'
# duketwo - 12.11.2017
random_pw=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1)
network_adapter=$(ip route | grep default | sed -e "s/^.*dev.//" -e "s/.proto.*//")
username="SallySample"
port="31337"
public_ip=$(dig +short myip.opendns.com @resolver1.opendns.com)
echo "Random password: $random_pw"
echo "deb-src http://ftp.de.debian.org/debian/ sid main non-free contrib" >> /etc/apt/sources.list
@sowich
sowich / javascript
Created January 21, 2019 05:57
javascript
"use strict";
fetch("...", {method: "POST"})
.then(result => result.json())
.then(result => {
let ws = new WebSocket("..." + result.connectionId);
ws.onopen = () => {
ws.send(JSON.stringify({...}));
ws.send(JSON.stringify({...}));
SELECT
wp_posts.ID
FROM
wp_posts
LEFT JOIN
wp_term_relationships ON (wp_posts.ID = wp_term_relationships.object_id)
WHERE
1 = 1 AND wp_posts.ID NOT IN (93110)
AND (wp_term_relationships.term_taxonomy_id IN (8))
AND wp_posts.post_type = 'post'
@sowich
sowich / grabber.go
Last active August 30, 2020 14:30
Grabber quotationspage.com
package main
import (
"flag"
"fmt"
"log"
"net/http"
"time"
"strings"
"os"
@sowich
sowich / macos_route.md
Last active July 17, 2023 18:36
MacOS route

Посмотреть открытые порты

lsof -PiTCP -sTCP:LISTEN

Посмотреть все маршруты

netstat -nr
@sowich
sowich / parser.go
Last active August 5, 2021 06:34
parser.go
package main
import (
"fmt"
"log"
"net/http"
"strings"
"sync"
"time"
@sowich
sowich / python.txt
Last active September 21, 2021 13:09
python.txt
- github:
"Managing remote repositories"
https://docs.github.com/en/get-started/getting-started-with-git/managing-remote-repositories
======================================================================================
- stackoverflow
"How do I use cURL to perform multiple simultaneous requests?"
https://stackoverflow.com/a/66998509
@sowich
sowich / rand_authors.txt
Created September 3, 2021 10:23
Раскидать посты по случайным авторам
UPDATE table SET post_author = 4 WHERE RAND() < 0.5
UPDATE wp_posts SET post_author = 5 where rand()<0.1 and post_author = 6
@sowich
sowich / convert_bin_txt.txt
Created September 29, 2021 11:03
Convert bin-txt
Конвертировать binary-файл в txt
xxd -p 1.mp3 1.txt
Конвертировать из txt в binary-файл
xxd -r -p 1.txt 2.mp3