Skip to main content

Primary links

  • Home
  • AI
  • Kubernetes
  • Incus
  • Ansible
  • Terraform
  • OpenStack
  • Virtualization
  • Linux
  • SmartHome
  • HowTo

Misc

  • Linux
  • Hardware
  • Programming
    • Graphic
    • HTML / PHP / CMS
    • Java
    • PL / SQL
    • Magento
    • python
    • Asterisk
    • C / C++
    • JavaScript
    • Json
    • Magento
      • Cache
      • Configuration
      • Database select
      • Delete unused product images
      • Erase credit card
      • Installation
      • Java Connector
      • Magento code snippet
      • mkMagentoDump.sh
      • snippets
    • OpenOffice / LibreOffice
    • Perl
    • Postfix
    • Regular Expression
    • TLA
    • Tomcat
    • Zenity
    • bash
    • find
    • git
    • ofbiz
    • wildfly
    • xml
  • Databases
  • Multimedia
  • Windows

Cloud

  • OpenStack
  • cloud-config
  • nextcloud

Virtualization

  • Virtualization
  • Incus
  • Docker
  • KVM
  • Kubernetes
  • LXC
  • LXD
  • QEMU
  • VMware
  • VirtualBox
  • multipass
  • podman
  • vagrant
  • XEN

Network

  • DNS
  • Firewall
  • Linux
  • OpenvSwitch
  • SSL
  • VLAN
  • VPN
  • iPXE
  • namespaces
  • nmcli
  • tcpdump

Storage

  • CEPH
  • DRBD
  • LVM
  • S3
  • ZFS
  • btrfs

Automation / CI/CD

  • Install
  • Ansible
  • GitLab
  • LLM
  • Preseed
  • Puppet
  • Terraform
  • Ubuntu autoinstall

Monitoring / Visualisation

  • Grafana
  • Icinga
  • Prometheus
  • Monitoring
  • ELK
  • mermaid
-- get order with saved cc data
SELECT so.increment_id
FROM sales_order_entity_varchar soev
INNER JOIN sales_order_entity soe ON soev.entity_id = soe.entity_id
INNER JOIN sales_order so ON soe.parent_id = so.entity_id
WHERE soev.attribute_id = 280
AND soev.VALUE != ""

-- get saved credit card owner
select value
from sales_order_entity_varchar
where attribute_id = 282 
and entity_id in (
    select entity_id
    from sales_order_entity_varchar
    where attribute_id = 280 
    and value != ""
);

-- erase credit card data by order id
SET @orderId = '100000013';

UPDATE sales_order_entity_varchar
SET VALUE = NULL
WHERE entity_id = (
    SELECT entity_id
    FROM sales_order_entity
    WHERE entity_type_id =14
    AND parent_id = (
        SELECT entity_id
        FROM sales_order
        WHERE increment_id = @orderId
    ) 
)
AND attribute_id IN (
    SELECT attribute_id
    FROM eav_attribute
    WHERE attribute_code LIKE 'cc_%'
);

-- erase credit card data by cc owner
SET @ccOwner = 'Mr. Smith';
SET @entityId = (select entity_id from sales_order_entity_varchar where value = @ccOwner);

update sales_order_entity_varchar
set value = null
where entity_id = @entityId
and attribute_id in (
    SELECT attribute_id
    FROM eav_attribute
    WHERE attribute_code LIKE 'cc_%'
);

-- get attribute ids
SELECT attribute_id
FROM eav_attribute
where attribute_code in ('cc_number_enc', 'cc_last4', 'cc_owner', 'cc_exp_month', 'cc_exp_year', 'cc_type');

-- script to autocheck saved cc data
http://www.panticz.de/sites/default/files/magento/creditcard/checkSavedCcData.sh

#!/bin/bash

DB_USER=YOUR_USER
DB_PASS=YOUR_PASS
DB_NAME=YOUR_DB
MAIL_TO=YOUR_EMAIL

# search for saved cc customer
echo 'SELECT VALUE FROM sales_order_entity_varchar WHERE attribute_id = 282 AND entity_id IN (SELECT entity_id FROM sales_order_entity_varchar WHERE attribute_id = 280 AND VALUE != "")' | mysql -u ${DB_USER} -p${DB_PASS} ${DB_NAME} > /tmp/cc.log

# notify 
if [ $(cat /tmp/cc.log | wc -l) -gt 1 ]; then
    echo 'Subject: Please delete CC data' | cat - /tmp/cc.log | sendmail ${MAIL_TO}
fi

# clean up
rm /tmp/cc.log
Profiles GitHub StackOverflow LinkedIn Xing
Contact Imprint
© panticz 2026

Cookie-Einstellungen

Diese Website nutzt eingebettete Inhalte von Drittanbietern (z.B. YouTube, SoundCloud). Beim Laden dieser Inhalte werden Daten an die jeweiligen Anbieter übermittelt. Datenverarbeitungserklärung