Smart 🧠 Fullstack
45 subscribers
168 photos
11 videos
13 files
153 links
About channel: everyday developer hints.

for (💲Coders as 💲Student):
echo("Hello 💲Student->name");
endfor;

Author: @BakirovRoman
Download Telegram
🖥 Rollback File Permissions for Unchanged Files

echo "Enter your slave branch:"
read your_branch
echo "Enter your main branch:"
read master_branch
changes=$(git --no-pager diff --name-only "$master_branch" "$your_branch")
while IFS= read -r file;
do
file_changes=$(git --no-pager diff "$master_branch" "$your_branch" -- "$file")
line_count=$(echo "$file_changes" | wc -l)
if [ "$line_count" -eq 3 ]; then
line2=$(echo "$file_changes" | sed -n '2p') # Get the second line
line3=$(echo "$file_changes" | sed -n '3p') # Get the third line
if [[ "$line2" == "old mode"* ]] && [[ "$line3" == "new mode"* ]]; then
chmod -x "$file"
fi
fi

done <<< "$changes"

echo "Success! Happy codding!"


Fast execution:
curl -so fix-git-mode.sh https://gist.githubusercontent.com/makhnanov/275672ed5d139170d62d338ddf18faab/raw/abf3998b9198b64962c4e3e9ec5aa4e4e532018a/fix-git-mode.sh && chmod +x fix-git-mode.sh && ./fix-git-mode.sh && rm fix-git-mode.sh


🐱Snippet

#permission #mode #chmod #git #rollback
Please open Telegram to view this post
VIEW IN TELEGRAM
🖥 Install Node Version Manager 🎛

curl https://raw.githubusercontent.com/creationix/nvm/master/install.sh | bash
source ~/.bashrc
nvm i node


Alternative:
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.0/install.sh | bash

nvm install 20.16.0


Check Current NodeJS Versions

#js #javascript #nvm #npm #node
Please open Telegram to view this post
VIEW IN TELEGRAM
❄️ Show Weather Forecast in Terminal Every Opening ☀️

sudo bash -c 'echo "curl wttr.in/Almaty" >> /etc/bash.bashrc'


#bash #curl #wttr #weather #forecat #bashrc
Please open Telegram to view this post
VIEW IN TELEGRAM
🖱 Xubuntu Fast Switch Between Applications

In Different Displays: Alt + Tab
In One Display: Alt + Middle Click

#hotkey #xubuntu #mouse #xfce
Please open Telegram to view this post
VIEW IN TELEGRAM
JavaScript create alias for any function 🖥

if (!String.prototype.contains) {
// Provide an alias to 'includes' for older browsers
String.prototype.contains = function(search) {
return this.includes(search);
};
}

// Test the polyfilled 'contains' method
const str = "Hello, World!";
console.log(str.contains("Hello")); // Outputs: true
console.log(str.contains("JavaScript")); // Outputs: false


#js #javascript #includes #contains #alias #frontend
Please open Telegram to view this post
VIEW IN TELEGRAM
🤣1
🐧 Bash replace text in many files 🎛

Replace </head> to sometext</head>

#!/bin/bash

# Loop through each HTML file and replace </head> with sometext</head>
for file in ./*/*/*.html; do
# Check if the file is a regular file
if [ -f "$file" ]; then
# Replace </head> with sometext</head> using sed
sed -i 's/<\/head>/sometext<\/head>/g' "$file"
echo "Replacement done in $file"
fi
done


#bash #sed #loop #replace
Please open Telegram to view this post
VIEW IN TELEGRAM
🖥 Add debug file / directory to git ignore

Local:
echo debug.sh >> .git/info/exclude


Global:
wip


#git #gitignore #exclude #debug
Please open Telegram to view this post
VIEW IN TELEGRAM
🐒 Prevent Elements Inserting in iframe in Tampermonkey 🖥

if (window.top != window.self) {
return;
}


#tampermonkey #iframe
Please open Telegram to view this post
VIEW IN TELEGRAM
Forwarded from SecAtor
Стартовал Pwn2Own Vancouver 2024, за первый день которого участники продемонстрировали эксплуатацию 0-day в Windows 11, Tesla и Ubuntu Linux, выиграв 732 500$ и автомобиль Tesla Model 3.

Haboob SA реализовал эксплойт Adobe Reader, который сочетал в себе обход ограничений API и ошибку внедрения команд, добившись RCE на macOS и заработав 50 000$.

Synacktiv
выиграла Tesla Model 3 и 200 000$ после взлома электронного блока управления Tesla с помощью Vehicle (VEH) CAN BUS Control менее чем за 30 секунд с использованием целочисленного переполнения.

