Skip to content

Instantly share code, notes, and snippets.

View frbk's full-sized avatar
💮
.

Fedor Barannik frbk

💮
.
View GitHub Profile
@asoorm
asoorm / docker-compose-mongo-replicaset.yml
Created September 14, 2018 19:00
Mongo Replica Set docker compose
version: "3"
services:
mongo1:
hostname: mongo1
container_name: localmongo1
image: mongo:4.0-xenial
expose:
- 27017
ports:
- 27011:27017
@ScriptingSquirrel
ScriptingSquirrel / install-kubernetes-dashboard-ingress-enabled.md
Last active March 4, 2022 08:48
Install Ingress-enabled kubernetes-dashboard using Helm

Problem

$ helm install kubernetes-dashboard stable/kubernetes-dashboard --namespace MY_NAMESPACE --set ingress.enabled=true --set ingress.hosts={MYDASHBOARD.EXAMPLE.COM} --set-string ingress.annotations."nginx\.ingress\.kubernetes\.io/secure-backends"="true"
Error: UPGRADE FAILED: failed to create patch: failed to get versionedObject: unable to convert unstructured object to extensions/v1beta1, Kind=Ingress: unrecognized type: string

NB: A fix for the --set-string flag is on the way: helm/helm#4142

Workaround

@mort3za
mort3za / git-auto-sign-commits.sh
Last active May 28, 2024 20:51
Auto sign your git commits
# Generate a new pgp key: (better to use gpg2 instead of gpg in all below commands)
gpg --gen-key
# maybe you need some random work in your OS to generate a key. so run this command: `find ./* /home/username -type d | xargs grep some_random_string > /dev/null`
# check current keys:
gpg --list-secret-keys --keyid-format LONG
# See your gpg public key:
gpg --armor --export YOUR_KEY_ID
# YOUR_KEY_ID is the hash in front of `sec` in previous command. (for example sec 4096R/234FAA343232333 => key id is: 234FAA343232333)
@sahajamit
sahajamit / testngListOfMaps_DataProvider.java
Created August 8, 2017 05:57
TestNG dataprovider example to pass List of maps as a provider
package testng;
import org.testng.annotations.DataProvider;
import org.testng.annotations.Test;
import java.util.*;
public class testngListOfMaps_DataProvider {
@DataProvider(name = "Passing List Of Maps")
public Iterator<Object[]> createDataforTest3() {
@thisismydesign
thisismydesign / clever_solution.rb
Last active April 17, 2022 21:57
Ruby: how to use self.included meaningfully
module CreateClassMethodsUponInclude
def self.included(base)
# does what we want
end
end
module MyModule
include CreateClassMethodsUponInclude
# ...
@saurabhshri
saurabhshri / pip.md
Last active June 7, 2024 12:58
Install and use pip in a local directory without root/sudo access.

Install and use pip in a local directory without root/sudo access.

Why?

Many users when are given server access, do not have root (or sudo) privileges and can not simply do sudo apt-get install python-pip . Here's an easy way you can install and use pip without root (or sudo) access in a local directory. Note : This works without easy_install too.

How?

@StefanoBelli
StefanoBelli / macOS_launcher.sh
Last active April 11, 2021 05:43
Fast OS X launch on QEMU with KVM support enabled. Credits to: https://github.com/kholia, original repository: https://github.com/kholia/OSX-KVM
#!/bin/sh
# qemu-img create -f qcow2 mac_hdd.img 64G
# echo 1 > /sys/module/kvm/parameters/ignore_msrs
#
# Type the following after boot,
# -v "KernelBooter_kexts"="Yes" "CsrActiveConfig"="103"
#
# printf 'DE:AD:BE:EF:%02X:%02X\n' $((RANDOM%256)) $((RANDOM%256))
#
@ertseyhan
ertseyhan / remount.sh
Created February 2, 2016 20:51
Temporarily increase size of tmp folder on Arch linux
#!/bin/bash
sudo mount -o remount,size=10G,noatime /tmp
echo "Done. Please use 'df -h' to make sure folder size is increased."
@jshcrowthe
jshcrowthe / installing-oh-my-zsh-fedora.md
Last active December 8, 2022 18:38
Installing Oh My ZSH oh Fedora (2015 CIT 325 Image)

Installing oh-my-zsh on Fedora (for DB class images)

Oh-my-zsh is an extension of the traditional z shell that is extensible via community created plugins (Plugins found here: oh-my-zsh github repo). It is, in my opinion, a breath of fresh air in comparison to the traditional bash shell.

DO THE FOLLOWING IN ORDER

Installing ZSH (using yum)

The first step for this install is getting zsh we will do this via yum. From your terminal:

@acdcjunior
acdcjunior / SeleniumXPathVersion2.java
Last active August 21, 2016 14:53
What XPath version does a given Selenium WebDriver support?
private String getXPathVersion(WebDriver context) {
try {
By.xpath("/nobody[@attr=lower-case('A')]").findElement(context);
return "2.0";
} catch (Exception e) {
return "1.0";
}
}