Main Page

From Vladimir Mitrofanov personal wiki
Revision as of 02:15, 1 October 2021 by Shirker (talk | contribs)
Jump to navigation Jump to search

Windows and HyperV

Download from CMD

cURL Windows 10 includes curl.exe:

so you can do something like this:

# example 1
curl.exe --output index.html --url https://superuser.com
# example 2
curl.exe -o index.html https://superuser.com


PowerShell

# example 1
Invoke-WebRequest -OutFile index.html -Uri https://superuser.com
# example 2
iwr -outf index.html https://superuser.com

Opening ports

netsh firewall set portopening ALL 137 “Hyper-V Management”

Another way to open port

New-NetFirewallRule -DisplayName 'My port' -Profile 'Private' -Direction Inbound -Action Allow -Protocol TCP -LocalPort 6624

All ports required for Hyperv: https://www.altaro.com/hyper-v/network-ports-related-hyper-v/


update GPO:

  gpupdate /force


Back-end/Frontend stuff


Git

stop asking for password:

> git config credential.helper store

Delete all local branches except master and dev

> git branch | grep -vE "(master|dev)" | xargs git branch -D

Laravel PHP

User Auth

How to test SMTP from command line:

php artisan tinker

Then run the command (specify your own email):

>>>> Mail::send('errors.404',[], function($message) { $message->to('shir****@gmail.com')->subject('testing email'); });


MongoDB tricks

Database

MongoDB

BACKUP

xBackup is example of backup directory

> mongodump --db <USER>  --out ./xBackup/ --username tws --password "<PASSWD>"

RESTORE

> mongorestore  --username <USER> --password "<PASSWD>" --authenticationDatabase <AUTH DB>  ./xBackup/

Mysql

Create database and assign user to it

> CREATE DATABASE unoduos;
> CREATE USER 'unoduos'@'localhost' IDENTIFIED BY 'password';
> GRANT ALL PRIVILEGES ON unoduos. * TO 'unoduos'@'localhost';
> FLUSH PRIVILEGES;

Web Design

Carousel

Server configuration

No password ssh

ssh-keygen -t rsa
ssh-copy-id -i ~/.ssh/id_rsa.pub root@joyscoot.com -p 2223

Create unix user

read more

Home dir
<home dir> <username>

> useradd -m -d /opt/username username

Specific ID
<uid> <username>

> useradd -u 1500 username

Specific group
<groupname> <username>

> useradd -g users username

More groups

useradd -g users -G wheel,developers username

Example of creatin' a user with expiration date

> useradd -m -d /var/www/website.com eagroup -G nginx -c "Temporary developer account" -e 2019-11-22 -s /bin/bash

Mobile Development

Developer tricks, IDE, configuration, etc

Games development, Modding

Fallout 3+ Modding