Posts

CentOS - How to install

Image
In this post I will describe how to install CentOS 7. Nowadays install linux is not so difficult, as you will see in this post. First step, download ISO file from internet: http://isoredirect.centos.org/centos/7/isos/x86_64/CentOS-7-x86_64-DVD-1804.iso Now, you can mount your ISO file in your virtualization server or put in your computer drive and wait the wizard starts.  In the first screen choose your language and click on "Continue". Now click on "DATE & TIME". Choose your place, I live in the south of Brazil, then I selected Americas Sao Paulo.  After click "Done". Choose your "KEYBOARD". In my case, Portuguese (Brazil). Click "Done". In this step click on "INSTALLATION DESTINATION".   Here you can choose yours partitions size, in this case I left in the default configuration. Click "Done" again. Now click on "NETWORK & HOST NAME...

Powershell - How to insert multiple files content in one file

You can do this with the script below: $path = "\\server\logs\*.txt" $files = dir $path foreach ( $file in $files ){     Get-Content $ file >> c:\tmp\log.txt } And get your output file with the content of all other files.

Windows - Sent e-mail using vbs

Sometimes I need to test my mail server. To do this I use this script below, just change to your address and server. Just copy and paste in a .vbs file. Set objEmail = CreateObject("CDO.Message") objEmail.From = " youremail@mail.com " objEmail.Subject = " Subject " objEmail.To = " youremail@mail.com " objEmail.Textbody = Body objEmail.Configuration.Fields.Item _   (" http://schemas.microsoft.com/cdo/configuration/sendusing ") = 2 objEmail.Configuration.Fields.Item _   (" http://schemas.microsoft.com/cdo/configuration/smtpserver ") = _ " mailserver.yourdomain.com " objEmail.Configuration.Fields.Item _   (" http://schemas.microsoft.com/cdo/configuration/smtpserverport ") = 25 objEmail.Configuration.Fields.Update objEmail.Configuration.Fields.Update objEmail.Send

Windows - How to show print document name in event viewer

By default Windows Server does not save documents name in event viewer. To change this just add the key below. [HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Policies\Microsoft\Windows NT\Printers]  "ShowJobTitleInEventLogs"=dword:00000001 You don't have to restart the service to see your documents name.

OpenEdge (Progress) - List BI Writes an Reads

Sometimes you have to know who is making your BI bigger than expected. With the select below you can do that: SELECT          database() as 'Database',          u."_UserIO-Name" as 'User',          u."_UserIO-BIRead" as 'Reads',          u."_UserIO-BiWrite" as 'Writess'   FROM PUB."_UserIO" u   where u."_UserIO-BiRead" > 0 or u."_UserIO-BiWrite" > 0   order by u."_UserIO-BiWrite" desc

Impacket-master - psexec for linux

I have an application that need to execute remote commands on Windows and linux. This app run in a CentOS server. It is easy to execute a remote on linux, but on Windows I had to search a good solution and I had find Impacket-master. To use this solution you have to follow this steps: Install python in your linux; Download this libraries; argparse-master - https://pypi.python.org/pypi/argparse   pyasn1 - https://pypi.python.org/pypi/pyasn1   pycrypto-2.6.1 - https://pypi.python.org/pypi/pycrypto Install Libraries; Unpack files: tar -vzxf pyasn1-0.1.9.tar.gz Install: python setup.py install  After this, install Ipacket-Master: python setup.py install You can find psexec.py in examples folder: impacket-master/examples These is a command line with an example: python psexec.py domain/user:password@server 'cmd /c "dir /s c:\"'

Windows - Open exe, bat and all other program files from your intranet

It is common to have a lot of shortcuts to our systems on the intranet. It is easy to publish web applications but it is hard to put together all desktops programs. To make easy this task you have to to 3 steps: 1 - Create a batch file and put this in a share which everybody has access; 2 - Add in your Windows desktops a registry file, this file will contain an URI definition that will make possible the workstations understand what to do with the instruction from html link. 3 - Create a link in your intranet, or create a HTML file with a link to test. 1 - Batch file: create a batch file like this example. for /F "tokens=2 delims=: " %%a in ("%1%") do ( rem this step will get the program from instruction set startProgram=%%a ) rem this step will replace / for \ set htmlProgram=%startProgram:/=\% start %startProgram% 2 - Windows registry: Create a .reg file with a text like this example. Windows Registry Editor Version 5.00 [HKEY...