Skip to content

Instantly share code, notes, and snippets.

@rvsjoen
rvsjoen / CVE-2021-44228_IPs.csv
Last active December 11, 2021 18:48 — forked from gnremy/CVE-2021-44228_IPs.csv
CVE-2021-44228 Apache Log4j RCE Attempts Dec 10th 3:40PM ET
ip tag_name
18.27.197.252 Apache Log4j RCE Attempt
23.129.64.131 Apache Log4j RCE Attempt
23.129.64.141 Apache Log4j RCE Attempt
23.129.64.146 Apache Log4j RCE Attempt
23.129.64.148 Apache Log4j RCE Attempt
45.12.134.108 Apache Log4j RCE Attempt
45.155.205.233 Apache Log4j RCE Attempt
46.166.139.111 Apache Log4j RCE Attempt
46.182.21.248 Apache Log4j RCE Attempt
class Item extends AppModel
{
public $recursive = -1;
public $actsAs = array('Containable');
public $hasMany = array(
'Review' => array(
'ClassName' => 'Review',
'foreignKey' => 'item_id'
)
@rvsjoen
rvsjoen / gist:3177753
Created July 25, 2012 18:33
Setting up PHPUnit for Joomla Platform!
sudo pear install --alldeps phpunit/PHPUnit
sudo pear install phpunit/PHPUnit_MockObject
sudo pear install phpunit/DBUnit
<?php defined('_JEXEC') or die;
jimport('joomla.application.component.view');
abstract class HelloWorldViewBase extends JView {
public function __construct($config = array()) {
parent::__construct($config);
// Using addTemplatePath will give this a high priority, so we push instead
array_push($this->_path['template'], JPATH_COMPONENT . '/views/base/tmpl');
<?php
class DonkeyController extends JController
{
public function doshit()
{
$model = $this->getModel();
$model->setState('foo', 'bar');
$model->foo = 'bar';
$this->setRedirect('index.php?option=com_donkey&view=shit');
@rvsjoen
rvsjoen / gist:3077007
Created July 9, 2012 14:56
Joomla! CMS File system structure
+-- administrator // This is where the administrator application lives
¦ +-- cache
¦ +-- components // Components specific to administrator
¦ +-- help // Help files for administrator
¦ +-- includes
¦ +-- language // Administrator language files
¦ +-- manifests // Installation manifests
¦ +-- modules // Administrator modules
¦ +-- templates // Administrator templates
+-- cache
<?php
foreach ($form->getFieldsets() as $group => $fieldset) {
foreach ($form->getFieldset($group) as $field) {
$form->removeField($field->fieldname); // This will remove only the fields outside <fields> elements
// $form->removeField($field->fieldname, $group); // This will remove only the fields inside the <fields> element
}
}
?>
class ... extends JControllerForm
{
public function save($key = null, $urlVar = null)
{
$result = parent::save($key, $urlVar);
$model = $this->getModel();
$state = $model->getState();
if($result){
$link = JRoute::_($this->getRedirectToItem().'&id='.$state->get('item.id'), false);
$this->setRedirect($link);
<script>
function destroyLessCache(pathToCss) { // e.g. '/css/' or '/stylesheets/'
if (!window.localStorage || !less || less.env !== 'development') {
// return;
}
var host = window.location.host;
var protocol = window.location.protocol;
var keyPrefix = protocol + '//' + host + pathToCss;
for (var key in window.localStorage) {
if (key.indexOf(keyPrefix) === 0) {
<?php
class BaseController extends JControllerForm
{
public function delete()
{
// Do shit
$this->setRedirect(JRoute::_($this->getRedirectToList(), false));
}