This file contains hidden or 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
| <!-- Amazon S3 --> | |
| <link rel="dns-prefetch" href="//s3.amazonaws.com"> | |
| <!-- Google CDN --> | |
| <link rel="dns-prefetch" href="//ajax.googleapis.com"> | |
| <!-- Microsoft CDN --> | |
| <link rel="dns-prefetch" href="//ajax.microsoft.com"> | |
| <link rel="dns-prefetch" href="//ajax.aspnetcdn.com"> |
This file contains hidden or 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 bs4 import BeautifulSoup | |
| import urllib | |
| f = open('jan.csv','w') | |
| for i in range(120,130): | |
| openurl = 'http://192.168.1.64/demo/test/fold/'+str(i)+'.html' | |
| r = urllib.urlopen(openurl).read() | |
| soup = BeautifulSoup(r) | |
| title = soup.find("div", class_="row1 content conAddres").find("h3").string |
This file contains hidden or 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 bs4 import BeautifulSoup | |
| import urllib | |
| r = urllib.urlopen('http://192.168.1.64/test/120.html').read() | |
| soup = BeautifulSoup(r) | |
| title = soup.find("div", class_="row1 content conAddres").find("h3").string | |
| author = soup.find("div", class_="row1 content conAddres").find("h4").find("a").string |
This file contains hidden or 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
| #!/bin/bash | |
| for i in {3142..3150} | |
| do | |
| curl -A 'Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.12) Gecko/20101026 Firefox/3.6.12' -o $i.html http://targetsite.com/posts/$i/ | |
| done |
This file contains hidden or 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 | |
| $handle = fopen("file.txt", "r"); | |
| if ($handle) { | |
| while (($line = fgets($handle)) !== false) { | |
| // process the line read. | |
| echo "Text Before - " . $line . " - Text After<br>"; | |
| } | |
| fclose($handle); | |
| } else { |
This file contains hidden or 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
| import os, fnmatch | |
| def findReplace(directory, filePattern): | |
| for path, dirs, files in os.walk(os.path.abspath(directory)): | |
| for filename in fnmatch.filter(files, filePattern): | |
| filepath = os.path.join(path, filename) | |
| with open(filepath) as f: | |
| s = f.read().splitlines(True) | |
| with open(filepath, "w") as f: | |
| f.write("<?php") | |
| f.writelines(s[1:]) |
This file contains hidden or 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 | |
| //Add Database details | |
| $database_host = "localhost";// DB Host | |
| $database_user = "dbuser"; // DB User Name | |
| $database_password = "dbpassword"; // DB Password | |
| $magento_database = "dbname"; //DB Name | |
| $table_prefix = "dbprefix_"; // DB Prefix | |
| //Do the action | |
| $db = mysql_connect($database_host, $database_user, $database_password); |
This file contains hidden or 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
| SET FOREIGN_KEY_CHECKS=0; | |
| ############################## | |
| # SALES RELATED TABLES | |
| ############################## | |
| TRUNCATE `sales_flat_creditmemo`; | |
| TRUNCATE `sales_flat_creditmemo_comment`; | |
| TRUNCATE `sales_flat_creditmemo_grid`; | |
| TRUNCATE `sales_flat_creditmemo_item`; | |
| TRUNCATE `sales_flat_invoice`; |
This file contains hidden or 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 | |
| // assuming file.zip is in the same directory as the executing script. | |
| $file = 'mrkothari.zip'; | |
| // get the absolute path to $file | |
| $path = pathinfo(realpath($file), PATHINFO_DIRNAME); | |
| $zip = new ZipArchive; | |
| $res = $zip->open($file); | |
| if ($res === TRUE) { |
This file contains hidden or 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
| ## Diflate compression :- Compress HTML, CSS, JavaScript, Text, XML and fonts ## | |
| <IfModule mod_deflate.c> | |
| AddOutputFilterByType DEFLATE application/javascript | |
| AddOutputFilterByType DEFLATE application/rss+xml | |
| AddOutputFilterByType DEFLATE application/vnd.ms-fontobject | |
| AddOutputFilterByType DEFLATE application/x-font | |
| AddOutputFilterByType DEFLATE application/x-font-opentype | |
| AddOutputFilterByType DEFLATE application/x-font-otf | |
| AddOutputFilterByType DEFLATE application/x-font-truetype | |
| AddOutputFilterByType DEFLATE application/x-font-ttf |