Skip to content

Instantly share code, notes, and snippets.

View chexov's full-sized avatar

Anton P. Linevich chexov

  • Los Angeles
View GitHub Profile
@chexov
chexov / dkms r750 ubuntu driver; Rocket 750
Last active November 30, 2022 23:53
dkms for rocketraid r750
```
wget 'http://www.highpoint-tech.com/BIOS_Driver/R750/Linux/R750_Linux_Src_v1.2.7-16_08_23.tar.gz'
tar xzvf R750_Linux_Src_v1.2.7-16_08_23.tar.gz
./r750-linux-src-v1.2.7-16_08_23.bin --target r750 --noexec
cd r750
cat <<< '
MAKE="make -C product/r750/linux/ KERNELDIR=/lib/modules/${kernelver}/build"
CLEAN="make -C product/r750/linux/ clean"
BUILT_MODULE_NAME=r750
DEST_MODULE_LOCATION=/kernel/drivers/scsi/
@chexov
chexov / S3SingleFileUploaderMain.java
Last active June 20, 2016 17:21
s3 file upload main
package com.vg.utils;
import java.io.File;
import java.io.IOException;
import java.util.Date;
import java.util.List;
import org.apache.commons.io.FileUtils;
import org.apache.commons.io.IOUtils;
import org.apache.log4j.Level;
@chexov
chexov / gist:0e4fcc2a09cfe4c96680
Last active April 14, 2016 19:31
nginx proxies location
location /proxies/{
alias /Users/chexov/proxies/;
autoindex on;
if ($request_method = 'OPTIONS') {
add_header "Access-Control-Allow-Origin" $http_origin;
add_header "Vary" "Origin";
add_header 'Access-Control-Allow-Credentials' 'true';
add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS';
@chexov
chexov / poc.js
Created March 1, 2016 15:01
soap js magick
params
{ host: '5.2.125.212:50006',
wsdl: '/ws/scHumanTaskControl.wsdl:HumanTaskControlWS?WSDL' }
> params['path'] = '5.2.125.212:50006'
'5.2.125.212:50006'
> var soapClient = easysoap.createClient(params);
undefined
> soapClient.getAllFunctions()
Promise { <pending> }
> .then((functionArray) => { console.log(functionArray); })
[
{
"id": "BARS_AND_TONES",
"displayName": "Bars and Tone"
},
{
"id": "FADE_TO_BLACK",
"displayName": "Fade to Black"
},
{
@chexov
chexov / nginx.conf
Last active August 23, 2023 18:12
nginx wide open CORS with Range requests
#
# max requests per keepalive connection
keepalive_requests 55000;
# awesome OPTIONS header
if ($request_method = 'OPTIONS') {
add_header "Access-Control-Allow-Origin" $http_origin;
add_header "Vary" "Origin";
add_header 'Access-Control-Allow-Credentials' 'true';
add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS';
@chexov
chexov / gist:1cf207a7bdd17ad2ff43
Last active August 29, 2015 14:28 — forked from jedi4ever/gist:903751
Tuning stuff for Ubuntu hosts
# /etc/security/limits.conf
* soft nofile 999999
* hard nofile 999999
root soft nofile 999999
root hard nofile 999999
===========================================================
# /etc/sysctl.conf
# sysctl for maximum tuning
Master/
----------------------------------------------------------------------------------------
Language files blank comment code
----------------------------------------------------------------------------------------
Java 258 4297 1121 22167
Javascript 31 1291 747 6985
CSS 15 355 227 4420
C 1 435 65 2542
JSON 14 1 0 2194
LESS 16 375 266 2118
#!/usr/bin/env bash
# This script prints out all of your Redis keys and their size in a human readable format
# Copyright 2013 Brent O'Connor
# License: http://www.apache.org/licenses/LICENSE-2.0
human_size() {
awk -v sum="$1" ' BEGIN {hum[1024^3]="Gb"; hum[1024^2]="Mb"; hum[1024]="Kb"; for (x=1024^3; x>=1024; x/=1024) { if (sum>=x) { printf "%.2f %s\n",sum/x,hum[x]; break; } } if (sum<1024) print "1kb"; } '
}
@chexov
chexov / test
Created April 3, 2015 06:56
How to get EchoAuth for twitter4j. Android
String consumerKey = "";
String consumerSecret = "";
String token = "";
String tokenSecret = "";
Configuration conf = new ConfigurationBuilder().setOAuthConsumerKey(consumerKey).setOAuthConsumerSecret(consumerSecret).setOAuthAccessToken(token).setOAuthAccessTokenSecret(tokenSecret).build();
OAuthAuthorization auth = new OAuthAuthorization(conf);