Skip to content

Instantly share code, notes, and snippets.

View kandeshvari's full-sized avatar

Dmitry Kurbatov kandeshvari

View GitHub Profile
@kandeshvari
kandeshvari / .k8s_aliases
Created December 12, 2021 16:15
kubectl aliases
alias dep='kubecolor get deploy -A -o wide'
alias ds='kubecolor get ds -A -o wide'
alias ing='kubecolor get ing -A -o wide'
alias k='kubecolor'
alias kar='kubecolor api-resources'
alias kd='kubecolor describe'
alias kdel='kubecolor delete'
alias kdp='kubecolor delete pod'
alias ke='kubecolor edit'
alias kg='kubecolor get'
@kandeshvari
kandeshvari / zhack.c
Created September 7, 2020 11:49
ZFS: make new pool from disk detached from mirror
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (the "License"). You may not use this file except in compliance
* with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* or http://www.opensolaris.org/os/licensing.
package main
import (
"fmt"
"log"
"net"
"os"
"os/signal"
"time"
)
@kandeshvari
kandeshvari / manager.patch
Last active November 18, 2017 11:33
opera gst manager
diff --git a/platforms/media_backends/gst/gstmediamanager.cpp b/platforms/media_backends/gst/gstmediamanager.cpp
index a83073be..29b68a7b 100644
--- a/platforms/media_backends/gst/gstmediamanager.cpp
+++ b/platforms/media_backends/gst/gstmediamanager.cpp
@@ -9,6 +9,8 @@
#include "core/pch_system_includes.h"
#ifdef MEDIA_BACKEND_GSTREAMER
+
+#include "platforms/media_backends/gst/include/gst/gstcaps.h"
@kandeshvari
kandeshvari / mp3-play.c
Last active November 18, 2017 11:32
gfstreamer mp3 play
#include <gst/gst.h>
static gboolean
bus_call(GstBus *bus,
GstMessage *msg,
gpointer data) {
GMainLoop *loop = data;
switch (GST_MESSAGE_TYPE (msg)) {
case GST_MESSAGE_EOS:
@kandeshvari
kandeshvari / freebsd-11-gcc6.patch
Created January 17, 2017 09:10
Patch for compiling opera presto on FreeBSD-11
diff --git a/platforms/unix/base/common/unix_camera.h b/platforms/unix/base/common/unix_camera.h
index 3b747450..4380efa2 100644
--- a/platforms/unix/base/common/unix_camera.h
+++ b/platforms/unix/base/common/unix_camera.h
@@ -15,7 +15,15 @@
#include "modules/img/image.h"
#include "platforms/posix/posix_selector.h"
+#ifdef __FreeBSD__
+typedef uint32_t __u32;
@kandeshvari
kandeshvari / gist:dc0e1f738f513d5ba43ac2a75959ac94
Created January 17, 2017 07:59
gcc6 segfaults on freebsd while bompiling presto
[root@ ~/devel/presto]# ./flower -v --without-kde4 --without-gtk2 --package=tar --without-gstreamer --release --without-autoupdatechecker --no-debug-code --without-plugins --without-dual-plugin-wrapper -j1
Logging to build.log
Started 2017-01-17 10:58:07
Compiling modules/libopeay/crypto/x509v3/opera_v3_pku.cpp
g++ -c -o build/obj/opera/modules/libopeay/crypto/x509v3/opera_v3_pku.o modules/libopeay/crypto/x509v3/opera_v3_pku.cpp -pipe -MMD -fshort-wchar -fsigned-char -fno-threadsafe-statics -fno-exceptions -fno-rtti -ffunction-sections -fdata-sections -O3 -fno-tree-vectorize -fomit-frame-pointer -ggdb -Winvalid-pch -fmessage-length=0 -Wchar-subscripts -Wformat -Wformat-security -Wmultichar -Wpointer-arith -Wreturn-type -Wstrict-aliasing -Wno-unknown-pragmas -Wno-format-y2k -Wno-switch -Wno-parentheses -Wno-unused-parameter -D_REENTRANT -DWCHAR_IS_UNICHAR -DNDEBUG -DBROWSER_BUILD_NUMBER_INT=9999 -DSTASHED_DEFINES -DUNIX -DBROWSER_BUILD_NUMBER=\"9999\" -D_THREAD_SAFE -DFEATURE_SELFTEST=NO -D_LARGEFILE_SOURCE -I
@kandeshvari
kandeshvari / deco.py
Created January 12, 2017 12:08
Decorator with params example
def rpc_method(scope=None, chain=None):
"""Decorator: make function possible to RPC"""
def real_decorator(function):
@wraps(function)
def wrapper(*args, **kwargs):
# print("XXX: chain:", chain)
_f_chain = function
if chain is not None and isinstance(chain, list):
# print("XXX: chain 2:", chain)
@kandeshvari
kandeshvari / gist:879aff5e9b95f1004ceb99dab8c25939
Created April 29, 2016 11:06 — forked from pkieltyka/gist:308894
VM sysctl options on FBSD 8
superpages on:
--------------
# sysctl -a | grep vm
kern.ipc.semvmx: 32767
kern.vm_guest: none
vm.vmtotal:
vm.loadavg: { 0.00 0.02 0.02 }
vm.v_free_min: 12793
vm.v_free_target: 53855
vm.v_free_reserved: 2683
#/bin/sh
TEST_NET="/test_net"
ADDR1="127.1.2.3"
ADDR2="172.16.200.44"
ADDR3="192.168.44.123"
ADDR_NO_CONF="192.168.120.120"
ADDR_NO_CONF2="192.168.254.253"