Skip to content

Instantly share code, notes, and snippets.

View ayxos's full-sized avatar
🎯
Focusing

marco ayxos

🎯
Focusing
View GitHub Profile
@ayxos
ayxos / Docker.md
Created May 14, 2020 08:44
Docker useful commands
@ayxos
ayxos / Nginx.sh
Last active March 18, 2021 18:58
Random Dev useful commands
#!/bin/sh
ssh [email protected] -t bash -ci "logs" >> report.log
# Remove duplicated lines
sort report.log | uniq > report_temp.log
# replace new items
mv -f report_temp.log report.log
# generating reports
@ayxos
ayxos / scanner.sh
Created April 24, 2020 19:41
Scanner
git clone https://github.com/sbs20/scanservjs
sudo apt install -y nodejs
sudo apt-get install npm sane-utils imagemagick`
npm install
npm install -g gulp-cli
gulp
cd ./build/scanservjs
node /server.js
@ayxos
ayxos / gist:b672e58852780f098912fdbfe0694b3e
Created April 24, 2020 17:18
Installing HPLIP for CUPS on a Raspberry Pi
If you have a HP printer or scanner and you want to be able to use it on your Raspberryi Pi running the Raspbian operating system, you`ll have to install HP Linux Imaging and Printing and CUPS.
In the terminal run the following commands:
sudo su
apt-get update
apt-get install hplip cups
usermod -a -G lpadmin pi
In a browser, on the raspberry pi you can now access the CUPS configuration screen at http://127.0.0.1:631/
@ayxos
ayxos / README.md
Created April 16, 2020 09:14
Certbot process

Setting up new endpoints

  • go to "/etc/nginx/sites-available"
  • create a new file (with sudo)
  • copy this
server {
    server_name SUBDOMAIN_URL;
@ayxos
ayxos / docker-compose.yml
Created April 16, 2020 09:12
React Nginx Docker
version: '3'
services:
nginx:
image: nginx:alpine
ports:
- "4040:80"
volumes:
- ./nginx.conf:/etc/nginx/nginx.conf
- ./dist:/usr/share/nginx/html
Paste this in the console
document.cookie="VISITOR_INFO1_LIVE=oKckVSqvaGw; path=/; domain=.youtube.com";window.location.reload();
@ayxos
ayxos / js
Created November 26, 2019 15:48
Object Diff JS
/* !
* Find the differences between two objects and push to a new object
* @param {Object} obj1 The original object
* @param {Object} obj2 The object to compare against it
* @return {Object} An object of differences between the two
*/
export const getDiff = (obj1, obj2) => {
// Make sure an object to compare is provided
if (!obj2 || Object.prototype.toString.call(obj2) !== '[object Object]') {
return obj1;
@ayxos
ayxos / gist:0a1639ce31f307a76a4a3bbc3f653961
Last active November 14, 2019 13:53
nginx node proxy
server {
server_name test.com;
gzip on;
gzip_types application/javascript image/* text/css;
gunzip on;
location / {
proxy_pass http://127.0.0.1:8000;
proxy_set_header Host $host;
@ayxos
ayxos / gist:1f62c4e4d528890842f5a152d74ddab5
Last active December 18, 2018 13:00
Docker images for Rpi
# RPI monitor
docker run --device=/dev/vchiq \
--device=/dev/vcsm \
--volume=/opt/vc:/opt/vc \
--volume=/boot:/boot \
--volume=/sys:/dockerhost/sys:ro \
--volume=/etc:/dockerhost/etc:ro \
--volume=/proc:/dockerhost/proc:ro \
--volume=/usr/lib:/dockerhost/usr/lib:ro \
-p=8888:8888 \