Mikrotik Safe Mode

Safe Mode is a configuration fail safe for Mikrotik routers. If enabled and you make a change that disconnects your session to the router, whatever changes were made will be rolled back, which should let you get back in the router.

If your in WinBox you can hit the Safe Mode button at the top left

If your in a telnet or ssh session just hit

ctrl + x

You should see the following to let you know that safe mode is active

[Safe Mode taken]

Hit ctrl + x again to release Safe Mode

Find IP address from command line on Linux

Using ip command

ip add

example output

bob@localhost:~$ ip add
1: lo: mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: eno1: mtu 1500 qdisc mq state UP group default qlen 1000
link/ether 38:ea:a7:13:a4:fe brd ff:ff:ff:ff:ff:ff
inet 192.168.1.21/24 brd 192.168.1.1 scope global dynamic noprefixroute eno1
valid_lft 513sec preferred_lft 513sec
inet6 13ac::98fe::ae78:d1ff/64 scope link noprefixroute
valid_lft forever preferred_lft forever
bob@localhost:~$

ifconfig

You may need to install net-tools to use

ifconfig  

example output

bob@localhost:~$ ifconfig 
eno1: flags=4163 mtu 1500
inet 192.168.200.58 netmask 255.255.255.0 broadcast 192.168.1.21
inet6 13ac::98fe::ae78:d1ff prefixlen 64 scopeid 0x20
ether b8:ac:6f:91:01:e8 txqueuelen 1000 (Ethernet)
RX packets 184950632 bytes 9487577263452
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 128473456 bytes 234612443785
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

Using the hostname command

hostname -I

Output is just the IP address. Example below

192.168.1.21

Vim config file .vimrc

Line numbers

Turn line numbers on

:set nu

Turn line numbers off

:set nu!

Color Scheme

:colorscheme evening

Syntax Highlighting

Turn Syntax highlighting on

:syntax on

Turn Syntax highlighting off

:syntax off

Highlight all search terms

:set hlsearch

https://vim.fandom.com/wiki/Highlight_all_search_pattern_matches

You can add the following to your ~/.vimrc in Linux or ~\.vimrc in Windows so the options are used every time you run vim.

colorscheme evening 
syntax on
set hlsearch
set nu


Setup Samba share on Ubuntu

In the following commands change <user_name> and <share_name> to the user you want and the name of the share directory.

Install samba and samba client

sudo apt-get install samba smbclient

Setup Samba user

sudo useradd -m  <user_name>  --shell /bin/false &&  
sudo passwd <user_name>
sudo smbpasswd -a <user_name>

Create Share Directory

sudo mkdir "/home/<user_name>/<share_name>
sudo chown <user_name>:<user_name> /home/<user_name>/<share_name

Make share directory

mkdir /home/<user_name>/<share_name>

Configure Samba conf

Add the following to the bottom of the /etc/smb.conf file. Change the <folder_name>, <user_name> etc to the ones created above.

[<folder_name>] 
path = /home/<user_name>/
<folder_name> valid
users = <user_name>
read only = no

Bash script

You can use the following bash script to automatically install and setup a samba share. Create a file called smb.sh and paste the following in

!/bin/bash

# incredigeek.com
# Ubuntu Samba share auto setup
#
sambaUser="smbuser"
smbFolder="smb_share"
sudo apt-get install samba smbclient
sudo useradd -m ${sambaUser} --shell /bin/false
echo "Enter the password you want to use for the smb user. 4 times."
sudo passwd ${sambaUser}
sudo smbpasswd -a ${sambaUser}
sudo mkdir "/home/${sambaUser}/${smbFolder}"
sudo chown ${sambaUser}:${sambaUser} /home/${sambaUser}/${smbFolder}
sudo echo "[${smbFolder}]" >> /etc/samba/smb.conf
sudo echo "path = /home/${sambaUser}/${smbFolder}" >> /etc/samba/smb.conf
sudo echo "valid users = ${sambaUser}" >> /etc/samba/smb.conf
sudo echo "read only = no" >> /etc/samba/smb.conf
sudo systemctl restart smbd
echo "Samba setup script finished"
echo "Access via $(hostname -I)/${smbFolder} ; username = ${sambaUser} ; password = whatever you put in"

Make executable

chmod +x smb.sh

Execute script

sudo ./smb.sh

Mikrotik RouterOS view and set Simple Queue speeds

list all simple queues

queue simple print 

Print queue that matches part of name

queue simple print where name~"John"

Example results

Flags: X - disabled, I - invalid, D - dynamic 
0 name="John Smith" target=192.168.1.3/32 parent=none packet-marks="" priority=8/8 queue=sfq-up/sfq-down limit-at=0/0
max-limit=1M/10M burst-limit=0/0 burst-threshold=0/0 burst-time=0s/0s bucket-size=0.1/0.1 total-queue=default

Change max speed on queue for client name. The Upload is specified first.

queue simple set max-limit=10M/100M "John Smith"

Unity/Playmaker create 1 second loop

The following picture shows the basics for create a loop that runs every second. You’ll need to create a float variable (Named oneSecond in the screen shot) that has a value of 1 for one second. Changed if desired.

Put your actions in the “Execute every 1 Second” state

For more info on Get Time Info, visit https://hutonggames.fogbugz.com/default.asp?W496


XenServer Commands

List, unplug, or destroy PBD storage repository

xe pbd-list
xe pbd-unplug uuid=[UUID for VM]
xe sr-destroy uuid=[UUID for VM]

List, unplug, or destroy storage repository.

xe sr-list
xe sr-unplug uuid=[UUID for VM]
xe sr-destroy uuid=[UUID for VM]

List VM’s

xe vm-list

Shutdown VM

xe vm-shutdown uuid=[UUID for VM]

Force shutdown VM

xe vm-shutdown -–force uuid=[UUID for VM]

List Task

xe task-list

Cancel Task

xe task-cancel uuid=[task uuid]

External Links

http://www.queryadmin.com/801/useful-storage-repository-commands-xenserver/

https://www.serveroperations.net/citrix/shutdown-a-hung-vm-on-xenserver

https://linuxconfig.org/how-to-take-and-restore-vm-snapshot-using-command-line-on-xenserver

Can’t set default app for .blend file on Windows 10

Problem: Can’t set default program for .blend files to Windows store version of Blender

Usually is not a problem as you’ll get asked if you want to set a default program. When you hit yes, blender does not show up in the list of apps. That wouldn’t be a problem, except Blender is from the Windows Store, so there is no launcher in the ordinary places.

Resolution: Install regular Windows installer from Blenders website.

Other Info

Not sure if the issue is with the Store or Blender. The .blend file type does not show up in the Windows Settings under “Apps -> Default apps -> Choose default apps by file type” and Blender doesn’t show up under “Apps -> Default apps -> Set defaults by app”