Tuesday, November 14, 2017

Net Use Command for Windows

The net use command is a Command Prompt command that's used to connect to, remove, and configure connections to shared resources, like mapped drives and network printers.
 The net use command is one of many net commands like net send, net time, net user, net view, etc. 

Net Use Command Availability
The net use command is available from within the Command Prompt in Windows 10, Windows 8, Windows 7, Windows Vista, and Windows XP, as well as in older versions of Windows and in Windows Server operating systems. Recovery Console, the offline repair utility in Windows XP, also includes the net use command but it's not possible to use it within the tool.
 Note: The availability of certain net use command switches and other net use command syntax may differ from operating system to operating system.

 Net Use Command Syntax
net use [{devicename | *}] [\\computername\sharename[\volume] [{password | *}]] [/user:[domainname\]username] [/user:[dotteddomainname\]username] [/user:[username@dotteddomainname] [/home {devicename | *} [{password | *}]] [/persistent:{yes | no}] [/smartcard] [/savecred] [/delete] [/help] [/?]

List all active connection

net use

Remove temp credential login
net use "\\10.158.252.100\xxx" /d

https://www.lifewire.com/net-use-command-2618096

Tuesday, November 07, 2017

vsftpd server not listing ( 425 Failed to establish connection)

Its kind of an off the wall solution but something I have run into on CentOS w/ vsftpd is problems with the ip_conntrack_ftp module not being loaded correctly causing this issue.

 Try this:
modprobe ip_conntrack_ftp

https://www.linuxquestions.org/questions/linux-server-73/vsftpd-server-not-listing-425-failed-to-establish-connection-4175414488/

Saturday, October 28, 2017

Argument list too long error for rm, cp, mv commands

The reason this occurs is because bash actually expands the asterisk to every matching file, producing a very long command line. Try this:
find . -name "*.pdf" -print0 | xargs -0 rm
Warning: this is a recursive search and will find (and delete) files in subdirectories as well. Tack on -f to the rm command only if you are sure you don't want confirmation. If you're on Linux, you can do the following to make the command non-recursive:
find . -maxdepth 1 -name "*.pdf" -print0 | xargs -0 rm
Another option is to use find's -delete flag:
find . -name "*.pdf" -delete
Another possible solution :
c=1; l=$(ls | wc -l); for i in *; do rm $i; echo "[$c / $l] $i"; c=$((c + 1));

Friday, September 29, 2017

IIS ftp server can't access from other machine

https://serverfault.com/questions/438314/iis-ftp-server-works-locally-but-cannot-connect-from-remote

Basically, you have to run:
sc sidtype ftpsvc unrestricted
And then restart the FTP service:
net stop ftpsvc & net start ftpsvc
From what I can tell, it's a bug in R2. Go figure.

Monday, September 11, 2017

How to know linux server restart

You can use the following 2 commands (who & last) to find out the last time the system was rebooted and also messages about previous shutdown or runlevel changes.

Last time system booted?

For this you can use the who command. Specifically with the -b switch.
$ who -b
         system boot  2013-08-01 17:56
This says the last time the system was booted was 2013-08-01.

Past reboots

If you're interested in seeing a more extensive list of previous reboots you can use the lastcommand.
$ last reboot | less
reboot   system boot  2.6.35.14-106.fc Thu Aug  1 17:56 - 02:03 (7+08:06)   
reboot   system boot  2.6.35.14-106.fc Thu Aug  1 09:41 - 17:55  (08:14)    
reboot   system boot  2.6.35.14-106.fc Thu Jul 25 15:24 - 17:55 (7+02:31)   
reboot   system boot  2.6.35.14-106.fc Thu Jul 18 18:05 - 15:23 (6+21:17)   
...

Past system shutdowns & runlevel changes?

You can use the last command for this too. You'll need to use the -x switch.
$ last -x | less
saml     pts/7        :pts/6:S.0       Sat Aug  3 21:30 - 21:30  (00:00)    
saml     pts/6        :0.0             Sat Aug  3 21:29 - 21:30  (00:01)    
saml     pts/4        :0.0             Fri Aug  2 21:49 - 22:16 (2+00:26)   
saml     pts/2        :0.0             Fri Aug  2 13:30 - 22:16 (2+08:45)   
saml     pts/1        :0.0             Fri Aug  2 13:05   still logged in   
saml     pts/0        :0.0             Fri Aug  2 12:37   still logged in   
saml     pts/0        :0.0             Fri Aug  2 12:35 - 12:37  (00:02)    
saml     pts/0        :0.0             Thu Aug  1 17:58 - 12:35  (18:36)    
saml     tty1         :0               Thu Aug  1 17:56   still logged in   
runlevel (to lvl 5)   2.6.35.14-106.fc Thu Aug  1 17:56 - 02:04 (7+08:08)   
reboot   system boot  2.6.35.14-106.fc Thu Aug  1 17:56 - 02:04 (7+08:08)   
shutdown system down  2.6.35.14-106.fc Thu Aug  1 17:55 - 17:56  (00:00)    
runlevel (to lvl 6)   2.6.35.14-106.fc Thu Aug  1 17:55 - 17:55  (00:00)    
saml     tty2                          Thu Aug  1 17:54 - down   (00:01)    
root     tty2                          Thu Aug  1 17:53 - 17:54  (00:00)    
...

References

Tuesday, April 11, 2017

Cara Peram Alpukat

Cara peram alpukat yang masih mentah

  • Potong sedikit ujung alpukat
  • Tutup dengan tisu rekatkan dengan isolasi
  • Simpan di tempat terbuka
  • Cek setiap hari mana yang sudah matang (Di pencet agak empuk Insya Allah sudah matang merata)
  • Jika sudah matang, bisa di simpan di kulkas sekitar 3 hari

Monday, February 27, 2017

Excel 2013 error; [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified

Based on your description, your Windows system is 64-bit and your Office is 32-bit.

I suggest you refer to this support article first:
https://msdn.microsoft.com/en-us/library/ms712362(v=vs.85).aspx

As the article said: To manage a data source that connects to a 32-bit driver under 64-bit platform, use :\windows\sysWOW64\odbcad32.exe.
To manage a data source that connects to a 64-bit driver, use :\windows\system32\odbcad32.exe.

Make sure that you create your ODBC link using the 32 bits ODBC Manager: C:\Windows\SysWOW64\odbcad32.exe
Source...

Saturday, February 04, 2017

VBA Excel - Using CreateObject

There are some very useful libaries that are not part of Excel VBA.
These include the Dictionary, Database objects, Outlook VBA objects, Word VBA objects and so on.

These are written using COM interfaces.
The beauty of COM is that was can easily use these libraries in our projects.

If we add a reference to the library we create the object in the normal way.

' Select Tools->References and place a check
' beside "Microsoft Scripting Runtime"
Dim dict As New Scripting.Dictionary

If we don’t use a reference we can create the object at run time using CreateObject.

Dim dict As Object
Set dict = CreateObject("Scripting.Dictionary")

The first method is referred to as Early Binding and the second is referred to as Late Binding(see Early versus Late Binding) for more details.

http://excelmacromastery.com/vba-objects/#Subtle_Differences_of_Dim_Versus_Set

Monday, January 30, 2017

windows cannot be installed on this disk. The selected disk is of the GPT partition style.

fresh computer build, on the screen choosing which partition to use i see "windows cannot be installed to disk 0 partition 2. (show details)", when i click show details i get the message, "windows cannot be installed on this disk. The selected disk is of the GPT partition style." What can i do to install window?

Method #1:
1. Boot up to installation DVD/CD.
2. Click install but don't follow through.
3. Press SHIFT-F10 to bring up console.
4. Type "diskpart"
5. Once inside diskpart type:
-> list disk (find the one you want to convert)
-> select disk 0 (select the one you want from the list)
-> convert mbr (should take a second or two)
-> quit
6. Continue with install

Method #2:
1. Boot up to installation DVD/CD.
2. Click install but don't follow through.
3. Press SHIFT-F10 to bring up console.
4. Type "diskpart"
5. Once inside diskpart type:
-> list disk (find the one you want to convert)
-> select disk 0 (select the one you want from the list)
-> clean (wait an hour or so until its done)
-> quit
6. Continue with install

https://answers.microsoft.com/en-us/windows/forum/windows_7-windows_install/windows-cannot-be-installed-on-this-disk-the/8fa72a3e-10c5-47da-a040-1e0db62af309