Skip to content

Instantly share code, notes, and snippets.

View redsfyre's full-sized avatar
:shipit:
There is nothing here -> /dev/null

Yasin İsa YILDIRIM redsfyre

:shipit:
There is nothing here -> /dev/null
View GitHub Profile
@cdimartino
cdimartino / rebalance.sh
Created May 16, 2013 20:30
Quick and dirty rebalancing of Cassandra cluster.
#!/bin/sh
# This will allow you to rebalance the Cassandra ring
#
# $ ./rebalance.sh file_of_hosts
RING_SIZE=$(echo "2^127" | bc)
HOSTS=$(cat $1 | sed 'N;s/\n/ /')
HOST_NUM=$(echo $HOSTS | wc -w)
INDEX=0
@mc2pw
mc2pw / setting-up-tails-with-persistence.md
Last active February 26, 2023 23:57
Setting up Tails with Persistence

Tails - The Amnesic Incognito Live System - is a live operating system that "aims at preserving your privacy and anonymity." It is a Linux Debian distribution configured to follow several security measures including sending all internet traffic through the Tor network.

These are the steps I followed for setting up Tails. Tails provides a utility for setting up persistence, this utility only works when running a Tails installation created from within Tails using the Tails Installer. After consistently getting an "Operation System Not Found" message on my computer when trying to run the Tails installed by the Tails Installer, some research lead me to find out it was possible to set up persistence manually. This turned out to provide greater flexibility, as now I am able to keep my persistent partition on a USB drive and my Tails installation on a disk.

@tuxfight3r
tuxfight3r / openshift_cli_tricks.MD
Last active March 30, 2023 18:02
openshift cli tricks - using go templates

openshift list all pods and thier specs (requests/limits)

oc get pod -o jsonpath='{range .items[*]}{"SPEC:  \n  LIMITS  : "}{.spec.containers[*].resources.limits}{"\n  REQUESTS: "}{.spec.containers[*].resources.requests}{"\n"}{end}'

openshift list all pods and thier specs with name (requests /limits)

oc get pod -o jsonpath='{range .items[*]}{"NAME:  "}{.metadata.name}{"\nSPEC:  \n  LIMITS  : "}{.spec.containers[*].resources.limits}{"\n  REQUESTS: "}{.spec.containers[*].resources.requests}{"\n\n"}{end}'
@Glamdring
Glamdring / CassandraJSONToCQL.java
Created November 2, 2019 20:17
Convert Cassandra sstabledump JSON to CQL
package com.logsentinel.util.db;
import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.logsentinel.util.db.dump.Cell;
import com.logsentinel.util.db.dump.Info;
import com.logsentinel.util.db.dump.Row;
import org.apache.commons.lang3.StringUtils;
import java.io.File;
@sh4dowb
sh4dowb / eba-canli-ders.md
Last active March 21, 2023 16:49
EBA canlı ders için Linux ve Mac desteği (Zoom)
@skhatri
skhatri / fluentd-elasticsearch-logging-timestmap.md
Last active December 17, 2022 11:34
FluentD to Elasticsearch Index with Custom Timestamp

This is an example of forwarding logs to elasticsearch using fluentd. In the process, it does use a custom time key.

The setup

Run Elasticsearch and FluentD locally

#run elasticsearch
docker run -e discovery.type=single-node -e xpack.security.enabled=false -p 9200:9200 -d elasticsearch:7.2.0
#install fluentd
@Ovid
Ovid / grep.pm
Last active May 12, 2022 12:36
A small hack to add a 'sqitch grep ...' command that sorts things in the order of the sqitch plan
package App::Sqitch::Command::grep;
use 5.010;
use strict;
use warnings;
use utf8;
use App::Sqitch::X qw(hurl);
use Moo;
use App::Sqitch::Target;
use App::Sqitch::Types qw(Str Enum Target Bool);
@ChrisTitusTech
ChrisTitusTech / fixlocale.sh
Created October 27, 2020 21:51
Fix Locales in any distro
#!/bin/bash
echo "LC_ALL=en_US.UTF-8" | sudo tee -a /etc/environment
echo "en_US.UTF-8 UTF-8" | sudo tee -a /etc/locale.gen
echo "LANG=en_US.UTF-8" | sudo tee -a /etc/locale.conf
sudo locale-gen en_US.UTF-8

Usb autosuspend disable:

echo -1 > /sys/module/usbcore/parameters/autosuspend

Fix USB cable is bad or device descriptor issue

echo Y | tee /sys/module/usbcore/parameters/old_scheme_first

Wifi power save mode disable