This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$files = glob('*.txt'); | |
$offset = ''; | |
$pattern = '/https.+\.jpg/'; | |
$save_file_suffix = '.jpg'; | |
$save_in_folder = 'img/'; | |
foreach ($files as $f) { | |
$content = file_get_contents($f); | |
preg_match_all($pattern, $content, $match); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// $ yarn install node-telegram-bot-api | |
import TelegramBot from 'node-telegram-bot-api'; | |
// Use yours | |
const token = '1234567:ABCDEFGH'; | |
const bot = new TelegramBot(token); | |
// Use your own list |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
tar czf - /home/USER > /root/backup.tar.gz && \ | |
gpg --output /root/backup.gpg --encrypt --recipient USER@domain.com --always-trust /root/backup.tar.gz && \ | |
curl -F document=@"/root/backup.gpg" https://api.telegram.org/botTOKEN/sendDocument?chat_id=12345678 | |
&& \ | |
rm /root/backup.gpg /root/backup.tar.gz |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let list = (await vk.api.friends.getRequests({'need_viewed': 1, 'count': 1000}))?.items; | |
if(!list?.length) { | |
return; | |
} | |
console.log('Banning...'); | |
for (let k in list) { | |
const id = list[k]; | |
try { | |
const response = await vk.api.account.ban({ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let list = [ | |
1, 100, 333 | |
]; | |
console.log('Banning...'); | |
for (let id of list) { | |
const response = await vk.api.account.ban({ | |
owner_id: id | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import asyncio | |
import datetime | |
from pytz import utc | |
from telethon import TelegramClient | |
from telethon.tl.types import PeerUser | |
DELETE_BEFORE = utc.localize(datetime.datetime(2021, 10, 1)) # offset date | |
API_ID = 12345 # https://my.telegram.org/apps | |
API_HASH = 'qwerty123' # https://my.telegram.org/apps |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type IssueEvent struct { | |
Timestamp int64 `json:"timestamp"` | |
WebhookEvent string `json:"webhookEvent"` | |
IssueEventTypeName string `json:"issue_event_type_name"` | |
User User `json:"user"` | |
Issue Issue `json:"issue"` | |
Log ChangeLog `json:"changelog"` | |
} | |
type Issue struct { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func UpperCaseFirst(str string) string { | |
if len(str) >= 1 { | |
var newStr string | |
var first rune | |
for i, c := range str { | |
if i == 0 { | |
first = c | |
first = unicode.ToUpper(first) | |
newStr = string(first) | |
} else { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"bytes" | |
"context" | |
"encoding/json" | |
"fmt" | |
"io/ioutil" | |
"os" | |
"os/exec" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM golang:1.16 | |
WORKDIR / | |
COPY . / | |
RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o app . | |
FROM alpine:latest | |
RUN apk --no-cache add ca-certificates | |
WORKDIR /app/ | |
COPY --from=0 ./app ./ | |
CMD ["./app"] |