Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View tvlooy's full-sized avatar
🐧
<(o)

Tom Van Looy tvlooy

🐧
<(o)
View GitHub Profile
@tvlooy
tvlooy / magento_query.php
Created January 31, 2014 15:22
Magento query example
<?php
$db = Mage::getSingleton('core/resource')->getConnection('core_write');
$result = $db->query("SELECT * FROM cms_page");
while ($item = $result->fetch(PDO::FETCH_ASSOC)) {
print $item['title'] . ' | ';
}
<?php
/* Configure parameters and service in config.yml:
*
* imports:
* - { resource: parameters.extras.yml }
*
* services:
* dynamic.parameters:
* class: Ctors\MyBundle\Util\DynamicParameters
@tvlooy
tvlooy / ftps.php
Last active August 29, 2015 13:56
FTPS test script
<?php
$ftp_server = 'ftps://servername/';
$ftp_user = 'user';
$ftp_password = 'pass';
$source_file = '/export/klanten.csv';
$destination_file = '/tmp/klanten.csv';
$file = fopen($destination_file, 'w');
@tvlooy
tvlooy / generateValueObject.sh
Last active August 29, 2015 13:58
Generate a Value Object
#!/bin/bash
if [ ! -n "$1" ]; then
echo "Generate a Value Object"
echo "Usage: $0 src/Acme/DemoDomainBundle/Model/Something/Concept.php"
exit
fi
FILE=$1
@tvlooy
tvlooy / dmesg.txt
Last active August 29, 2015 14:01
Lenovo ideapad yoga 11s - OpenBSD dmesg
OpenBSD 5.5-current (RAMDISK_CD) #102: Mon May 12 21:53:03 MDT 2014
todd@i386.openbsd.org:/usr/src/sys/arch/i386/compile/RAMDISK_CD
RTC BIOS diagnostic error 80<clock_battery>
cpu0: Intel(R) Core(TM) i5-4210Y CPU @ 1.5GHz ("GenuineIntel" 686-class) 1.40 GHz
cpu0: FPU,V86,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,DS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,PBE,NXE,LONG,SSE3,PCLMUL,DTES64,MWAIT,DS-CPL,VMX,EST,TM2,SSSE3,FMA3,CX16,xTPR,PDCM,PCID,SSE4.1,SSE4.2,MOVBE,POPCNT,DEADLINE,AES,XSAVE,AVX,F16C,RDRAND,LAHF,ABM,PERF,ITSC,FSGSBASE,BMI1,AVX2,SMEP,BMI2,ERMS,INVPCID
real mem = 2573516800 (2454MB)
avail mem = 2523840512 (2406MB)
mainbus0 at root
bios0 at mainbus0: AT/286+ BIOS, date 08/16/13, BIOS32 rev. 0 @ 0xef725, SMBIOS rev. 2.7 @ 0xe6ec0 (37 entries)
bios0: vendor LENOVO version "8FCN19WW(V1.00)" date 08/16/2013
@tvlooy
tvlooy / services.xml
Last active August 29, 2015 14:02
Example: inject repository into service
<?xml version="1.0" ?>
<container xmlns="http://symfony.com/schema/dic/services"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd">
<parameters>
<parameter key="acme.demo.repository.class">Acme\DemoBundle\Entity\ExampleRepository</parameter>
<parameter key="acme.demo.service.class">Acme\DemoBundle\Service\ExampleService</parameter>
</parameters>
@tvlooy
tvlooy / gist:a6b9c58c5d1ab4076775
Created June 13, 2014 21:31
Example service with factory method
<?xml version="1.0" ?>
<container xmlns="http://symfony.com/schema/dic/services"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd">
<services>
<service id="foo" class="DateTime"
factory-class="DateTime"
factory-method="createFromFormat">
<argument>Ymd</argument>
export GIT_PS1_SHOWDIRTYSTATE=1
PS1='[\[\033[00;31m\]\u@\h\[\033[00m\] \[\033[00;34m\]\w\[\033[00;31m\]$(__git_ps1)\[\033[00m\]]\n\$ '
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
LANGUAGE = (unset),
LC_ALL = (unset),
LC_PAPER = "de_BE.UTF-8",
LC_ADDRESS = "de_BE.UTF-8",
LC_MONETARY = "de_BE.UTF-8",
LC_NUMERIC = "de_BE.UTF-8",
LC_TELEPHONE = "de_BE.UTF-8",
LC_IDENTIFICATION = "de_BE.UTF-8",
#################################################################################
# CVE-XXXXX Wordpress and Drupal XML Blowup Attack DoS#
# Author: Nir Goldshlager - Salesforce.com Product Security Team#
# This is a Proof of Concept Exploit, Please use responsibly.#
#################################################################################
#!/usr/bin/env python
from __future__ import print_function
import threading
import time
import urllib