Difference between revisions of "Main Page"

From Vladimir Mitrofanov personal wiki
Jump to navigation Jump to search
 
(39 intermediate revisions by the same user not shown)
Line 1: Line 1:
−
=Back-end/Frontend stuff=
+
= Windows and HyperV =
 +
===HyperV remote management===
 +
https://timothygruber.com/hyper-v-2/remotely-managing-hyper-v-server-in-a-workgroup-or-non-domain/
 +
 
 +
===Download from CMD===
 +
cURL
 +
Windows 10 includes curl.exe:
 +
 
 +
so you can do something like this:
 +
<pre>
 +
# example 1
 +
curl.exe --output index.html --url https://superuser.com
 +
# example 2
 +
curl.exe -o index.html https://superuser.com
 +
</pre>
 +
 
 +
 
 +
PowerShell
 +
<pre>
 +
# example 1
 +
Invoke-WebRequest -OutFile index.html -Uri https://superuser.com
 +
# example 2
 +
iwr -outf index.html https://superuser.com
 +
</pre>
 +
===Opening ports===
 +
<pre>
 +
netsh firewall set portopening ALL 137 “Hyper-V Management”
 +
</pre>
 +
Another way to open port
 +
<pre>
 +
New-NetFirewallRule -DisplayName 'My port' -Profile 'Private' -Direction Inbound -Action Allow -Protocol TCP -LocalPort 6624
 +
</pre>
 +
 
 +
All ports required for Hyperv(all need to be opened in order to connect via internet):
 +
https://www.altaro.com/hyper-v/network-ports-related-hyper-v/
 +
 
 +
 
 +
update GPO:
 +
<pre>
 +
  gpupdate /force
 +
</pre>
 +
 
 +
=<span style="color: #0000ff">Back-end/Frontend stuff</span>=
 +
*[https://github.com/fawick/speedtest-resize Is Go faster than ImageMagic?] Resizing images benchmark
 +
*[https://regex101.com/ Regex online testing]
 +
 
 +
 
 +
==Git==
 +
stop asking for password:
 +
<pre>> git config credential.helper store</pre>
 +
 
 +
Delete all local branches except <strong>master</strong> and <strong>dev</strong>
 +
<pre>> git branch | grep -vE "(master|dev)" | xargs git branch -D</pre>
  
 
==Laravel PHP==
 
==Laravel PHP==
−
 
+
===User Auth===
 
*[[Create User using artisan tinker]]
 
*[[Create User using artisan tinker]]
  
 +
===How to test SMTP from command line:===
 +
<pre>php artisan tinker</pre>
  
 +
Then run the command (specify your own email):
 +
<pre>>>>> Mail::send('errors.404',[], function($message) { $message->to('shir****@gmail.com')->subject('testing email'); });</pre>
  
  
 
===MongoDB tricks===
 
===MongoDB tricks===
 
*[[Creating User model to work with MongoDB]]
 
*[[Creating User model to work with MongoDB]]
 +
*[https://github.com/jenssegers/laravel-mongodb Mongo DB extension for Laravel]
 +
 +
=<span style="color: #0000ff">Database</span>=
 +
 +
==MongoDB==
 +
 +
=== BACKUP ===
 +
 +
xBackup is example of backup directory
 +
<pre>
 +
> mongodump --db <USER>  --out ./xBackup/ --username tws --password "<PASSWD>"
 +
</pre>
  
 +
=== RESTORE ===
 +
<pre>
 +
> mongorestore  --username <USER> --password "<PASSWD>" --authenticationDatabase <AUTH DB>  ./xBackup/
 +
</pre>
  
−
=Database=
+
==Mysql==
 +
Create database and assign user to it
  
−
==MongoDB==
+
<pre>
 +
> CREATE DATABASE unoduos;
 +
> CREATE USER 'unoduos'@'localhost' IDENTIFIED BY 'password';
 +
> GRANT ALL PRIVILEGES ON unoduos. * TO 'unoduos'@'localhost';
 +
> FLUSH PRIVILEGES;
 +
</pre>
 +
 
 +
=<span style="color: #0000ff">Web Design</span>=
 +
 
 +
*[https://demos.creative-tim.com/material-bootstrap-wizard/wizard-build-profile.html Nice User registration form example]
 +
 
 +
*[https://css2sass.herokuapp.com/ CSS to SCSS convertor]
 +
 
 +
*[https://codeburst.io/how-to-create-horizontal-scrolling-containers-d8069651e9c6 How To Create Horizontal Scrolling Containers] A good working solution with FLEX. I do believe doesn't work in IE, BUT the good thing there is no mobile IE in mobile phones!
 +
 
 +
*[https://codepen.io/viktorstrate/pen/yoBRLy CSS skeleton gradient animation]
 +
 
 +
==Carousel==
 +
 
 +
*[https://github.com/nolimits4web/Swiper/blob/master/demos/310-thumbs-gallery-loop.html Swiper] <- has Vue version as well. (used by Klook) [https://idangero.us/swiper/demos/310-thumbs-gallery-loop.html Example]
 +
 
 +
=<span style="color: #0000ff">Server configuration</span>=
 +
 
 +
*[[Maillog is empty on Centos 7]]
 +
 
 +
===No password ssh===
 +
<pre>
 +
ssh-keygen -t rsa
 +
ssh-copy-id -i ~/.ssh/id_rsa.pub root@joyscoot.com -p 2223
 +
</pre>
 +
 
 +
*[[Setting up ssh server with .pem authentication]]
 +
 
 +
===Create unix user===
 +
 
 +
[https://linuxize.com/post/how-to-create-users-in-linux-using-the-useradd-command/ read more]
 +
 
 +
Home dir<br>
 +
<home dir> <username>
 +
<pre>
 +
> useradd -m -d /opt/username username
 +
</pre>
 +
 
 +
Specific ID<br>
 +
<uid> <username>
 +
<pre>
 +
> useradd -u 1500 username
 +
</pre>
 +
 
 +
Specific group<br>
 +
<groupname> <username>
 +
<pre>
 +
> useradd -g users username
 +
</pre>
 +
 
 +
More groups<br>
 +
<pre>
 +
useradd -g users -G wheel,developers username
 +
</pre>
 +
 
 +
Example of creatin' a user with expiration date
 +
<pre>
 +
> useradd -m -d /var/www/website.com eagroup -G nginx -c "Temporary developer account" -e 2019-11-22 -s /bin/bash
 +
</pre>
 +
 
 +
=<span style="color: #0000ff">Mobile Development</span>=
 +
 
 +
*[https://flutter.dev/ Flutter made by Google]
 +
 
 +
=<span style="color: #0000ff">Developer tricks, IDE, configuration, etc</span>=
 +
 
 +
=<span style="color: #0000ff">Games development, Modding</span>=
 +
 
 +
==Fallout 3+ Modding==

Latest revision as of 02:17, 1 October 2021

Windows and HyperV

HyperV remote management

https://timothygruber.com/hyper-v-2/remotely-managing-hyper-v-server-in-a-workgroup-or-non-domain/

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(all need to be opened in order to connect via internet): 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