Исследователи Theori сорвали куш в 130 000$, продемонстрировав RCE в VMware Workstation с использованием цепочки эксплойтов, нацеленной на ошибку неинициализированной переменной, слабость UAF и переполнение буфера на основе кучи.

Спецы из Reverse Tactics заработали 90 000$, воспользовавшись двумя ошибками Oracle VirtualBox и Windows UAF.

DEVCORE
получила награду в размере 30 000$ за повышение привилегий в полностью исправленной системе Windows 11 с помощью эксплойта, нацеленного на две ошибки, включая состояние гонки TOCTAU.

Еще 10 000$ им ушло за демонстрацию уже известного эксплойта локального повышения привилегий (LPE) в Ubuntu Linux.

KAIST Hacking Lab
взломали веб-браузер Google Chrome, используя Use-After-Free (UAF), и получили 60 000$.

ASU SEFCOM
продемонстрировал еще один эксплойт LPE, нацеленный на Ubuntu Linux, с помощью условия гонки, заработав 20 000$.

Коди Галлахер
также выиграл 20 000$ за 0-day в Oracle VirtualBox (OOB), которую также за 20 000$ взломала Dungdm из Viettel Cyber Security, используя цепочку эксплойтов из двух ошибок.

Первый день конкурса завершился тем, что Манфред Пол взломал веб-браузеры Apple Safari, Google Chrome и Microsoft Edge, воспользовавшись тремя 0-day и выиграв 102 500 долларов.

После Pwn2Own у поставщиков будет 90 дней на выпуск исправлений безопасности для всех обнаруженных недостатков, прежде чем Trend Micro Zero Day Initiative раскроет их публично.

Во второй день Pwn2Own участники попытаются реализовать 0-day в Windows 11, VMware Workstation, Oracle VirtualBox, Mozilla Firefox, Ubuntu Desktop, Google Chrome, Docker Desktop и Microsoft Edge.

Будем следить.
Forwarded from SecAtor
Подошел к концу хакерский поединок Pwn2Own Vancouver 2024, по итогам которого исследователи продемонстрировали 29 0-day, заработав в общей сложности 1132500$.

Победу в турнире одержал Манфред Пол с 25 очками Master of Pwn и наградой в 202500$ после взлома браузеров Apple Safari, Google Chrome и Microsoft Edge.

Второе место досталось команде Synacktiv с 20 очками, 200 000 зеленых и призовым авто. 145 000$ и третья строчка достались Seunghyun Lee.

На второй день Манфред Пол также воспользовался 0-day записи за пределами границ (OOB) для RCE, и осуществил выход из песочницы Mozilla Firefox, используя серьезную уязвимость функции.

Эксплойты повышения привилегий в Windows 11 продемонстрировали исследователи HackInside и IBM X-Force.

STAR Labs SG
успешно обкатали свои EoP-эксплойты для VMware Workstation и Ubuntu Linux, а также реализовали выход из Docker.

Команда Palo Alto взломала Chrome и Edge, преодолев защиту V8, а ColdEye препарировали Oracle VirtualBox.

KAIST Hacking Lab
показала рабочий RCE-эксплойт для Chrome и Edge, а коллеги из Theori - EoP в Ubuntu Linux.

Таким образом, общий призовой фонд составил более 1300000$ в виде денежных призов, с учетом автомобиля Tesla Model 3, который укатила в качестве бонуса Team Synacktiv в первый день соревнований.

Участники по ходу мероприятия успешно реализовали EoP и RCE на полностью пропатченных Windows 11, Ubuntu Desktop, VMware Workstation, Oracle VirtualBox, Apple Safari, Google Chrome и Microsoft Edge и Tesla Model 3.

Теперь мяч на стороне поставщиков, которым предстоит уложиться в 90 дней перед тем, как исследователи раскроют технические подробности и задействованные эксплойты.
💬 WhatsApp web link / deeplink
Web
https://web.whatsapp.com/send/?phone=77777777777&text=Hello&type=phone_number

App deeplink
whatsapp://send?phone=77777777777&text=Hello


💬 Telegram
Common
https://t.me/bakirovroman

Web
https://web.telegram.org/a/#390941013

App deeplink
tg://resolve?domain=bakirovroman


#tg #telegram #whatsapp #deeplink #link #web
Please open Telegram to view this post
VIEW IN TELEGRAM
🗺 Map 2gis widget constructor 4 your site 🗺🗺

https://firmsonmap.api.2gis.ru/firmsconstructor

#gis #2gis #constructor #map #maps #widget
Please open Telegram to view this post
VIEW IN TELEGRAM
🖥 HTML hyphen without wrap 🥳

&#8209;

Example:
up&#8209;to&#8209;date


