Skip to content

Instantly share code, notes, and snippets.

View fedir's full-sized avatar
🌤️
The sun is behind every cloud

Fedir RYKHTIK fedir

🌤️
The sun is behind every cloud
View GitHub Profile
@fedir
fedir / wgetInThreads.sh
Created November 10, 2011 20:56
Benchmarking Your site performance with wget
#!/bin/bash
DOWNLOAD_THREADS=100
start=`date +%H:%M:%S`
for((i=1; i<=$DOWNLOAD_THREADS; i++))
do
wget -o /dev/null -O /dev/null -p -q $1 &
done
wait
end=`date +%H:%M:%S`
printf "%s " `hostname` $1 $start $end
@fedir
fedir / abC50.sh
Created November 10, 2011 20:57
Benchmarking Your site with ApacheBench
#!/bin/bash
ab -k -c50 -n100 $1
@fedir
fedir / newDb.sh
Last active April 21, 2017 16:20
New database and it's user creation
#!/bin/bash
mysql -e "CREATE DATABASE \`$1\` DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;"
mysql -e "GRANT ALL PRIVILEGES ON \`$1\`.* TO '$2'@'localhost' IDENTIFIED BY '$3' WITH GRANT OPTION;"
@fedir
fedir / svnRevDiff.sh
Created November 10, 2011 21:07
SVN Summarized changes between revisions
#!/bin/bash
svn diff -r $1:HEAD --summarize . | grep -e '^M' -e '^A' | sed 's/........//' | sort
@fedir
fedir / gist:1716150
Created February 1, 2012 09:34
Finding all files with non-ascii characters in names and replacing it by underscores
find . | perl -ane '{ if(m/[[:^ascii:]]/) { print } }' | rename -n 's/[^[:ascii:]]/_/g'
@fedir
fedir / gist:5089021
Created March 5, 2013 09:21
Benchmark write speed / network bandwidth
dd if=/dev/zero of=/home/image.iso bs=8k count=256k
@fedir
fedir / gist:5089027
Last active December 14, 2015 12:49
Open source project power estimation formula

Each open source project has a power, which will be represented in human ressources behind it. The quantity of project maintainers and theirs qualities could determine the success of the project.

There are important elements, which plays a lot :

  • Vertical axe of competences must be completed
  • Total quantity of people
  • People must be well connected to work together on the project
  • Team members must help each other by their competences
  • People must know and exchange with maximum quantity of members inside the community
  • The total level of competences on each level of axe of competences must be strong
@fedir
fedir / google-font-dl.py
Last active January 30, 2024 05:20 — forked from kevinoid/google-font-dl.py
Script to download google fonts locally (for web development off-line, for example). Use : python getAllGoogleFonts.py Dosis
#!/usr/bin/env python
#
# Downloader for Google Web Fonts
#
# For usage information run with "--help"
#
# Works on Python 2.6 and later, 3 and later
# Requires tinycss (and argparse for Python 2.6) from pip
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
@fedir
fedir / emptyTypo3Cache.sh
Last active April 18, 2016 15:09
Empty TYPO3 cache via shell // using bash condition on table existence in mysql
#!/bin/bash
DB=$1
echo "Empty cache dB $DB"
function empty_table {
TABLE=$1
if [ $(mysql -N -s -e "select count(*) from information_schema.tables where table_schema='$DB' and table_name='$TABLE';") -eq 1 ];
then
mysql $DB -e "TRUNCATE $TABLE"
@fedir
fedir / easy_install
Created April 5, 2013 04:18
Shell helper for python dependencies install, saves the time
sudo python -m easy_install BeautifulSoup