Skip to content

Instantly share code, notes, and snippets.

@tamr
tamr / astrogrep.unified.diff
Created March 24, 2023 20:43
Completely disable anti-aliasing in AstroGrep v4.4.8
WinformsGUI/Windows/Controls/AvalonEdit/CustomLineNumberMargin.cs | 4 ++--
WinformsGUI/Windows/Controls/AvalonEdit/TextEditorEx.cs | 4 +++-
WinformsGUI/Windows/Forms/frmMain.cs | 2 ++
3 files changed, 7 insertions(+), 3 deletions(-)
diff --git a/WinformsGUI/Windows/Controls/AvalonEdit/CustomLineNumberMargin.cs b/WinformsGUI/Windows/Controls/AvalonEdit/CustomLineNumberMargin.cs
index bc55bd2..82f9a49 100644
--- a/WinformsGUI/Windows/Controls/AvalonEdit/CustomLineNumberMargin.cs
+++ b/WinformsGUI/Windows/Controls/AvalonEdit/CustomLineNumberMargin.cs
@@ -191,8 +191,8 @@ namespace AstroGrep.Windows.Controls
On Error Resume Next
Const getIP = "http://checkip.amazonaws.com/"
Set ReExpObj = New RegExp
With ReExpObj
.Pattern = "\b(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\b"
.IgnoreCase = True
.Global = True
End With
@tamr
tamr / sshrc
Created September 3, 2021 19:08
/etc/ssh/sshrc
#!/bin/bash
ip=`echo $SSH_CONNECTION | cut -d " " -f 1`
server_ip=`echo $SSH_CONNECTION | cut -d " " -f 3`
#server_ip="$(wget -qO- checkip.amazonaws.com)"
wget -qO /dev/null --delete-after --no-check-certificate "https://push.re/message?token=AppToken" --post-data "title=SSH+Login+on+$server_ip&message=User+$USER+just+logged+in+from+https://ipapi.co/$ip&priority=5"
@tamr
tamr / fix.php
Created August 25, 2019 03:08
[Warning] ./db/table.frm is inconsistent: engine typecode 44, engine name ROCKSDB (45)
<?php
$di = new RecursiveDirectoryIterator('/var/lib/mysql/', FilesystemIterator::KEY_AS_PATHNAME | FilesystemIterator::CURRENT_AS_SELF | FilesystemIterator::SKIP_DOTS);
foreach (new RecursiveIteratorIterator($di) as $item => $file) {
if ($file->getExtension() !== 'frm') continue;
$content = file_get_contents($file->current()->getPathname());
$content = substr(implode(unpack("H*", $content)), 0, 8);
if ($content != 'fe010a2c' && $content != 'fe010b2c') continue;
import sys
import socket
import array
from optparse import OptionParser
from Crypto.Cipher import Blowfish
from Crypto.Hash import MD5
TELNET_PORT = 23
# The version of Blowfish supplied for the telenetenable.c implementation
@tamr
tamr / request_example.xml
Created April 29, 2018 23:39
request example
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://service.core.epmx.application.eestipost.ee/xsd">
<soapenv:Header/>
<soapenv:Body>
<xsd:businessToClientMsgRequest>
<partner>?</partner>
<interchange msg_type="?">
<!--Optional:-->
<header file_id="?" sender_cd="?" currency_cd="?" dateTime="?" prep_date_time="?" recipient_cd="?" ref_doc_id="?">
<!--Optional:-->
<comment>?</comment>
@tamr
tamr / ytcomm.py
Created April 5, 2018 02:30
yt comments scrapper
#!/usr/bin/env python
from __future__ import print_function
import os
import sys
import time
import json
import requests
import argparse
function ia-save() {
curl -s -I "https://web.archive.org/save/$1" |
grep Content-Location |
awk '{printf( "https://web.archive.org/%s\n",$2)}';
}
"""
This Script needs django and pycrypto.
If you want to use this, just call encode(wanna_crypto_text) or decode(encoded_text).
When your secret key changed, you can't decode encoded text before changed, so becareful.
"""
import hashlib
from Crypto.Cipher import AES
import base64
@echo off
for /L %%n in (1,30000,60000) do (
wget --content-disposition --directory-prefix=downloads --load-cookies=cookies.ini "http://ip.board/index.php?app=core&module=attach&section=attach&attach_rel_module=post&attach_id=%%n"
sleep 3000
)