This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Remove any non-ASCII characters and convert known non-ASCII characters | |
* to their ASCII equivalents, if possible. | |
* | |
* @param string $string | |
* @return string $string | |
* @author Jay Williams <myd3.com> | |
* @license MIT License | |
* @link http://gist.github.com/119517 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# From a fresh install of squeeze | |
apt-get install ruby rubygems # Need ruby to use fpm | |
gem1.8 install fpm --no-ri --no-rdoc | |
apt-get install build-essential openssl libreadline6 libreadline6-dev zlib1g zlib1g-dev libssl-dev ncurses-dev libyaml-dev | |
wget ftp://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.3-p125.tar.gz | |
tar -zxvf ruby-1.9.3-p125.tar.gz | |
cd ruby-1.9.3-p125 | |
rm -rf /tmp/ruby193 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Configuration file for runtime kernel parameters. | |
# See sysctl.conf(5) for more information. | |
# Protection from SYN flood attack. | |
net.ipv4.tcp_syncookies = 1 | |
# See evil packets in your logs. | |
#net.ipv4.conf.all.log_martians = 1 | |
# Disable packet forwarding. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$begin = new DateTime( '2010-05-01' ); | |
$end = new DateTime( '2010-05-10' ); | |
$interval = DateInterval::createFromDateString('1 day'); | |
$period = new DatePeriod($begin, $interval, $end); | |
foreach ( $period as $dt ){ | |
echo $dt->format( "l Y-m-d H:i:s\n" ); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# /etc/init.d/mysql stop | |
# mysqld_safe --skip-grant-tables & | |
# mysql -u root | |
mysql> use mysql; | |
mysql> update user set password=PASSWORD("NEW-ROOT-PASSWORD") where User='root'; | |
mysql> flush privileges; | |
mysql> quit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// add to ~/.ssh/config | |
ControlMaster auto | |
ControlPath /tmp/%r@%h:%p | |
ControlPersist yes |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
UPDATE mysql.user SET Grant_priv='Y', Super_priv='Y' WHERE User='root'; | |
FLUSH PRIVILEGES; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# encrypt | |
openssl rsautl -encrypt -pubin -inkey pawel.jendrusik.id_rsa.pem.pub -ssl -in myMessage.txt -out myEncryptedMessage.txt | |
# decrypt | |
openssl rsautl -decrypt -inkey ~/.ssh/id_rsa -in passwords_pawel_jendrusik_encrypted.txt -out li_de_new_pass.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
server { | |
server_name blog.example.com; | |
rewrite ^(.*) http://magazyn.example.com permanent; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Compiling TeX: | |
tex test1.tex : converts a TeX file to DVI (probably you don't need that, if you mean LaTeX) | |
pdftex test1.tex : converts a TeX file to PDF (probably you don't need that either) | |
latex test1.tex : converts a LaTeX file to DVI | |
pdflatex test1.tex : converts a LaTeX file to PDF | |
Converting: | |
dvips test1.dvi : converts a DVI file to PostScript | |
ps2pdf test1.ps : converts a PostScript file to PDF | |
dvipdfmx xtest1.dvi : converts a DVI file to PDF (similar: dvipdf, dvipdfm) |
OlderNewer