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
$ for file in *.exe ; do mv $file `echo $file | sed 's/\(.*\.\)exe/\1zip/'` ; done | |
$ for file in *.zip ; do mkdir `echo $file | sed 's/\(.*\.\)zip/\1/'` ; mv $file `echo $file | sed 's/\(.*\.\)zip/\1\//'` ; cd `echo $file | sed 's/\(.*\.\)zip/\1/'` ; unzip $file ; cd .. ; done | |
$ for file in *. ; do mv $file `echo $file | sed 's/\.//'` ; done |
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
(defn fiblist | |
([stop] | |
(cond | |
(< stop 0) '() | |
(= stop 0) '(0) | |
(= stop 1) '(0 1) | |
:else (reverse (fiblist stop '(1 0))))) | |
([stop fibseq] | |
(let [newfib (+ (first fibseq) (second fibseq))] | |
(if (<= stop newfib) fibseq |
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
Note to self: If you are seeing htaccess permissions issues, | |
check your http conf file for the site. I had forgotten to | |
follow symlinks on an instance and was getting very strange | |
behavior with apache claiming that I didn't have permissions | |
to check .htaccess. I added the option to follow symlinks and | |
the problems went away. |
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
Note to self: | |
I had a few issues installing sugarcrm. A few things to remember for next time: | |
* chown -R http:http sugarcrm/ | |
* permissions, top folder 755, things that it wants as 766, set as that | |
* the htaccess/symlink issue noted in a related post | |
* watch the httpd error logs while running and fix things that are broken as they come up | |
* installed php/json by pecl install json (i think) | |
* enabled php things in /etc/php/php.ini - json.so, imap.so | |
* increase max post and file upload to 25M |
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
$ mysql -u root -p | |
> CREATE DATABASE some_db; | |
> GRANT ALL PRIVILEGES ON some_db.* TO new_user@localhost IDENTIFIED BY 'SOMEPASSWORD'; | |
> 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
// Can't sudo! | |
$ sudo su | |
sudo: must be setuid root | |
// Fix below | |
$ su | |
# ls -l /usr/bin/sudo | |
-rwxr-xr-x 2 asterisk asterisk 159K Sep 9 05:21 /usr/bin/sudo* |
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
Displaying github gists in tumblr is not as difficult as I | |
have seen it written. All you need to do is use the embed code | |
provided by github. | |
If you want a single file in a gist with multiple files, simply | |
append ?file=<filename> at the end of the url. | |
E.g. | |
<script src="https://gist.github.com/emil10001/590636713d58cbc11b0a.js?file=classdef"></script> |
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
// credit - http://stackoverflow.com/a/13789869/974800 | |
private boolean isGooglePlayInstalled() { | |
try { | |
ApplicationInfo info = getActivity().getPackageManager().getApplicationInfo( | |
"com.android.vending", 0); | |
return true; | |
} catch (PackageManager.NameNotFoundException e) { | |
return false; | |
} | |
return false; |
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
sudo bash -c "iptables-save > /etc/iptables.rules" |
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
chmod 777 /etc/asterisk/* |
OlderNewer