find . -type f -newermt “2014-10-08 10:17:00” ! -newermt “2014-10-08 10:53:00”
Category Archives: Terminal
Setup iscsi
Init asd setup
https://www.unixmen.com/attach-iscsi-target-disks-linux-servers/
sudo apt-get install open-iscsi
iscsiadm –mode discovery -t sendtargets –portal 192.168.1.x
iscsiadm –mode node –targetname iqn_identifier –portal 192.168.1.x –login
Should be mounted, see where with fdisk -l
mkdir /media/open-e
add this to /etc/fstab.
/dev/sdb2 /media/open-e ext4 _netdev,rw 0 0
Disable/Delete
First choice: disable an iSCSI target:
iscsiadm –m node -T iqn_identifier –portal 192.168.1.x:3260 -u
Second choice: delete the target’s record ID
iscsiadm -m node -o delete -T iqn.identifier –portal 192.168.1.x:3260
*** Ubuntu 20.04 setup howto ***
https://www.howtoforge.com/tutorial/how-to-setup-iscsi-storage-server-on-ubuntu-2004-lts/
Setup:
apt-get install tgt -y
systemctl status tgt
Configure:
nano /etc/tgt/conf.d/iscsi.conf
backing-store /dev/sdf1 initiator-address 192.168.1.x incominguser iscsi-user password outgoinguser iscsi-target secretpass
Where:
The first line defines the name of the LUN. The second line defines the location and name of the storage device on the iSCSI Target server. The third line defines the IP address of the iSCSI initiator. The fourth line defines the incoming username/password. The fifth line defines the username/password that the target will provide to the initiator to allow for mutual CHAP authentication to take place.
Next, restart the iSCSI service to apply the changes:
systemctl restart tgt
Verify
tgtadm –mode target –op show
Install and Configure iSCSI Initiator
apt-get install open-iscsi -y
Discover
iscsiadm -m discovery -t st -p 192.168.1.x
define the name of the LUN device in initiatorname.iscsi file:
nano /etc/iscsi/initiatorname.iscsi
Add your iSCSI Target LUN name as shown below:
InitiatorName=iqn.identifier
Next, you will need to define the CHAP information that you have configured on iSCSI target to access the iSCSI target from the iSCSI initiator. The node configuration file will exist in the directory ‘/etc/iscsi/nodes/‘ and will have a directory per LUN available.
You can define it by editing the following file:
nano /etc/iscsi/nodes/iqn.identifier/192.168.1.x\,3260\,1/default
Add / Modify the following lines:
node.session.auth.authmethod = CHAP
node.session.auth.username = iscsi-user
node.session.auth.password = password
node.session.auth.username_in = iscsi-target
node.session.auth.password_in = secretpass
node.startup = automatic
restart the iSCSI initiator service
systemctl status open-iscsi
verify the iSCSI connection
iscsiadm -m session -o show
lsblk
login to the target
iscsiadm --mode node --targetname iqn.2016-11:dss1.target0 --portal 192.168.1.x --login
Then mount it (in my case it is /dev/sdf1)
Code language: JavaScript (javascript)
Using wine prefixes
https://linuxconfig.org/using-wine-prefixes
https://wiki.winehq.org/FAQ#Wineprefixes
Creating A Prefix
$ WINEPREFIX=~/.wine32bit WINEARCH=”win32″ winecfg
Using Multiple Prefixes
$ WINEPREFIX=~/.wine32bit wine $HOME’/.local/share/wineprefixes/wine32bit/drive_c/Program Files/Image-Line/FL Studio 20/FL.exe’
How to start a powershell snipped?
PowerShell path\SloppyFocusFollowsMouse.Ps1
Run a powershell script
First open a powershell window and enable script execution
- Restricted ? Stops any script from running.
- RemoteSigned ? Allows scripts created on the device, but scripts created on another computer won’t run unless they include a trusted publisher’s signature.
- AllSigned ? All the scripts will run, but only if a trusted publisher has signed them.
- Unrestricted ? Runs any script without any restrictions enter this and answer A for All:
Set-ExecutionPolicy RemoteSigned
Now you can execute the scrip by entering it with the “invoke operator” (&) in front
& SloppyFocusFollowsMouse.ps1
Sloppy focus-follows-mouse in Windows?
Run this in powershell
$signature = @”
[DllImport(“user32.dll”)]
public static extern bool SystemParametersInfo(int uAction, int uParam, ref int lpvParam, int flags );
“@
$systemParamInfo = Add-Type -memberDefinition $signature -Name SloppyFocusMouse -passThru
[Int32]
$newVal = 1
$systemParamInfo::SystemParametersInfo(0x1001, 0, [REF]$newVal, 2)
Edit powershell snippets in windows?
Integrated Script Editor (ISE)
https://learn-powershell.net/2013/04/08/creating-snippets-in-powershell/
How to get your external IP from terminal/cmd
dig +short myip.opendns.com @resolver1.opendns.com
or
dig TXT +short o-o.myaddr.l.google.com @ns1.google.com
Windows
nslookup myip.opendns.com. resolver1.opendns.com
File association
Change file association for a file type in Windows
assoc .pkg=”pathtoexefile”