Monday, 29 November 2021

composer and docker docker-compose

 

composer:
image: composer:latest
container_name: fantise_composer
volumes:
- ./src:/var/www/html
working_dir: /var/www/html
depends_on:
- php
networks:
- fantise

npm:
image: node:13.7
container_name: fantise_npm
volumes:
- ./src:/var/www/html
working_dir: /var/www/html
entrypoint: ['npm']
site:
image: library/nginx:stable
container_name: fantise_nginx
ports:
- "61141:80"
volumes:
- ./src:/var/www/html
- ./nginx/default.conf:/etc/nginx/conf.d/default.conf
- ./nginx/nginx.conf:/etc/nginx/nginx.conf
depends_on:
- php
- mysql
 
server {
listen 80;
index index.php index.html;
server_name localhost;
error_log /var/log/nginx/error.log;
access_log /var/log/nginx/access.log;
root /var/www/html/public;
client_max_body_size 0;
location / {
try_files $uri $uri/ /index.php?$query_string;

}

location ~ \.php$ {

try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass fantise_php:9000;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_path_info;

}
}

Friday, 26 November 2021

List of cool linux things

 cli

btop

Resource monitor that shows usage and stats for processor, memory, disks, network and processes.

https://github.com/aristocratos/btop
Screenshot 1
ranger 

ranger is a console file manager with VI key bindings. It provides a minimalistic and nice curses interface with a view on the directory hierarchy. It ships with rifle, a file launcher that is good at automatically finding out which program to use for what file type.

 https://github.com/ranger/rangerhttps://raw.githubusercontent.com/ranger/ranger-assets/master/screenshots/twopane.png


trash cli

trash-cli trashes files recording the original path, deletion date, and permissions. It uses the same trashcan used by KDE, GNOME, and XFCE, but you can invoke it from the command line (and scripts).



https://github.com/andreafrancia/trash-cli

ncdu

sudo apt-get install ncdu
 
ncdu - Wikipedia

 speedtest-cli

 https://github.com/sivel/speedtest-cli

 

Command line interface for testing internet bandwidth using speedtest.net

cheat.sh

 

 gooey

Joplin

 

https://joplinapp.org/

 Ulauncher

BitWarden

 

https://bitwarden.com/download/ 

MailSpring

https://getmailspring.com/

Stacer

https://oguzhaninan.github.io/Stacer-Web/

Thursday, 20 April 2017

How to calculate if table rows are inserted consecutively in MySQL



As a Developer, I'm often working with asynchronous code, code that isn't well  synchronous be that with workers or events, sometimes this means the created time is out of order and to report on it we need to validate the created date time.

SELECT @a := 0;
SELECT invid, `date`, `date` - @a AS gap, @a := `date`
FROM INVOICES AS i
HAVING gap < 0

Monday, 20 March 2017

Linux Clipboard Text To Speech

Install festival and esound-clients.

To do so, follow this tutorial: https://help.ubuntu.com/community/TextToSpeech

Install xsel:

sudo apt-get install xsel

Create new file in your home folder, call it "clipboardtospeech.sh" or something.

nano ~/apps/clipboardtospeech.sh

edit it and paste the following line:

xsel --clipboard | festival --tts

Make the script executable

cmod +x ~/apps/clipboardtospeech.sh

Make the file executable make a hotkey that launches the shell script:

~/apps/clipboardtospeech.sh 

Rsync over proxy gcloud / jumpbox

So I needed to pushdown some log files off of a box without a public IP, rather then rsync to the jump box / proxy then  rsync to my local box i made use of the ssh proxy command.

 rsync -avz -e 'ssh -o ProxyCommand="ssh proxxye.url.com -i ~/.ssh/google_compute_engine -W my-internal-ip.internal:22"' my-internal-ip.internal:/var/www/log/workers ~/code/logs/

Wednesday, 27 April 2016

Cross Brouser Support For onPaste clipboardData


Some of the current browsers support a 'clipboardData' property as part of a paste event. This should allow you to query the different data formats created from the current data on the clipboard.

Safari and Chrome have the best support, but it is still incomplete. Firefox has no support if you discount using the XPCOM objects interface. The IE interface is older and only supports Text or URL data.


Firefox, Safari IE and Chrome all sanitize any HTML being pasted. Opera will only paste plain text so HTML sanitation is not an issue. Some earlier version of IE could cause some security issues as they copy hyper-links in full.

Try copying and pasting this paragraph and link into the box below.

Tuesday, 12 April 2016

Cold Fusion debuging with fiddler proxy [CFML]

Not a clue why i'm doing Cold Fusion today but I am and I needed to debug some shitty API

<cfhttp method="post" proxyport="8888" proxyserver="127.0.0.1" result="resultHttp" throwonerror="false" url="#apiURL#">
            <cfhttpparam name="requestData" type="formfield" value="#requestData#"></cfhttpparam>
    </cfhttp>