Skip to content

Instantly share code, notes, and snippets.

View cyxou's full-sized avatar
🚀

Alex cyxou

🚀
View GitHub Profile
@cyxou
cyxou / ru.php
Created August 7, 2014 04:22
WP Affiliate Platform Russian Localisation
<?php
//Language file for Russian
// Login Widget related
define(AFF_WIDGET_TITLE, 'Affiliate Login');
define(AFF_WIDGET_LOGGED_IN_AS, 'You are logged in as:');
define(AFF_WIDGET_ACCESS_DASHBOARD, 'Access the Affiliate Dashboard');
// General
define(AFF_G_DATE, 'Дата');
// Create an instance of our cache and set some keys. Notice that the [new] operator
// is optional since the SimpleCache (and revealing module pattern) doesn't use
// prototypical inheritance. And, we can use method-chaining to set the cache keys.
var cache = SimpleCache()
.set( "foo", "Bar" )
.set( "hello", "world" )
.set( "beep", "boop" )
;
console.log( cache.has( "beep" ) );
@cyxou
cyxou / upgrade-jenkins.sh
Created August 11, 2015 10:46
Upgrade Jenkins on Bitnami VM
#!/bin/bash
cd /opt/bitnami
sudo ./ctlscript.sh stop
sudo cp -f apache-tomcat/webapps/jenkins.war apps/jenkins/jenkins.war.bak
sudo wget http://mirrors.jenkins-ci.org/war/latest/jenkins.war
sudo mv jenkins.war apache-tomcat/webapps/
sudo rm -rf apache-tomcat/work/Catalina/localhost
sudo rm -rf apache-tomcat/webapps/jenkins
sudo ./ctlscript.sh start
Собаки в группе
//div[@id='gedit_users_members']//div[@class='gedit_user'][div/a/img[@src='/images/deactivated_100.png']]/div[3]/a[2]
{
"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",
@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",
@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 / 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
#
#! /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 / dump-all-secrets.sh
Last active February 18, 2025 20:03
Dump all the Kubernetes objects from cluster
#!/usr/bin/env bash
set -e
#  Replace with your kubeconfig
export KUBECONFIG=/home/alex/.kube/develop-config.yaml
# export KUBECONFIG=/home/alex/.kube/production-config.yaml
# Define whitelisted namespaces (empty array means process all except blacklisted)
WHITELIST=()