Skip to content

Instantly share code, notes, and snippets.

View kholis's full-sized avatar

Nur Kholis M kholis

View GitHub Profile
@taterbase
taterbase / upload.php
Created May 13, 2012 15:03
Simple file upload in php
<!DOCTYPE html>
<html>
<head>
<title>Upload your files</title>
</head>
<body>
<form enctype="multipart/form-data" action="upload.php" method="POST">
<p>Upload your file</p>
<input type="file" name="uploaded_file"></input><br />
<input type="submit" value="Upload"></input>
@bak1an
bak1an / terminalrc
Created November 30, 2012 12:51
xfce terminal tango color scheme
# put it to ~/.config/Terminal/terminalrc
# found here http://blogs.n1zyy.com/andrew/2009/02/02/tango-color-scheme-for-xfce-terminal/
[Configuration]
ColorForeground=White
ColorBackground=#323232323232
ColorPalette1=#2e2e34343636
ColorPalette2=#cccc00000000
ColorPalette3=#4e4e9a9a0606
ColorPalette4=#c4c4a0a00000
@KartikTalwar
KartikTalwar / Documentation.md
Last active June 25, 2024 10:55
Rsync over SSH - (40MB/s over 1GB NICs)

The fastest remote directory rsync over ssh archival I can muster (40MB/s over 1gb NICs)

This creates an archive that does the following:

rsync (Everyone seems to like -z, but it is much slower for me)

  • a: archive mode - rescursive, preserves owner, preserves permissions, preserves modification times, preserves group, copies symlinks as symlinks, preserves device files.
  • H: preserves hard-links
  • A: preserves ACLs
@brandonmwest
brandonmwest / example.cs
Last active June 27, 2024 04:03
Generating base64-encoded Authorization headers in a variety of languages
httpClient.DefaultRequestHeaders.Authorization =
new AuthenticationHeaderValue(
"Basic",
Convert.ToBase64String(
System.Text.ASCIIEncoding.ASCII.GetBytes(
string.Format("{0}:{1}", username, password))));
@ashrithr
ashrithr / kerberos_setup.md
Last active May 31, 2024 08:41
Set up kerberos on Redhat/CentOS 7

Installing Kerberos on Redhat 7

This installation is going to require 2 servers one acts as kerberos KDC server and the other machine is going to be client. Lets assume the FQDN's are (here cw.com is the domain name, make a note of the domain name here):

  • Kerberos KDC Server: kdc.cw.com
  • Kerberos Client: kclient.cw.com

Important: Make sure that both systems have their hostnames properly set and both systems have the hostnames and IP addresses of both systems in

@n0ts
n0ts / get_oracle_jdk_x64.sh
Last active September 16, 2023 12:07
Get latest Oracle JDK package bash shell script for linux/osx/windows
#!/bin/bash
# You must accept the Oracle JDK License Update
# https://www.oracle.com/java/technologies/javase-downloads.html
# usage: get_oracle_jdk_x64.sh <jdk_version> <platform> <ext>
# jdk_version: 14
# platform: linux or osx or windows
# ext: rpm or dmg or tar.gz or exec
jdk_version=${1:-14}
@bmwh
bmwh / restart-cm-service.sh
Last active December 1, 2023 02:59
Restart a managed service with the Cloudera Manager REST API
#!/bin/bash
# restart-cm-service.sh
# Restart a Cloudera-Manager-managed service via the REST API
# -----------------------------------------------------------------------
# Copyright (C) 2014 Cloudera and Ben White
# Cloudera Manager credentials
USERNAME=admin
PASSWORD=admin
@rampage644
rampage644 / impala-hdp.md
Last active March 21, 2019 15:07
Impala + HDP

Downloads

HDP sandbox

Installation

yum-config-manager --add-repo http://archive.cloudera.com/cdh5/redhat/6/x86_64/cdh/cloudera-cdh5.repo
yum install  impala-server impala-catalog impala-state-store impala-shell
ln -sf /usr/lib/hbase/lib/hbase-client.jar /usr/lib/impala/lib
ln -sf /usr/lib/hbase/lib/hbase-common.jar /usr/lib/impala/lib
ln -sf /usr/lib/hbase/lib/hbase-protocol.jar /usr/lib/impala/lib
@mkrcah
mkrcah / zkDelAll.py
Last active November 8, 2020 03:25
Remove all ZooKeeper nodes according to a given path template, see http://stackoverflow.com/questions/25052245/zookeeper-cli-wildcard-support
import sys
from kazoo.client import KazooClient
if len(sys.argv) not in (2,3):
print('Usage: zkDelAll.py [path] [host:port=localhost:2181]')
exit(1)
host = sys.argv[2] if len(sys.argv) == 3 else 'localhost:2181'
path = sys.argv[1]
@mazgi
mazgi / console.log.md
Last active March 18, 2024 17:18
LDAP Auth for SSSD, SSH, SUDO
# uname -a
Linux base 4.0.5-gentoo #1 SMP Wed Jul 1 02:23:16 JST 2015 x86_64 Intel(R) Xeon(R) CPU E5-2640 0 @ 2.50GHz GenuineIntel GNU/Linux

Packages

# emerge -pvq openldap openssh sssd sudo
[ebuild R ] net-nds/openldap-2.4.38-r2 USE="berkdb crypt gnutls ipv6 minimal sasl ssl syslog tcpd -cxx -debug -experimental -icu -iodbc -kerberos -odbc -overlays -perl -samba (-selinux) -slp -smbkrb5passwd" ABI_X86="(64) -32 (-x32)"