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 nltk.corpus import wordnet #Using Natural language toolkit (http://www.nltk.org/) | |
import codecs | |
def check(str): | |
if not wordnet.synsets(str): | |
return 1 | |
else: | |
return 0 | |
a=0 | |
if __name__ == '__main__': |
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
#This shell script will find all empty directories and sub-directories in a project folder and creates a .gitkeep file, so that the empty directory | |
#can be added to the git index. | |
find * -type d -empty -exec touch {}/.gitkeep \; |
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
//upload code | |
$filename=$_FILE['name']['filename_in_html']; //you can change this with your filename | |
$allowed='png,jpg'; //which file types are allowed seperated by comma | |
$extension_allowed= explode(',', $allowed); | |
$file_extension= pathinfo($filename, PATHINFO_EXTENSION); | |
if(array_search($file_extension, $extension_allowed)) | |
{ | |
echo "$extension_allowed allowed for uploading file"; | |
} |
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
dd bs=4096 conv=noerror,sync if=/dev/sdc1 | gzip -c > img.gz |
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 | |
// the message | |
$msg = "First line of textnSecond line of text"; | |
// use wordwrap() if lines are longer than 70 characters | |
$msg = wordwrap($msg,70); | |
// send email | |
mail("someone@example.com","My subject",$msg); | |
? > |
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
d="$(date -d -now)" | |
mkdir backup/"$d" | |
cp -r /var/www/html/* backup/"$d" |
NewerOlder