Skip to content

Instantly share code, notes, and snippets.

View ibrahimozgon's full-sized avatar

ibrahim özgön ibrahimozgon

View GitHub Profile
@Hironsan
Hironsan / fit_vs_fit_generator.py
Created September 9, 2017 04:03
fit vs fit_generator in Keras
import numpy as np
from keras.preprocessing import sequence
from keras.models import Sequential
from keras.layers import Dense, Embedding
from keras.layers import LSTM
from keras.datasets import imdb
def batch_iter(data, labels, batch_size, shuffle=True):
num_batches_per_epoch = int((len(data) - 1) / batch_size) + 1
# get total requests by status code
awk '{print $9}' /var/log/nginx/access.log | sort | uniq -c | sort -rn
# get top requesters by IP
awk '{print $1}' /var/log/nginx/access.log | sort | uniq -c | sort -rn | head | awk -v OFS='\t' '{"host " $2 | getline ip; print $0, ip}'
# get top requesters by user agent
awk -F'"' '{print $6}' /var/log/nginx/access.log | sort | uniq -c | sort -rn | head
# get top requests by URL
@NickCraver
NickCraver / Build.xml
Last active June 28, 2024 07:54
Stack Overflow Build Reference Docs
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="PrepareStaticContent" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<!-- Passed in Parameters -->
<configuration></configuration>
<workingDir></workingDir>
<buildNumber></buildNumber>
<buildViews>false</buildViews>
<minifyJs>true</minifyJs>
<TargetsDirectory></TargetsDirectory>
@baraldilorenzo
baraldilorenzo / readme.md
Last active June 13, 2024 03:07
VGG-16 pre-trained model for Keras

##VGG16 model for Keras

This is the Keras model of the 16-layer network used by the VGG team in the ILSVRC-2014 competition.

It has been obtained by directly converting the Caffe model provived by the authors.

Details about the network architecture can be found in the following arXiv paper:

Very Deep Convolutional Networks for Large-Scale Image Recognition

K. Simonyan, A. Zisserman

@thejuan
thejuan / IIS Logstash Grok
Created February 21, 2014 18:16
A Logstash Grok filter for IIS (W3C default fields + bytes sent)
filter{
grok {
match => ["message", "%{TIMESTAMP_ISO8601:log_timestamp} %{WORD:iisSite} %{IPORHOST:site} %{WORD:method} %{URIPATH:page} %{NOTSPACE:querystring} %{NUMBER:port} %{NOTSPACE:username} %{IPORHOST:clienthost} %{NOTSPACE:useragent} %{NOTSPACE:referer} %{NUMBER:response} %{NUMBER:subresponse} %{NUMBER:scstatus} %{NUMBER:bytes:int} %{NUMBER:timetaken:int}"]
}
}
@anova
anova / turkish-capitalize-words.js
Last active June 28, 2022 08:45
Capitalize, lowercase, uppercase for Turkish alphabet.
//http://stackoverflow.com/a/1026087/181295
String.prototype.turkishUpperCase = function () {
return this.replace(/ğ/g, 'Ğ')
.replace(/ü/g, 'Ü')
.replace(/ş/g, 'Ş')
.replace(/ı/g, 'I')
.replace(/i/g, 'İ')
.replace(/ö/g, 'Ö')
.replace(/ç/g, 'Ç')
.toUpperCase();
@sdesalas
sdesalas / restart-iis-remote.bat
Last active July 14, 2020 18:44
This script restarts IIS and configures it on a remote server. Needs Sysinternals PsExec (http://technet.microsoft.com/en-au/sysinternals/bb897553.aspx)
:: Stop IIS
PsExec.exe \\LDNSERV01 -s -i C:\windows\system32\inetsrv\appcmd.exe stop site OnlineXCart
:: Recycle App Pool (removes lock on file system)
PsExec.exe \\LDNSERV01 -s -i C:\windows\system32\inetsrv\appcmd.exe recycle apppool OnlineXCart
:: Wait 4 Seconds
:: This is useful if you have a command straight after that executes file operations on IIS App Directory
ping -n 5 127.0.0.1 > nul