Skip to content

Instantly share code, notes, and snippets.

View d0k1's full-sized avatar
🌐
Everything is a copy of a copy of a copy...

Denis Kirpichenkov d0k1

🌐
Everything is a copy of a copy of a copy...
View GitHub Profile
@d0k1
d0k1 / unzip-recurse.py
Created January 9, 2018 20:55 — forked from pmuellr/unzip-recurse.py
tool to recursively unzip .zip and .jar files
#!/usr/bin/env python
import os
import sys
import subprocess
#-----------------------------------------------------------------------------
def main():
fileNames = sys.argv[1:]
@d0k1
d0k1 / tfidf java
Created September 17, 2017 10:34 — forked from johnconroy/tfidf java
Term frequency Inverse Document Frequency Java
package tfidf;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.text.DecimalFormat;
import java.util.ArrayList;
@d0k1
d0k1 / tfidf java
Created September 17, 2017 10:34 — forked from johnconroy/tfidf java
Term frequency Inverse Document Frequency Java
package tfidf;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.text.DecimalFormat;
import java.util.ArrayList;
@d0k1
d0k1 / tfidf java
Created September 17, 2017 10:34 — forked from johnconroy/tfidf java
Term frequency Inverse Document Frequency Java
package tfidf;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.text.DecimalFormat;
import java.util.ArrayList;
@d0k1
d0k1 / sysctl.conf
Created July 6, 2016 10:20 — forked from kfox/sysctl.conf
Linux kernel tuning settings for large number of concurrent clients
# Kernel sysctl configuration file for Red Hat Linux
#
# For binary values, 0 is disabled, 1 is enabled. See sysctl(8) and
# sysctl.conf(5) for more details.
# Controls source route verification
net.ipv4.conf.default.rp_filter = 1
# Do not accept source routing
net.ipv4.conf.default.accept_source_route = 0
@d0k1
d0k1 / mongod.service
Created March 23, 2016 16:43 — forked from benileo/mongod.service
Systemd Service Script for Mongod On Ubuntu 15.04+
[Unit]
Description=High-performance, schema-free document-oriented database
Documentation=man:mongod(1)
After=network.target
[Service]
Type=forking
User=mongodb
Group=mongodb
@Grapes([
@Grab(group='org.seleniumhq.selenium', module='selenium-java', version='2.49.1'),
@Grab(group='org.seleniumhq.selenium', module='selenium-firefox-driver', version='2.49.1')]
)
import org.openqa.selenium.*;
import org.openqa.selenium.firefox.*;
WebDriver driver = new FirefoxDriver();
driver.close();
@d0k1
d0k1 / nginx.sites-enabled.default
Last active January 25, 2016 20:05
If upstream is down let nginx show something positive
upstream tomcat_servers{
server 127.0.0.1:8080;# down;
server 127.0.0.1:8181;# down;
keepalive 128;
}
server {
gzip on;
gzip_comp_level 4;
@d0k1
d0k1 / ubuntu-eol.md
Last active August 29, 2015 14:26 — forked from dergachev/ubuntu-eol.md
What to do when your ubuntu distro is End-of-Life

Let's say you're using Ubuntu 13.04 (Raring Ringtail, released in April 2013) and it just went End-of-Life on you, because it's supported for only 6 months, and the deprecated packages are taken down after 12 months.

You'll probably figure this out the hard way. When you run sudo apt-get update, it will eventually report these errors:

Ign http://archive.ubuntu.com raring-updates/universe Sources/DiffIndex
Err http://security.ubuntu.com raring-security/main Sources
  404  Not Found [IP: 91.189.91.15 80]
Err http://security.ubuntu.com raring-security/universe Sources
  404  Not Found [IP: 91.189.91.15 80]