Skip to content

Instantly share code, notes, and snippets.

Avatar
🌤️
The sun is behind every cloud

Fedir RYKHTIK fedir

🌤️
The sun is behind every cloud
View GitHub Profile
@fedir
fedir / wgetInThreads.sh
Created Nov 10, 2011
Benchmarking Your site performance with wget
View wgetInThreads.sh
#!/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 Nov 10, 2011
Benchmarking Your site with ApacheBench
View abC50.sh
#!/bin/bash
ab -k -c50 -n100 $1
@fedir
fedir / newDb.sh
Last active Apr 21, 2017
New database and it's user creation
View newDb.sh
#!/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 Nov 10, 2011
SVN Summarized changes between revisions
View svnRevDiff.sh
#!/bin/bash
svn diff -r $1:HEAD --summarize . | grep -e '^M' -e '^A' | sed 's/........//' | sort
@fedir
fedir / gist:1716150
Created Feb 1, 2012
Finding all files with non-ascii characters in names and replacing it by underscores
View gist:1716150
find . | perl -ane '{ if(m/[[:^ascii:]]/) { print } }' | rename -n 's/[^[:ascii:]]/_/g'
@fedir
fedir / gist:5089021
Created Mar 5, 2013
Benchmark write speed / network bandwidth
View gist:5089021
dd if=/dev/zero of=/home/image.iso bs=8k count=256k
@fedir
fedir / gist:5089027
Last active Dec 14, 2015
Open source project power estimation formula
View gist:5089027

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 Aug 22, 2021 — 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
View google-font-dl.py
#!/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 Apr 18, 2016
Empty TYPO3 cache via shell // using bash condition on table existence in mysql
View emptyTypo3Cache.sh
#!/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 Apr 5, 2013
Shell helper for python dependencies install, saves the time
View easy_install
sudo python -m easy_install BeautifulSoup