Showing posts with label Windows. Show all posts
Showing posts with label Windows. Show all posts

2020-09-09

Windows 7 ad hoc share wifi internet

 

https://www.pcninja.us/turn-your-windows-7-laptop-into-a-wifi-hotspot/


netsh wlan set hostednetwork mode=allow ssid=MyNetworkhere key=Password

netsh wlan start hostednetwork

select the network adapter to share enable "Allow other network users to connect…"

netsh wlan stop hostednetwork

2014-03-18

Boot Disk


diskpart
list disk
select disk ?
clean
create partition primary
select partition 1
active
format fs=ntfs quick label=”Win8-RP-x64”
  -- OR -- FS=FAT32
exit

(g: windows 8 DVD)
C:\Windows\system32>g:
G:\>cd boot
  Run "bootsect /help" for detailed usage instructions.

G:\boot>bootsect /nt60 e:
   Target volumes will be updated with BOOTMGR compatible bootcode.
   Bootcode was successfully updated on all targeted volumes.
G:\boot>exit

xcopy g:\*.* e:\ /E /H /F

-----------------------

bcd
bcdedit
bootcfg
fixboot
fixmbr
bootsect


=========================

fdisk
fdisk /mbr
format [/s]
sys

=========================

fdisk
mkfs.ext4

=========================

2014-03-17

GRUB2 multiboot ISO


GRUB2 multiboot ISO 2018 update

USB:
/boot/grub
/boot/iso
/boot/image
/boot/tc4
/boot/tc5
/boot/syslinux

get USB UUID & Label:
> blkid



/boot/grub.sh


/boot/grub/grub.env (1024byte)


/boot/grub/grub.cfg




/boo/grub/grub_hd.cfg (Harddisk)


/boo/grub/grub_fd.cfg (Floppy)



/boo/grub/grub_pe.cfg (Windows PE)

Linux:

/boo/grub/grub_tci.cfg (Tiny Core Linux)

/boo/grub/grub_sl.cfg (Slax)

/boo/grub/grub_u.cfg (Ubuntu)


/boo/grub/grub_d.cfg (Debian)


/boo/grub/grub_cd.cfg (CDLinux)


/boo/grub/grub_cr.cfg (ChromeOS)


/boo/grub/grub_s.cfg (openSUSE)


/boo/grub/grub_ce.cfg (CentOS)
* rdshell
method 1:
set rootopt="root=live:LABEL=CentOS-${ver}-${bit}-${live}"

boot into rdshell

1a: boot from RAM
# mkdir 1 2
# mount /dev/<usb partition> 1
# cp 1/boot/iso/<Centos ISO> 2
# umount 1
  (remove USB)
# exit

1b: boot from USB
# mkdir 1 2
# mount /dev/<usb partition> 1
# mount -o loop 1/boot/iso/<Centos ISO> 2
# exit

method 2:
set rootopt="root=live:${ISO_Path}/${iso}"

boot into rdshell

2a: boot from RAM
# mkdir -p boot/iso 1
# mount /dev/<usb partition> 1
# cp 1/boot/iso/<Centos ISO> boot/iso
# /init

2b: boot from USB
# mkdir -p boot 1
# mount /dev/<usb partition> 1
# ln -s /1/boot/iso /boot
# /init

2014-03-13

Windows


Disable Zip:
regsvr32 /u %windir%\system32\zipfldr.dll
regsvr32 %windir%\system32\zipfldr.dll


HKEY_CURRENT_USER\Software\Policies\Microsoft\Windows\Control Panel\Desktop
ScreenSaveActive
ScreenSaverIsSecure
ScreenSaveTimeOut

HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run

HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer
NoRun
NoSaveSettings

CodePage
950 Big5
949 Korean
936 GBK
932 Shift-JIS
65000 UTF-7
65001 UTF-8
20936 GB2312
437 Eng

1250 — East European Latin
1251 — Cyrillic
1252 — West European Latin
1253 — Greek
1254 — Turkish
1255 — Hebrew
1256 — Arabic
1257 — Baltic
1258 — Vietnamese


Windows Routing / net use

route -f

route -p add 192.168.0.0 mask 255.255.0.0 192.168.1.1

route add 192.168.1.1 mask 255.255.255.255 192.168.2.1

route -p add 0.0.0.0 mask 0.0.0.0 192.168.2.1

net use p: \\192.1681.1\xxx /USER:xxx\xx.xxx

net use \\192.168.1.1 /USER:xxx

net use p: /delete

subst s: /d


Windows AD, DHCP


AD DC

