Skip to content

Instantly share code, notes, and snippets.

@valguss
valguss / 0_reuse_code.js
Last active August 29, 2015 14:07
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@valguss
valguss / sql_commands.sql
Last active August 29, 2015 14:07
Useful SQL Commands
#get coupons from skycart
select * from coupons c WHERE c.coupon_type = 'G' AND c.coupon_id NOT IN (SELECT coupon_id FROM coupon_redeem_track)
#SELECT * from customers c, coupon_gv_customer cgc WHERE c.customers_id = cgc.customer_id
@valguss
valguss / linux_commands.sh
Last active August 29, 2015 14:07
Helpful Linux Commands
Magento Grab Database:
mysqldump --routines -u root -p db_name -h 127.0.0.1 --lock-tables=false --single-transaction | gzip -9 > db_name.sql.gz
#see what CVE's are fixed
rpm -q --changelog openssh | grep CVE
rpm -q --changelog openssl | grep CVE-2014-0160
#master process listening on port
@valguss
valguss / dev_test.php
Created March 16, 2012 10:29 — forked from davidalexander/index.php
Thoughts on best way to test subdomain
<?php
//faster using strpos
$staging_subdomains = array(
's1',
's2',
's3',
's4',
's5',
'mac',
'local',
enquiries: enquiries
shop: shop
# to make the e-mails also get pushed to someone else, add a list of comma seperated email address
#ie: enquiries: enquiries, [email protected]
[email protected] shop
[email protected] enquiries
@DOMAINNAME.com enquiries
myhostname = mail.SERVERNAME.com
mydomain = SERVERNAME.com
inet_interfaces = all
mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain, mail.$mydomain, www.$mydomain, ftp.$mydomain
mynetworks_style = host
#Then add the following to the same file:
smtpd_sasl_auth_enable = yes
smtpd_recipient_restrictions = permit_mynetworks,permit_sasl_authenticated,reject_unauth_destination,reject_non_fqdn_recipient
smtpd_sasl_security_options = noanonymous
auth default {
mechanisms = plain login
passdb pam {
}
userdb passwd {
}
socket listen {
client {
path = /var/spool/postfix/private/auth
mode = 0660
SSLCertificateFile /usr/local/ssl/server.crt
SSLCertificateKeyFile /usr/local/ssl/server.key
SSLProtocol -all +TLSv1 +SSLv3
SSLCipherSuite HIGH:MEDIUM:!aNULL:+SHA1:+MD5:+HIGH:+MEDIUM
@valguss
valguss / countries.html
Created November 17, 2010 14:06
A dropdown list of countries
<select id="country" name="country">
<option value="" selected="selected"></option>
<option value="Afghanistan">Afghanistan</option>
<option value="Albania">Albania</option>
<option value="Algeria">Algeria</option>
<option value="Andorra">Andorra</option>
<option value="Antigua and Barbuda">Antigua and Barbuda</option>
<option value="Argentina">Argentina</option>
<option value="Armenia">Armenia</option>
<option value="Australia">Australia</option>