Skip to content

Instantly share code, notes, and snippets.

View kholis's full-sized avatar

Nur Kholis M kholis

View GitHub Profile
@kholis
kholis / kafka-python-sasl-gssapi.py
Created June 5, 2024 07:32 — forked from asdaraujo/kafka-python-sasl-gssapi.py
kafka-python example with Kerberos auth
# Requirements: kafka-python gssapi krbticket
import os
import time
from kafka import KafkaConsumer, KafkaProducer
from krbticket import KrbConfig, KrbCommand
try:
os.environ['KRB5CCNAME'] = '/tmp/krb5cc_<myusername>'
kconfig = KrbConfig(principal='araujo', keytab='/path/to/<myusername>.keytab')
KrbCommand.kinit(kconfig)
@kholis
kholis / notes.txt
Created February 8, 2024 06:08 — forked from timrobertson100/notes.txt
Spark 2.4 on CDH 5.12
Based on ideas here, expanded to enable Hive support
https://www.linkedin.com/pulse/running-spark-2xx-cloudera-hadoop-distro-cdh-deenar-toraskar-cfa/
wget https://archive.apache.org/dist/spark/spark-2.4.8/spark-2.4.8-bin-without-hadoop.tgz
tar -xvzf spark-2.4.8-bin-without-hadoop.tgz
cd spark-2.4.8-bin-without-hadoop
cp -R /etc/spark2/conf/* conf/
cp /etc/hive/conf/hive-site.xml conf/
@kholis
kholis / PVE-HP-ssacli-smart-storage-admin.md
Created February 7, 2024 10:32 — forked from mrpeardotnet/PVE-HP-ssacli-smart-storage-admin.md
HP Smart Storage Admin CLI (ssacli) installation and usage on Proxmox PVE (6.x)

HP Smart Storage Admin CLI (ssacli) installation and usage on Proxmox PVE (6.x)

Why use HP Smart Storage Admin CLI?

You can use ssacli (smart storage administrator command line interface) tool to manage any of supported HP Smart Array Controllers in your Proxmox host without need to reboot your server to access Smart Storage Administrator in BIOS. That means no host downtime when managing your storage.

CLI is not as convenient as GUI interface provided by BIOS or desktop utilities, but still allows you to fully manage your controller, physical disks and logical drives on the fly with no Proxmox host downtime.

ssacli replaces older hpssacli, but shares the same syntax and adds support for newer servers and controllers.

Installation

@kholis
kholis / LLAP_DEMO.md
Created November 14, 2017 04:37 — forked from rajkrrsingh/LLAP_DEMO.md
LLAP Application demo on HDP2.5 using tpc-ds dataset
su - hdfs 
wget https://github.com/hortonworks/hive-testbench/archive/hive14.zip
unzip hive14.zip
cd hive-testbench-hive14/
vi hive-testbench-hive14/settings/load-partitioned.sql -- remove G1GC and use Parrallel GC scheme
cd hive-testbench-hive14/
yum install gcc
echo 'export JAVA_HOME=/usr/jdk64/jdk1.8.0_77' >> ~/.bashrc
echo 'PATH=$PATH:$JAVA_HOME/bin' &gt;&gt; ~/.bashrc
@kholis
kholis / arabic_font_fixer.js
Created November 22, 2016 04:22
Arabic font fixer (TamperMonkey)
// ==UserScript==
// @name Arabic font size fixer
// @namespace Arminius99
// @include *.wikipedia.org*
// @include *.wiktionary.org*
// @include *.aljazeera.net*
// @include *reddit.com*
// @include *.wordpress.com*
// @include *.blogspot.co*
// @include *.facebook.com*
@kholis
kholis / delete-email.py
Created July 19, 2016 10:41
Script to delete email by folder
#!/usr/bin/env python
## http://stackoverflow.com/questions/3180891/imap-deleting-messages
import imaplib
m = imaplib.IMAP4_SSL('imap.company.com')
m.login("your-user","your-password")
m.select('mail/dir/sub-dir') # this folder will be clean up
typ, data = m.search(None, 'ALL')
for num in data[0].split():
#print num
@kholis
kholis / change-arabic-font.js
Created April 19, 2016 13:17
javascript using tampermonkey or greasemonkey
// ==UserScript==
// @name Arabic font size fixer
// @namespace Arminius99
// @include *.wikipedia.org*
// @include *.wiktionary.org*
// @include *.aljazeera.net*
// @include *reddit.com*
// @include *web.whatsapp.com*
// @include *.wordpress.com*
// @include *.facebook.com*
@kholis
kholis / rlm
Created December 7, 2015 08:40
RLM init.d linux
#! /bin/sh
#
# rlm Start/Stop rlm
#
# chkconfig: 345 98 01
# description: some startup script
#----------------------------------------------------------------
#----------------------------------------------------------------
#----------------------------------------------------------------
@kholis
kholis / fabfile.py
Last active August 29, 2015 14:16
Fabric hosts file parsing
import re
hosts_list = []
with open('hosts_file') as f:
for line in f:
if not (line.strip()=='' or line.startswith('#')):
if "[" in line:
prefix = line.split('[')[0]
m = re.search(r"\[([0-9\-]+)\]", line)
a = m.group(1)
@kholis
kholis / task.c
Last active August 29, 2015 14:08
task.c file of winutils
/**
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with this
* work for additional information regarding copyright ownership. The ASF
* licenses this file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*