Disabling USB storage on Microsoft Windows:
1. From Explorers folder options ensure that hidden files and folders are displayed, file extensions are not hidden and simple file sharing is disabled.
2. Open up the properties for %systemroot%\Inf\Usbtror.inf (%systemroot% would normally be ‘C:\Windows’).
3. Select the security tab and make sure that all options for all users are set to deny. This must include administrators and SYSTEM.
4. Repeat the above for %systemroot%\Inf\Usbstor.pnf
5. If USB storage devices have been used on this machine previously then open up the registry editor otherwise ignore steps 6 and 7.
6. Browse to the registry location ‘HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\UsbStor’.
7. Open up the registry key ‘Start’ and change the data value to ‘4?. Close the registry editor.

If you dont want to simplify the task download and run this usbstoragedisable.reg that will take care of diabling USB storage device. Make sure you restart after running this registry script.

If you want to enable it back then download and run this usbstorageenable.reg. Restart to take effect.

Additionally you need to deny the registry permissions to system for installing USB storage devices. For that, get a copy of subinacl.exe from MS 2003 server resource kit or search microsoft site for this tool.

Here is the command you should run to deny the permissions. Copy it in your batch file and run wherever you want.

subinacl.exe /keyreg \system\currentcontrolset\services\usbstor /deny=system



Pre:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa\Forceguest 0

IP Static to DHCP
wmic /node:10.0.1.101 /user:User /password:abc123 nicconfig where (ipenabled=true and dhcpenabled=false) call enabledhcp

DNS Auto
wmic /node:10.0.1.101 /user:User /password:abc123 nicconfig where (ipenabled=true and dhcpenabled=true) call setdnsserversearchorder ()

Change Computername
wmic /node:10.0.1.101 /user:user /password:abc123 computersystem where (name="vboxxp") rename name="vboxxp5"

Config DHCP Server

Reboot (No DC)
wmic /node:10.0.1.101 /user:User /password:abc123 os where primary=True call reboot

Join DC
netdom join 10.0.1.101 /Domain:macau_slot.com /UserO:user /PasswordO:abc123 /UserD:macau_slot.com\siduser /PasswordD:Abc!234 /REBoot:5


Reboot (Joined DC)
wmic /node:10.0.1.101 /user:Administrator /password:abc123 os where primary=True call reboot                          






WMIC /node:10.0.1.103 /user:Administrator /password:abc123 ComputerSystem where Name="vboxxp" call Rename Name="vboxxp4"

wmic /node:10.0.1.103 /user:Administrator /password:abc123 OS Where Primary=TRUE Call reboot



==============================


wmic /node:10.0.1.103 /user:Administrator /password:abc123 OS Where Primary=TRUE Call Shutdown

AD
netsh firewall set service remoteadmin enable
netsh firewall set opmode enable



Tiny Core Linux File System: NTFS, NFS, CIFS/Samba


ntfs-3g
ntfs-3g-adv
ntfsprogs

NFS:
nfs-utils:
sudo ln -s /usr/local/etc/init.d/nfs-client /sbin
sudo nfs-client start

NFSD:
        if [ ! -f /etc/hosts.allow ]; then
                sudo /bin/cp /mnt/tcz/nfs/hosts.allow /etc
        fi

        if [ ! -f /etc/hosts.deny ]; then
                sudo /bin/cp /mnt/tcz/nfs/hosts.deny /etc
        fi

        if [ ! -f /etc/exports ]; then
                sudo /bin/cp /mnt/tcz/nfs/exports /etc
        fi

        st2 filesystems-KERNEL
        st2 nfs-utils

        sudo /bin/cp /mnt/tcz/nfs/nfs-server /usr/local/etc/init.d
        sudo ln -s /usr/local/etc/init.d/nfs-server /sbin

        mkdir -p /opt/nfs
        sudo nfs-server start

CIFS (Windows Share Folder):
cifs-utils
sudo mount.cifs -o username=xxx,password=xxx,sec=ntlm //ip/path /path

Samba (Windows Share Folder Service):
        SAMBA_HOME=/usr/local/etc/samba

        sudo mkdir -p $SAMBA_HOME

        if [ ! -f $SAMBA_HOME/smbpasswd ]; then
                sudo /bin/cp /mnt/tcz/cifs/smbpasswd $SAMBA_HOME
        fi

        if [ ! -f $SAMBA_HOME/smbusers ]; then
                sudo /bin/cp /mnt/tcz/cifs/smbusers $SAMBA_HOME
        fi

        if [ ! -f $SAMBA_HOME/smb.conf ]; then
                sudo /bin/cp /mnt/tcz/cifs/smb.conf $SAMBA_HOME
        fi

        st2 samba3

        sudo smbpasswd -a tc

        sudo ln -s /usr/local/etc/init.d/samba /sbin

        mkdir -p /opt/cifs

        sudo samba start