Skip to content

Instantly share code, notes, and snippets.

View rostegg's full-sized avatar
💜
Developing software with KISS principle in mind

Rostyslav Nikolaienko rostegg

💜
Developing software with KISS principle in mind
View GitHub Profile
@rostegg
rostegg / adb-auto-connect
Last active July 31, 2020 19:20
Discover all Android devices throug network with ADB TCP debug mode enabled
#!/bin/bash
# Copy to /usr/bin and don't forget to make the script executable
# Usage: adb-auto-connect <adb_port> ("5555" if empty)
IP_TEMPLATE=$(ifconfig | grep -Eo 'inet (addr:)?([0-9]*\.){3}' | grep -Eo '([0-9]*\.){3}' | grep -v '127.0.0')
NETWORK_IP_WITH_MASK="${IP_TEMPLATE}0/24"
printf "\e[32mStarting scan \e[0m${NETWORK_IP_WITH_MASK}\n"
AVAILABLE_IPS=($(nmap -sn ${NETWORK_IP_WITH_MASK} | grep -E -o "([0-9]{1,3}[\.]){3}[0-9]{1,3}"))
printf '\e[32mAvailable devices in network: \e[0m\n'
@rostegg
rostegg / unicode-emojis-arrays
Last active June 17, 2020 19:45
Large unicode emoji characters array (bash and js)
// bash
EMOJIS=(♈ ♉ ♊ ♋ ♌ ♍ ♎ ♏ ♐ ♑ ♒ ♓ ♠ ♣ ♥ ♦ ♨ ♻ ♿ ⚓ ⚠ ⚡ ⚪ ⚫ ⚽ ⚾ ⛄ ⛅ ⛎ ⛔ ⛪ ⛲ ⛳ ⛵ ⛺ ⛽ ✂ ✅ ✈ ✉ ✊ ✋ ✌ ✏ ✒ ✔ ✖ ✨ ✳ ✴ ❄ ❇ ❌ ❎ ❓ ❔ ❕ ❗ ❤ ➕ ➖ ➗ ➡ ➰ ⤴ ⤵ ⬅ ⬆ ⬇ ⬛ ⬜ ⭐ ⭕ 〰 〽 ㊗ ㊙ 🀄 🃏 🅰 🅱 🅾 🅿 🆎 🆑 🆒 🆓 🆔 🆕 🆖 🆗 🆘 🆙 🆚 🇨 🇳 🇩 🇪 🇪 🇸 🇫 🇷 🇬 🇧 🇮 🇹 🇯 🇵 🇰 🇷 🇷 🇺 🇺 🇸 🈁 🈂 🈚 🈯 🈲 🈳 🈴 🈵 🈶 🈷 🈸 🈹 🈺 🉐 🉑 🌀 🌁 🌂 🌃 🌄 🌅 🌆 🌇 🌈 🌉 🌊 🌋 🌌 🌏 🌑 🌓 🌔 🌕 🌙 🌛 🌟 🌠 🌰 🌱 🌴 🌵 🌷 🌸 🌹 🌺 🌻 🌼 🌽 🌾 🌿 🍀 🍁 🍂 🍃 🍄 🍅 🍆 🍇 🍈 🍉 🍊 🍌 🍍 🍎 🍏 🍑 🍒 🍓 🍔 🍕 🍖 🍗 🍘 🍙 🍚 🍛 🍜 🍝 🍞 🍟 🍠 🍡 🍢 🍣 🍤 🍥 🍦 🍧 🍨 🍩 🍪 🍫 🍬 🍭 🍮 🍯 🍰 🍱 🍲 🍳 🍴 🍵 🍶 🍷 🍸 🍹 🍺 🍻 🎀 🎁 🎂 🎃 🎄 🎅 🎆 🎇 🎈 🎉 🎊 🎋 🎌 🎍 🎎 🎏 🎐 🎑 🎒 🎓 🎠 🎡 🎢 🎣 🎤 🎥 🎦 🎧 🎨 🎩 🎪 🎫 🎬 🎭 🎮 🎯 🎰 🎱 🎲 🎳 🎴 🎵 🎶 🎷 🎸 🎹 🎺 🎻 🎼 🎽 🎾 🎿 🏀 🏁 🏂 🏃 🏄 🏆 🏈 🏊 🏠 🏡 🏢 🏣 🏥 🏦 🏧 🏨 🏩 🏪 🏫 🏬 🏭 🏮 🏯 🏰 🐌 🐍 🐎 🐑 🐒 🐔 🐗 🐘 🐙 🐚 🐛 🐜 🐝 🐞 🐟 🐠 🐡 🐢 🐣 🐤 🐥 🐦 🐧 🐨 🐩 🐫 🐬 🐭 🐮 🐯 🐰 🐱 🐲 🐳 🐴 🐵 🐶 🐷 🐸 🐹 🐺 🐻 🐼 🐽 🐾 👀 👂 👃 👄 👅 👆 👇 👈 👉 👊 👋 👌 👍 👎 👏 👐 👑 👒 👓 👔 👕 👖 👗 👘 👙 👚 👛 👜 👝 👞 👟 👠 👡 👢 👣 👤 👦 👧 👨 👩 👪 👫 👮 👯 👰 👱 👲 👳 👴 👵 👶 👷 👸 👹 👺 👻 👼 👽 👾 🤖 👿 💀 💁 💂 💃 💄 💅 💆 💇 💈 💉 💊 💋 💌 💍 💎 💏 💐 💑 💒 💓 💔 💕 💖 💗 💘 💙 💚 💛 💜 💝 💞 💟 💠 💡 💢 💣 💤 💥 💦 💧 💨 💩 💪 💫 💬 💮 💯 💰 💱 💲 💳 💴 💵 💸 💹 💺 💻 💼 💽 💾 💿 📀 📁 📂 📃 📄 📅 📆 📇 📈 📉 📊 📋 📌 📍 📎 📏 📐 📑 📒 📓 📔 📕 📖 📗 📘 📙 📚 📛 📜 📝 📞 📟 📠 📡 📢 📣 📤 📥 📦
@rostegg
rostegg / background.js
Last active July 9, 2020 06:13
Tiny webextension to navigate through random "prnt.sc" screenshots. Idk who might need it, purely for research purposes
// Load extension with manifest, and click on the icon that appears on browser panel
// And don't forget to load random pic to extension folder and name it "icon.png"
//
const endpoint = "https://prnt.sc"
browser.browserAction.onClicked.addListener(() => {
const rndId = (length) => {
const characters = 'abcdefghijklmnopqrstuvwxyz0123456789'
const charactersLength = characters.length
const getRndChar = function() {
@rostegg
rostegg / findAllWebTelegramMessages.js
Last active August 11, 2021 19:49
Find all messages in web telegram and save them to file
const filter = "the text by which messages will be filtered"
const fileName = "file.json"
function stripHtml(html){
const tmp = document.createElement("DIV")
tmp.innerHTML = html
return tmp.textContent || tmp.innerText || ""
}
function saveAs(data, filename){
PROFILE_DIR=~/.mozilla/firefox/$( ls -tr ~/.mozilla/firefox/ | grep -v profiles.ini | tail -1 )
if [ ! -d "${PROFILE_DIR}"/chrome ] ; then
mkdir -p "${PROFILE_DIR}"/chrome
fi
STYLE="#TabsToolbar { visibility: collapse !important; }"
echo ${STYLE} >> "${PROFILE_DIR}"/chrome/userChrome.css
@rostegg
rostegg / trees-tab-style.css
Last active August 6, 2020 08:15
Custom style for Tree Style Tab webextension
:root {
--colorA: #ecff6b;
--colorB: #6affda;
--colorC: #b4b4b4;
--colorD: #5ceaff;
--colorE: #514350;
--colorF: #281f1a;
--colorG: green;
--tab-height: 30px;
--font-size: 11px;
@rostegg
rostegg / vscode-quote-snippet
Created August 6, 2020 16:08
Snippet until quote mark key is broken
{
"Single quote mark": {
"prefix": ["sq"],
"body": ["''"],
"description": "Single quotatioms marks"
},
"Double quote mark": {
"prefix": ["dq"],
"body": ["\"\""],
"description": "Single quotatioms marks"
/*index-begin-hide-tabs*/
#TabsToolbar {
visibility: collapse !important;
}
/*index-end-hide-tabs*/
/*index-begin-hide-sidebar-title*/
#sidebar-header {
visibility: collapse !important;
}
@rostegg
rostegg / enum-analogue.js
Last active May 28, 2021 12:36
Simple example of how to replace the lack of enums in JS
function* generateIds() {
let i = 0;
while (true) { yield i; i++ }
}
const generator = generateIds();
const getId = () => { return Object.freeze(generator.next().value) }
const typesList = [
@rostegg
rostegg / is-domain-alive.js
Created June 3, 2021 17:29
Check if domains is alive
const domains = [
`sci-hub.ws`,
`sci-hub.ac`,
`sci-hub.biz`,
`sci-hub.gq`,
`sci-hub.ga`,
`sci-hub.io`,
`sci-hub.nu`,
`sci-hub.name`,
`sci-hub.is`,