Skip to content

Instantly share code, notes, and snippets.

@gsarkarsavo
gsarkarsavo / webcrawler.js
Created February 20, 2017 05:43 — forked from amoilanen/webcrawler.js
Simple PhantomJS-based web crawler library
//PhantomJS http://phantomjs.org/ based web crawler Anton Ivanov anton.al.ivanov@gmail.com 2012
//UPDATE: This gist has been made into a Node.js module and now can be installed with "npm install js-crawler"
//the Node.js version does not use Phantom.JS, but the API available to the client is similar to the present gist
(function(host) {
function Crawler() {
this.visitedURLs = {};
};

What / Why

Deploy key is a SSH key set in your repo to grant client read-only (as well as r/w, if you want) access to your repo.

As the name says, its primary function is to be used in the deploy process, where only read access is needed. Therefore keep the repo safe from the attack, in case the server side is fallen.

How to

  1. Generate a ssh key
@gsarkarsavo
gsarkarsavo / xdebug
Created June 13, 2017 13:25 — forked from kramarama/xdebug
install xdebug on centos
http://xdebug.org/install.php#configure-php
http://blog.jetbrains.com/phpstorm/2013/08/debugger-configuration-validation-with-phpstorm/
on CentOS:
1. You need to install PHP’s devel package for PHP commands execution
yum install php-devel
yum install php-pear
2. Next install GCC and GCC C++ compilers to compile Xdebug extension yourself.
yum install gcc gcc-c++ autoconf automake
@gsarkarsavo
gsarkarsavo / Get-FtpDirectory.ps1
Created December 1, 2017 08:46 — forked from arthurdent/Get-FtpDirectory.ps1
Recursively list all files in FTP directory in PowerShell / List files (recursive)
$Server = "ftp://ftp.example.com/"
$User = "[email protected]"
$Pass = "[email protected]"
Function Get-FtpDirectory($Directory) {
# Credentials
$FTPRequest = [System.Net.FtpWebRequest]::Create("$($Server)$($Directory)")
$FTPRequest.Credentials = New-Object System.Net.NetworkCredential($User,$Pass)
$FTPRequest.Method = [System.Net.WebRequestMethods+FTP]::ListDirectoryDetails

#Node - File Paths

##File Paths Node has a path module which can be used to manipulate paths.

###Normalizing Paths Paths can be stored in different ways and it is neccessary to ensure that the path is standardized.

var path = require('path');
path.normalize('/foo/bar//baz/asdf/quux/..');
@gsarkarsavo
gsarkarsavo / FTP Client.cs
Created February 13, 2018 10:49 — forked from aliprogrammer69/FTP Client.cs
FTP Client
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Net;
using System.Text;
using System.Threading.Tasks;
public class FtpClient
@gsarkarsavo
gsarkarsavo / ftp.cs
Created February 13, 2018 10:51 — forked from veyselsahin/ftp.cs
FTP Class For C#
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
using System.Net;
using System.Text.RegularExpressions;
namespace SystemEx
{
using System.Diagnostics;
using System.Data;
using System.Collections;
using Microsoft.VisualBasic;
using System.Collections.Generic;
using System;
using System.Net;
using System.IO;
using System.Text.RegularExpressions;
@gsarkarsavo
gsarkarsavo / nginx.conf
Created May 10, 2018 10:36 — forked from plentz/nginx.conf
Best nginx configuration for improved security(and performance). Complete blog post here http://tautt.com/best-nginx-configuration-for-security/
# to generate your dhparam.pem file, run in the terminal
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048
@gsarkarsavo
gsarkarsavo / fiddler-capture-https-android-emulator
Created November 8, 2018 06:35 — forked from gpsarkar/fiddler-capture-https-android-emulator
fiddler capture https with android emulator
emulator -avd AndroidEmulator -partition-size 1024 -writable-system
Install toot certificate from `http://ipv4.fiddler:8888`
The certificate will now be located in /data/misc/user/0/cacerts-added/.
Remount /system R/W as root if you haven't already (mount -o remount,rw /system).
adb shell