Skip to content

Instantly share code, notes, and snippets.

@CyberSecutor
CyberSecutor / usefull-bash-scripts.md
Last active July 17, 2024 14:48
Usefull bash scripts/commands

This file has some usefull commands in bash that I may need again.

Download all images from a list and put them in a directory structure following the URL path:

$ for i in `cat ~/imageList-karrepad.txt`; do echo $i | perl -e 'while (<>) {chomp $_; $url = $_; $path = $url; $path =~ s/.*\:\/\/(.*)\?.*/$1/g; system ("mkdir -p `dirname $path` 2> /dev/null") == 0 or die "failed to create $path. exiting...\n"; print "$url -O $path\n"; }' | xargs wget; done
@CyberSecutor
CyberSecutor / magento2-sales-order-statistics.sql
Last active July 2, 2024 15:38
magento2-sales-order-statistics
-- Sets the timezone for the current session.
SET time_zone = '+02:00';
-- Orders Per Year --
SELECT period_date as year, order_count, gross_revenue, ROUND(gross_revenue / order_count, 2) AS gross_aov
FROM (
SELECT
COUNT(*) AS order_count,
ROUND(SUM(base_grand_total), 2) AS gross_revenue,
DATE_FORMAT(o.created_at, '%Y') AS period_date
@CyberSecutor
CyberSecutor / magento2-clear.sql
Last active October 6, 2021 12:39 — forked from sergiojovanig/magento2-clear.sql
Magento 2 Clear Database
use magento;
##########################################################
# PRODUCTS
##########################################################
DELETE FROM `catalog_product_bundle_option`;
DELETE FROM `catalog_product_bundle_option_value`;
DELETE FROM `catalog_product_bundle_selection`;
DELETE FROM `catalog_product_entity_datetime`;
DELETE FROM `catalog_product_entity_decimal`;
<?php
class Engine
{
private $pk;
public function __construct(int $pk)
{
$this->pk = $pk;
}

Keybase proof

I hereby claim:

  • I am CyberSecutor on github.
  • I am cybersecutor (https://keybase.io/cybersecutor) on keybase.
  • I have a public key whose fingerprint is A840 EE0A 9641 8244 8D07 6127 AF2C 3985 5EAF 7336

To claim this, I am signing this object: