Skip to content

Instantly share code, notes, and snippets.

View zyuzuguldu's full-sized avatar
🛰️
Hijacking

zahid zyuzuguldu

🛰️
Hijacking
View GitHub Profile
## Configure eth0
#
# vi /etc/sysconfig/network-scripts/ifcfg-eth0
ONBOOT=yes
BOOTPROTO=static
NAME="System eth0"
IPADDR=10.1.35.132
NETMASK=255.255.255.0
@zyuzuguldu
zyuzuguldu / max_file_desc.sh
Last active April 21, 2019 08:22
maximum number of open file descriptors
~ $ vim /etc/security/limits.conf
# change the followings
# * hard nofile 10000
# * soft nofile 10000
# Then you may check limits
~ $ ulimit -Sn
~ $ ulimit -Hn
@zyuzuguldu
zyuzuguldu / advantaged_cp_mv.sh
Last active April 21, 2019 08:23
linux advanced cp mv
~ $ wget http://ftp.gnu.org/gnu/coreutils/coreutils-8.23.tar.xz
~ $ tar xvJf coreutils-8.23.tar.xz
~ $ cd coreutils-8.23/
~ $ wget http://zwicke.org/web/advcopy/advcpmv-0.5-8.23.patch
~ $ patch -p1 -i advcpmv-0.5-8.23.patch
~ $ ./configure
~ $ make
~ $ export FORCE_UNSAFE_CONFIGURE=1
~ $ sudo cp /bin/cp /bin/cp.backup
~ $ sudo cp src/cp /bin/cp2
import java.io.IOException;
import java.net.URLClassLoader;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.nio.file.Path;
/**
* Example demonstrating a ClassLoader leak.
*
* <p>To see it in action, copy this file to a temp directory somewhere,
@zyuzuguldu
zyuzuguldu / unrar.sh
Last active June 18, 2016 15:06
unrar
for <var> in <list>
do
command $<var>;
done
# to unrar all rar files
for f in *.rar;do unrar e "$f";rm "$f";done
for f in *.001;do 7z e "$f";done
@zyuzuguldu
zyuzuguldu / new_gist_file.sh
Created May 25, 2015 16:25
to read permission of file as integer
stat -c %a /path/to/file
@zyuzuguldu
zyuzuguldu / _gitlab_config.md
Created May 22, 2016 19:33 — forked from petermanser/_gitlab_config.md
Gitlab 5.4 - Gmail configuration

Gitlab 5.4 - Gmail configuration

In order to send messages through a Gmail account (also applicable to Google Apps accounts) add the following parts to your config files:

Files:

  • config/environments/production.rb
  • config/gitlab.yml
@zyuzuguldu
zyuzuguldu / benchmark-commands.txt
Created May 25, 2016 11:40 — forked from jkreps/benchmark-commands.txt
Kafka Benchmark Commands
Producer
Setup
bin/kafka-topics.sh --zookeeper esv4-hcl197.grid.linkedin.com:2181 --create --topic test-rep-one --partitions 6 --replication-factor 1
bin/kafka-topics.sh --zookeeper esv4-hcl197.grid.linkedin.com:2181 --create --topic test --partitions 6 --replication-factor 3
Single thread, no replication
bin/kafka-run-class.sh org.apache.kafka.clients.tools.ProducerPerformance test7 50000000 100 -1 acks=1 bootstrap.servers=esv4-hcl198.grid.linkedin.com:9092 buffer.memory=67108864 batch.size=8196
ambari-server stop
ambari-agent stop
pkill -9 java
#################################
# Remove Packages
################################
yum -y remove ambari-\*
yum -y remove hcatalog\*
yum -y remove hive\*
@zyuzuguldu
zyuzuguldu / parse_lmgrd.py
Created November 2, 2016 14:43 — forked from grigory-rechistov/parse_lmgrd.py
lmgrd log file parser
#!/usr/bin/env python
# The script to parse a lmgrd log and give some license usage metrics
#
# Copyright (c) 2014 Grigory Rechistov <[email protected]>
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice,