A Complete Guide on How To Use Bash Arrays
▻https://www.shell-tips.com/bash/arrays
A Complete Guide on How To Use Bash Arrays
▻https://www.shell-tips.com/bash/arrays
Sed par l’exemple : devenez expert de la commande Linux sed – Buzut
▻https://buzut.net/apprendre-commande-sed-linux
utiliser la commande sed : des exemples concrets expliqués.
Voir aussi :
– mémo rapide de toutes les astuces d’écritures de sed : ▻https://www.commentcamarche.net/faq/6699-sed-trucs-et-astuces
– le fonctionnement détaillé de sed et en particlier de toutes les commandes : ▻https://www.commentcamarche.net/faq/9536-sed-introduction-a-sed-part-i
TabFS
▻https://omar.website/tabfs
TabFS is a browser extension that mounts your browser tabs as a filesystem on your computer.
[...]
Each of your open tabs is mapped to a folder.
The files inside a tab’s folder directly reflect (and can control) the state of that tab in your browser.
Example: the url.txt, text.txt, and title.txt files inside a tab’s folder, which tell me those live properties for that tab
This gives you a ton of power, because now you can apply all the existing tools on your computer that already know how to deal with files — terminal commands, scripting languages, point-and-click explorers, etc — and use them to control and communicate with your browser.
Now you don’t need to code up a browser extension from scratch every time you want to do anything. You can write a script that talks to your browser in, like, a melange of Python and bash, and you can save it as a single ordinary file that you can run whenever, and it’s no different from scripting any other part of your computer.
Démarrer rapidement et facilement un projet avec un script
Et si vous aviez un #script pour faire le boulot ? Un script qui pourrait vous générer un projet prêt à démarrer, et ce en quelques instants, avec uniquement des interventions de votre part au début pour répondre à des questions basiques ?
▻https://darklg.me/demarrer-rapidement-et-facilement-un-projet-avec-un-script
Mes 1ers tests par ici avec mon boilerplate #SPIP : ▻https://gitlab.com/jmoupah/zcm-installer
Couplé à #SPIP-CLI / #Checkout, ça commence à causer :)
SPIP-CLI : ►https://contrib.spip.net/SPIP-Cli
Checkout : ▻https://git.spip.net/spip-contrib-outils/checkout
#git #developpement #bash #outil
c’est en gros ce que fait l’installeur de IntéGraal qui est uniquement en spip-cli :
▻https://git.spip.net/spip-contrib-outils/spip-cli/src/branch/master/src/Command/IntegraalGenerer.php
Sachant qu’en spip-cli, enfin avec le module Console de Sf quoi, une fois qu’on a fait des commandes unitaires pour ci ou ça, on peut aussi faire des commandes qui appelle d’autres commandes.
Moi je fais donc tout en PHP/spip-cli/Console, vu que c’est bien plus simple à coder, propre, beau avec des couleurs, tableaux, barre de défilement, etc, sans avoir à coder en Bash.
Pour spip-cli, par contre, hors commandes de base, ça va chercher que les commandes qui sont dans des plugins activés, d’où le fait que pour l’instant celle pour IntéGraal est dans le socle commun, sinon on peut pas l’utiliser.
Ce qu’on pourrait imaginer c’est que spip-cli cherche aussi au moins les commandes placées dans un dossier « spip-cli » à la racine du dossier où on le lance et/ou à la racine du spip (pas juste les plugins activés).
Pour l’instant, mes besoins sont rudimentaires, donc bash me va bien :)
Ce que ça fait :
– crée la base mySQL pour installer SPIP via spip-cli
– crée les dossiers plugins et auto (désactivable)
– clone ZCM
– édite paquet.xml avec le préfixe du plugin
– renomme les fichiers options/fonctions/zcm-xx.svg avec le préfixe du plugin
– commit le tout dans un repo du nom du préfixe préalablement créé (désactivable)
Et donc les commandes :
– télécharger SPIP spip dl --branche master
– initialiser ZCM Intaller zcminstaller
(créer à minima la base de données)
– installer SPIP spip core:installer --db-server "mysql" --db-login "login" --db-pass "motdepasse" --db-database "nomdelabase" --admin-nom "nom" --admin-login "login" --admin-email "mail@domaine.net" --admin-pass "motdepasse"
– ajouter le dépôt des plugins spip plugins:svp:depoter https://plugins.spip.net/depots/principal.xml
La seule chose que je n’arrive pas à faire via SPIP Cli, c’est installer mon plugin car ça ne gère pas les dépendances (téléchargement et installation). Ou alors, je rate une commande ?
WebSVN – Zone – Révision 118024 – /outils/checkout.php
▻https://websvn.spip.net/filedetails.php?repname=Zone&path=%2F_outils_%2Fcheckout.php
Script d’installation ou mise à jour d’un SPIP en ligne de commande qui permet de faire des checkout/up indifféremment en git/svn/ftp, + une méthode « spip » .
La commande :checkout.php spip
permet de récupérer un SPIP et ses externals en git
Pour les dev, on peut spécifier qu’on veut cloner en git (pour pouvoir pusher dessus ensuite) :checkout.php spip git@git.spip.net
On peut checkout une branche de SPIP autre que master :checkout.php spip -bspip3.2
Et pour faire la mise à jour (stash/pull —rebase/stash) sur tous les repos, il suffit de relancer la commande
Le repo original : ▻https://git.nursit.net/snippets/15
ajout du fichier nécessaire à l’utilisation sous #Windows :
– necessite le fichier checkout.bat dans le même dossier que checkout.php
– déclarer ce dossier dans le PATH de la machine
– à partir de là on peut utiliser la commande : checkout ...
dans n’importe quel dossier exemple : checkout spip -bmaster mon_dossier
▻https://websvn.spip.net/revision.php?repname=Zone&path=%2F&rev=118296&peg=118296
Je viens de tester et, après ajout dans le PATH, j’ai un message d’erreur sur la commande checkout spip -bmaster test :
’php’ n’est pas reconnu en tant que commande interne
ou externe, un programme exécutable ou un fichier de commandes.
Je rate quoi ?
il te faut une installation de PHP opérationnelle (WAMP, Laragon...) et mettre le chemin de php.exe dans le PATH de ta machine
Oui, c’est ce que j’ai fait, enfin je crois.
Que je fasse checkout spip -bmaster ../testgit/
ou checkout.bat spip -bmaster ../testgit/
, j’ai une erreur :
Pourtant, j’ai bien mes 2 dossiers (checkout + PHP) dans le PATH de windows :
checkout.php dans spip-zone/outils. – SPIP-ZONE
https://zone.spip.net/trac/spip-zone/browser/spip-zone/_outils_/checkout.php?rev=118024
Un script de checkout multifonction, documente, qui permet de checkout SPIP (core+externals) en prime
How to Start your own #bitcoin #exchange Business with Money-Spinning Strategies?
▻https://hackernoon.com/how-to-start-your-own-bitcoin-exchange-business-with-money-spinning-stra
Cryptocurrencies have been the hot talk of the town. Blockchain has been certainly the most crucial technology for the trader’s out there. Popular cryptocurrencies such as Bitcoins, Altcoins are experiencing great emendations to keep ahead of the competition.So if you are an investor who is ready to kick-start the Bitcoin Exchange Business, the next 7 minutes will give you a complete guide on them!How much does a website cost per month?If your query is to start your own website, then it can also be certainly done! Before we discuss the cost for the website, let us primarily know the steps involved to start a Bitcoin Exchange website!There are totally ten steps which will ensure a high-quality business! If your query is How much does it cost to develop a Bitcoin Exchange website, you will (...)
How to quickly get the dates for the first 10 Mondays using #ruby
▻https://hackernoon.com/how-to-quickly-get-the-dates-for-the-first-10-mondays-using-ruby-ce90669
If you are sometimes feeling bored and want to entertain yourself, then rather than aimlessly scrolling in a social media, you can try to learn something new. For example, you can learn something that you have not known that you can do with Ruby: Getting the dates for next Mondays, Tuesdays or any other day of the week.Here is how you do it:▻https://medium.com/media/9302ec923c0527390247b753e813cfd0/hrefAfter you execute it, you will see the list of the dates:We can replace the part monday with any other name of the days of the week in English and it will work fine.I know that this may look like something that may not be that much benefit, but maybe, you could use it in a personal #script that you have. In a better case, I hope this inspires you to explore more in the documentation of a (...)
#python Generators Explained ! (Sort of)
▻https://hackernoon.com/python-generators-35ac68334882?source=rss----3a8144eabfe3---4
Learn python generators by example.GENERATORSAs IteratorsUsing generators (generator functions)>>> def integers(): i = 1 while True: yield i i = i + 1>>> a = integers()>>> next(a)1>>> next(a)2>>> next(a)3>>> next(a)4>>> next(a)5>>>Assigning a #generator to a varialble will automatically create ._next_() or next(generator) methodThis will allow you to iterate through the generator valuesConverting to list>>> def yrange(n): i = 0 while i < n: yield i i += 1>>> y = yrange(5)>>> list(y)[0, 1, 2, 3, 4]>>> list(y)[]You can convert a generator to a list however on the process it will lose its value and transfer it to the list.>> y = (...)
La commande sed - ▻https://www.commentcamarche.com/faq/9536-sed-introduction-a-sed-part-i
Les bases de sed.
Voir aussi :
– ▻http://anaturb.net/sed.htm comme aide-mémoire
– ►https://www.grymoire.com/Unix/Sed.html : ultra-complet pour le détail des options, commandes et flags
Guide avancé d’écriture des scripts Bash
▻https://abs.traduc.org/abs-fr
Guide avancé d’écriture des scripts Bash : Une exploration en profondeur de l’art de la programmation shell
avec (entre autre) plein d’exemples d’utilitaires et d’astuces
Poor coding limits IS hackers’ cyber-capabilities
▻http://www.bbc.com/news/technology-41385619
All the tools had problems, he said.
. the group’s malware was full of basic bugs
. a secure email system it developed leaked information about users
. the UCC’s web attack tool failed to take down any significant target
In addition, attempts to raise cash via donations of bitcoins have been diluted by fraudsters cashing in on the IS name and producing websites mimicking the appeals for funds.
Four Lions was a documentary.
#hacking #scriptKiddies #amateurHour
via ▻https://crypto.quebec/les-chiens-de-garde-66-les-dangers-de-la-consultation-psychologique-en-li
How to defend your website with ZIP bombs
▻https://blog.haschek.at/post/f2fda
So it turns out #ZIP compression is really good with repetitive data so if you have a really huge text file which consists of repetitive data like all zeroes, it will compress it really good. Like REALLY good.
As 42.zip shows us it can compress a 4.5 peta byte (4.500.000 giga bytes) file down to 42 kilo bytes. When you try to actually look at the content (extract or decompress it) then you’ll most likely run out of disk space or RAM.
Sadly, web browsers don’t understand ZIP, but they do understand GZIP.
So firstly we’ll have to create the 10 giga byte GZIP file filled with zeroes. We could make multiple compressions but let’s keep it simple for now.
Getting Started with Headless Chrome
▻https://developers.google.com/web/updates/2017/04/headless-chrome
#Chrome #Chromium #script #screenshots
Using headless Chrome as an automated screenshot tool
▻https://medium.com/@dschnr/using-headless-chrome-as-an-automated-screenshot-tool-4b07dffba79a
Documentation generator for shell scripts (bash, sh, zsh) ▻https://github.com/reconquest/shdoc
Shell Scripts Matter
▻https://dev.to/thiht/shell-scripts-matter
The weird thing about #shell #scripts is that even strong advocates of good practices gladly forget all they know when it comes to shell scripting.
(bon le titre est un peu idiot mais bonnes pratiques pour qui prend au sérieux le développement des scripts) #bash #programmer
Combien coûte un service tiers gratuit ? | BrainCracking - HTML5, Performances Web et les technos du Web, par Jean-pierre VINCENT
►http://braincracking.org/2016/12/21/combien-coute-un-service-tiers-gratuit
Analyse détaillée des pertes de performances (et parfois d’audience) liées à l’intégration de scripts tiers dans les pages web d’un site (Analytics, tracking, boutons de partage, réseaux sociaux, Tests A/B, widgets divers : cartes, commentaires, chats…).
Propose des outils et méthodes pour minimiser leur impact.
La carte des chaînes d’appels de prestataires externes du site du Monde est édifiante... :
Je vais utiliser l’outil #RequestMap pour visualiser un affichage sur la Une du journal #Le_Monde. [... Les] (cercles) appartiennent aux tiers de 1er niveau et correspondent à une quinzaine de sociétés. On y trouve 3 solutions d’analytics, une solution de test A/B (Kameleoon), un tracking de réseau social (Po.st), FaceBook, un moteur de recommandation d’articles (Outbrain ici), Cedexis … [...] Puis arrive le moment où l’on contacte la régie pub (SmartAd en l’occurrence, à droite sur le graphe précédent, à gauche sur le graphe suivant).
Une fois sur son domaine, la régie appelle une dizaine de sociétés, principalement des tags de tracking, puis 2 systèmes de mise aux enchères de mon profil utilisateur. C’est la société de RTB CasaleMedia qui prend le relai, et qui contacte une vingtaine d’autres sociétés. Cela c’est côté client, on ne sait pas combien d’enchérisseur ont accès au profil utilisateur côté serveur. L’enchère a été gagnée par une société de retargeting (Turn) qui elle-même contacte une vingtaine de sociétés.
En tout c’est 50 sociétés qui ont été contactées côté client. Si le script du 1er tiers inclus de manière classique, ces 50 sociétés avec qui vous n’avez aucun contrat ont tout pouvoir sur la page.
#PowerShell : désactiver les clés #USB des machines d’un domaine
▻http://www.dsfc.net/developpement/scripting/powershell-desactiver-cles-usb-machines-domaine
PowerShell vous permet très facilement d’agir à distance sur l’ensemble des ordinateurs de votre parc.
#Scripting #Active_Directory #Base_de_registre #Formateur_Powershell #USBStor
#PowerShell sur Linux : un branlage de dindons signé Microsoft !
▻http://www.dsfc.net/developpement/scripting/powershell-linux-branlage-dindons-microsoft
Combien d’ingénieurs au juste travaillent réellement sur le portage du PowerShell et accessoirement du framework .Net sur Linux ?
Une histoire de pdf - Le Blog de Cyrille BORNE
▻https://cyrille-borne.com/article2178/une-histoire-de-pdf
Pour #réduire_la_taille_d_un_fichier_pdf, une ligne de commande :
gs -q -dSAFER -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -dPDFSETTINGS=/paramètre -sOUTPUTFILE=output.pdf -f input.pdf
Le paramètre qui va bien va dans l’ordre de compression de la qualité la plus pourrie à la meilleure : screen, #ebook, printer.
Compiler le #PowerShell
▻http://www.dsfc.net/developpement/scripting/compiler-le-powershell
En fait, il s’agit plutôt de traduire le code du script PowerShell en Bytecode.
Le #PowerShell n’est pas fait pour ça !
▻http://www.dsfc.net/developpement/scripting/le-powershell-n-est-pas-fait-pour-ca
Il n’y a pas besoin d’être énarque pour transformer faire pousser de la laitue dans le Sahara !
#Scripting #Formateur_Powershell #Formation_PowerShell #WPF #XAML
#libreoffice Headless with #systemd
▻https://etienne.depar.is/a-ecrit/post/2016/03/23/LibreOffice-Headless-with-systemd
I’ve fought a very annoying bug recently and think it’s worth sharing it here. At work we manage different type of user provided documents. For various reason we convert it to pdf. This step is achieved using a headless libreoffice installation. Our server run Debian GNU/Linux Wheezy and everything go smoothly. Until... one of our client need our software to be hosted on his own servers, running CentOS. Nothing bad here, but it leads us to develop various systemd service files for our systems as recent versions of CentOS switched to systemd. Here come the bug. We were used to run libreoffice as follow, embed in an init.d #script: 1: soffice -headless -accept="socket,host=127.0.0.1,port=8101;urp;" -display :5.0 -nofirststartwizard & > /var/log/soffice.log 2>&1 Moving on systemd (...)
Analyse des mails de rapport DMARC
▻https://etienne.depar.is/a-ecrit/post/2016/04/04/Analyse-des-mails-de-rapport-DMARC
Dans le cadre de la mise en place de DMARC sur un serveur mail donné, les prestataires externes s’appuyant sur la vérification des champs DMARC pour filtrer les emails entrant sont tenus de vous envoyer un #email récapitulatif des actions entreprises chaque jour où ils ont reçu des mails du serveur en question à minuit. J’ai découvert un petit #script permettant de vérifier l’état de ces remontées d’information. Installation Ce script requiert #offlineimap (dispo en paquet debian ou AUR) mpack (idem) ce script go
#configuration Utiliser la configuration suivante pour offlineimap (ça va récupérer tous les mails de la boîte observée, mais on s’occupera de fine-tuner ça plus tard). 1 : $ cat ~/.offlineimaprc 2 : [Account MonCompte] 3 : localrepository = Local_MonCompte 4 : remoterepository = MonCompte 5 : (...)