echo "options lpfc lpfc_nodev_tmo=10 lpfc_lun_queue_depth=32 lpfc_max_luns=2048" > /etc/modprobe.d/lpfc.conf
dracut -f
reboot
Author: rdircio
MacPorts clean port, because of checksum failure
I had some issues with checksums failing after a port downloading, so you can clean the port this way:
$ sudo port selfupdate $ sudo port clean --dist <portname> $ sudo port install <portname>
If you suspect you have packages with linking errors:
$ sudo port rev-upgrade
$ sudo port selfupdate
$ sudo port upgrade outdated
Solaris 11 sendmail relay config
cd /etc/mail/cf/cf
vi sendmail.mc (add SMARTHOST)
define(‘SMART_HOST’.’the smart host fqdn’)
/usr/ccs/bin/m4 ../m4/cf.m4 sendmail.mc > sendmail.cf
mv /etc/mail/sendmail.cf /etc/mail/sendmail.cf_ORIG
cp /etc/mail/cf/cf/sendmail.cf /etc/mail/sendmail.cf
svcadm restart smtp:sendmail
Mysql trigger
If you want to trigger an action to another table you can create a trigger:
CREATE TRIGGER `update_menus` AFTER INSERT ON `usuarios` FOR EACH ROW insert into sys_user_roles set sys_roles_id=(select sys_roles_id from sys_roles where roles_name=NEW.tipo),user_id=NEW.user_id
CREATE TRIGGER `update_totals_after_delete` AFTER DELETE ON `pedidos_detalle`
FOR EACH ROW
update pedidos set subtotal = (select sum(importe) from pedidos_detalle where folio=OLD.folio)
where folio=OLD.folio
CREATE TRIGGER `update_totals_after_insert` AFTER INSERT ON `pedidos_detalle`
FOR EACH ROW
update pedidos set subtotal = (select sum(importe) from pedidos_detalle where folio=NEW.folio)
where folio=NEW.folio
mysql generated columns (same table)
This is to add a column in a table with calculated values from the same table.
ALTER TABLE pedidos add column impuesto float generated always as (subtotal*.16) VIRTUAL;
ALTER TABLE pedidos add column total float generated always as (subtotal*1.16) VIRTUAL;
ALTER TABLE pedidos add column flete float generated always as (case when total < 6000 then 1000 else 0 end) virtual
mysql add foreign key for delete cascade
This one adds a constraint to the orderdetails table such as if the order is deleted, its details get deleted too
ALTER TABLE pedidos_detalle add constraint foreign key(folio) references pedidos(folio) on delete cascade
OCR PDF
Extract text from pdf and produce new pdf with embedded text
ocrmypdf –force-ocr -l spa -v 2 U-III\ HIST-\ DER-\ 2022.pdf output.pdf
Print all variables in a session in PHP
echo '<pre>';
print_r($_SESSION);
echo '</pre>';
Xcrud session variables
[loggedin] => 1 [username] => rdircio [email] => rdircio@gmail.com [firstname] => Roberto [lastname] => Dircio [user_id] => 29 [role] => 68 [default_level1_name] => Salir
Label a table in xcrud
$user->table_name(‘Usuarios’);