Skip to content

Instantly share code, notes, and snippets.

View cyxou's full-sized avatar
🚀

Alex cyxou

🚀
View GitHub Profile
@cyxou
cyxou / create-tracker-issues.sh
Last active September 3, 2023 10:43
How to export issues from Github Project to Yandex Tracker
#!/usr/bin/env bash
set -e
# based on the official API: https://cloud.yandex.ru/docs/tracker/concepts/issues/create-issue
# Firstly I had to export all the issues from Github Project using this wonderful tool: https://github.com/fiedl/github-project-to-csv
# Then I cleaned up rhe resulting csv file a bit and used https://csvjson.com/csv2json to convert csv to json.
# Once I had json with all the issues exported I iterate over it creating issiues in Tracker.
token="IAM_TOKEN"
@cyxou
cyxou / openconnect-connect.sh
Last active October 19, 2023 12:17
Openconnect and OpenVPN connections scripts
#!/usr/bin/env bash
set -e
echo "Starting connection..."
USERNAME=<USERNAME>
PASSWORD=<PASSWORD>
VPN_HOST=<VPN_HOST>
TOTP_SECRET="sha1:base32:<SECRET>"
@cyxou
cyxou / common.sh
Created December 23, 2022 16:31
Some usefull functions for bash scripting (stolen from k3d-sample project: https://github.com/k3d-io/k3d-demo/blob/main/scripts/common.sh)
#!/bin/bash
RED='\033[1;31m'
GRN='\033[1;32m'
YEL='\033[1;33m'
BLU='\033[1;34m'
WHT='\033[1;37m'
MGT='\033[1;95m'
CYA='\033[1;96m'
END='\033[0m'
@cyxou
cyxou / dump-k8s-objects.sh
Last active December 14, 2022 12:40
Dump all the Kubernetes objects from cluster
#!/usr/bin/env bash
set -e
NAMESPACE=dev
OBJECTS_TO_DUMP=pv,pvc,configmap,serviceaccount,secret,service,deployment,statefulset,job,cronjob
SCRIPT_DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" &> /dev/null && pwd)
DUMP_DIR=$SCRIPT_DIR/dump
#! /usr/bin/env nix-shell
#! nix-shell -i bash -p bash parted cryptsetup btrfs-progs
# Steps for this script are taken from this article:
# https://dzone.com/articles/nixos-native-flake-deployment-with-luks-and-lvm
set -euo pipefail
read -p "enter the name of the storage device to partition (e.g. /dev/nvme0n1): " -r
drive=$REPLY
@cyxou
cyxou / tmux-256color-italic.terminfo
Created November 6, 2017 10:33
tmux-256color-italic
# A tmux-256color based TERMINFO that adds the escape sequences for italic.
#
# Install:
#
# tic tmux-256color-italic.terminfo
#
# Usage:
#
# export TERM=tmux-256color-italic
#
@cyxou
cyxou / update-plugins.sh
Last active January 3, 2017 08:27
Script that automatically updates plugins of WordPress hosted on Openshift. Inspired by http://www.websightdesigns.com/posts/view/wordpress-update-script
#!/bin/sh
if [ -d "./.openshift/plugins/" ]; then
webroot=$(pwd)
# folder plugins
for i in $(find $webroot/.openshift/plugins/ -maxdepth 1 -mindepth 1 -type d)
do
f=$(basename $i)
@cyxou
cyxou / package.json
Last active October 1, 2016 09:17
Docker tasks in npm build scripts
{
"config": {
"docker": {
"reg": "XXXXXXXXXXXX.dkr.ecr.eu-west-1.amazonaws.com",
"ns": "mynamespace"
}
},
"scripts": {
"//0": "______________________ UTILITIES _______________________________________",
"dumpconf": "env | grep npm_ | sort | uniq",
{
"name": "my-lambda-function",
"config": {
"funcName": "bot-gatecrasher-gen_person_process_instruction",
"zip": "../../../build/dist/gen_person_process_instruction.zip",
"restapiid": "your-rest-api-id"
},
"scripts": {
"//1": "---------------------- UTILITIES -----------------------------------------",
"dumpconf": "env | grep npm_ | sort | uniq",
Собаки в группе
//div[@id='gedit_users_members']//div[@class='gedit_user'][div/a/img[@src='/images/deactivated_100.png']]/div[3]/a[2]