Skip to content

Instantly share code, notes, and snippets.

View yarkovaleksei's full-sized avatar
🏠
Working from home

Yarkov Aleksey yarkovaleksei

🏠
Working from home
  • Russia, Rostov-on-Don
View GitHub Profile
### Default text editor
export EDITOR=subl
# get current branch in git repo
function parse_git_branch() {
BRANCH=`git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/\1/'`
if [ ! "${BRANCH}" == "" ]
then
STAT=`parse_git_dirty`
echo "[${BRANCH}${STAT}]"
1. Сгенерировать ключ с помощью PuttyGen
1.1. Сохранить private key в файл.
1.2. Скопировать публичный ключ в буфер обмена
2. Добавить скопированные публичный ключ в BitBucket (Manage Account -> SSH key)
3. Запустить PAgent и добавить приватный ключ.
4. Выполнить команду: plink git@bitbucket.org
4.1. На вопрос: Store key in cache? (y/n) ответить y
@yarkovaleksei
yarkovaleksei / post-commit
Created August 6, 2016 20:26 — forked from bonndan/post-commit
gh-pages post commit hook
#!/bin/sh
branch=$(git rev-parse --abbrev-ref HEAD)
if [ "gh-pages" == "$branch" ]; then
exit
fi
echo Updating gh-pages for branch $branch
git checkout gh-pages
git checkout $branch -- dist
https://octodex.github.com/images/hanukkat.png
https://octodex.github.com/images/welcometocat.png
https://octodex.github.com/images/filmtocat.png
https://octodex.github.com/images/privateinvestocat.jpg
https://octodex.github.com/images/gracehoppertocat.jpg
https://octodex.github.com/images/gobbleotron.gif
https://octodex.github.com/images/jetpacktocat.png
https://octodex.github.com/images/minertocat.png
https://octodex.github.com/images/mountietocat.png
https://octodex.github.com/images/saketocat.png
// 1. Переходим на свою страницу в ВК
// 2. Зажимаем пробел и ждем, пока лента прокрутится до нужных постов или до конца
// 3. В консоль браузера вставляем нежеследующий код и давим Enter
// 4. Подтверждаем удаление постов
(function() {
'use strict';
if (!confirm('Удалить все записи со стены?')){
return;
}
var deletePostLink = document.body.querySelectorAll('a.ui_actions_menu_item[onclick^="wall.deletePost"]');
@yarkovaleksei
yarkovaleksei / sudo_script_run.sh
Last active November 18, 2016 21:34
Bash example for run script from Nautilus, if commands in script require sudo permission
#!/bin/bash
ROOT_PASSWORD=$(zenity --password --title "Enter root password")
if [ "${ROOT_PASSWORD}" ]; then
echo $ROOT_PASSWORD | sudo -S echo "TEST" > ./test.txt
fi
https://developer.chrome.com/extensions/webRequest — документация по входящим/исходящим хедерам
Пример удаления csp:
chrome.webRequest.onHeadersReceived.addListener(function(details) {
for (var i = 0; i < details.responseHeaders.length; i++) {
if ('content-security-policy' === details.responseHeaders[i].name.toLowerCase()) {
details.responseHeaders[i].value = '';
}
}
return {
responseHeaders: details.responseHeaders
[Собираем свой debian-пакет с файлами](https://debian.pro/1390)
[Простейший способ собрать свой deb-пакет с данными (например, с конфигами, скриптами, ключами авторизации)](https://debian.pro/426)
find . -d -name node_modules | while read line; do rm -rf $line; done