#html #hyphen #wrap
Please open Telegram to view this post
VIEW IN TELEGRAM
🖥 Mail & tel deep links 📞🖥

Phone:
<a href="tel:+78005555535">Call Me</a>

a[href^="tel:"] {
font-size: 16px;
line-height: 32px;
text-decoration: none;
color: #000000;
}
a[href^="tel:"]:before {
content: "\260e";
margin-right: 0.5em;
}


eMail:
<a href="mailto:mail@examle.com&body=Hi?subject=Subj">Write Me</a>


#deeplink #mail #mailto #deep #link #html #css #tel #phone
Please open Telegram to view this post
VIEW IN TELEGRAM
🔥2
🖥 How to fix WARN[0000] /var/www/project/docker-compose.yml: `version` is obsolete 🐧

Remove version: "*" from docker-compose.yml

#docker #fix #warn #version #compose
Please open Telegram to view this post
VIEW IN TELEGRAM
😱2
🔥3
🐒 Tampermonkey Add Fast Copy Button 🖥

// ==UserScript==
// @name Click to Copy
// @namespace http://tampermonkey.net/
// @version 0.1
// @description Click an element to copy its content to clipboard
// @match https://example.com/* // Replace with the URL of the webpage
// @grant GM_setClipboard
// ==/UserScript==

(function() {
'use strict';

// Add a click event listener to the element you want to copy
document.querySelector('your_element_selector').addEventListener('click', function() {
const contentToCopy = document.querySelector('your_element_selector').innerText; // Replace with the selector for the element
GM_setClipboard(contentToCopy);
alert('Content copied to clipboard: ' + contentToCopy);
});
})();

#tampermonkey #tamper #monkey #copy #js #javascript #frontend #clipboard
Please open Telegram to view this post
VIEW IN TELEGRAM
📱 Jira & Tampermonkey | Add Fast Copy Buttons 🐒

Replace your-company to your company domain.

Get Code

#jira #js #javascript #tamper #monkey #tampermonkey #frontend
Please open Telegram to view this post
VIEW IN TELEGRAM
// ==UserScript==
// @name Jira Fast Task Copy Button
// @namespace http://tampermonkey.net/
// @version 2024-05-03
// @description try to take over the world!
// @author You
// @match https://jira.your-company.com/*
// @icon https://www.google.com/s2/favicons?sz=64&domain=jira.com
// @grant GM_setClipboard
// @grant GM_addStyle
// ==/UserScript==
(function() {
'use strict';
const customStyles = `
.jira-fast-copy-btn {
background-color: #0052CC;
color: white;
padding: 4px 7px 4px 7px !important;
border-radius: 9px;
position: unset !important;
margin-left: 6px !important;
cursor: pointer;
}
.jira-fast-copy-btn_copied {
background-color: green !important;
}
.jira-fast-copy-btn_copied:hover {
background-color: green !important;
}
.jira-fast-copy-btn:hover {
background-color: #0052CCAB;
}
`;
GM_addStyle(customStyles);
let addButton = function (buttonsContainer, text, copy) {
let copyButton = document.createElement('li');
copyButton.className = "jira-fast-copy-btn";
copyButton.innerText = text;
buttonsContainer.appendChild(copyButton);
copyButton.addEventListener("click", function (e) {
copy
? GM_setClipboard(copy)
: alert(text + " not found 4 copy!");
copyButton.classList.add("jira-fast-copy-btn_copied");
setTimeout(function () {
copyButton.classList.remove("jira-fast-copy-btn_copied")
}, 500);
})
}
let alreadyExists = false;
const handleNewNode = (mutationsList, observer) => {
mutationsList.forEach(mutation => {
mutation.addedNodes.forEach(node => {
let buttonsContainer = document.querySelector("header#stalker .aui-nav.aui-nav-breadcrumbs");
if (!buttonsContainer || alreadyExists) {
return;
}
alreadyExists = true;
let id = document.getElementsByClassName("issue-link")[0];
if (id) {
id = id.innerText;
}
let name = document.getElementById("summary-val");
if (name) {
name = name.innerText;
}
addButton(
buttonsContainer,
"Copy Key",
id
);
addButton(
buttonsContainer,
"Copy Summary",
name
);
addButton(
buttonsContainer,
"Copy Key & Summary",
`[${id}] ${name}`
);
let link = document.location.protocol + "//" + document.location.hostname + "/browse/" + id;
addButton(
buttonsContainer,
"Copy Link",
link
);
addButton(
buttonsContainer,
"Copy Key & Summary & Link",
`[${id}] ${name}\n${link}`
);
observer.disconnect();
});
});
};
const config = { childList: true, subtree: true };
const observer = new MutationObserver(handleNewNode);
observer.observe(document.body, config);
})();