• Home
  • Programming
    • API
      • Google
    • Javascript
    • Php
    • Server
  • CMS
    • Magento
    • Yahoo! Store

How to change “Date Modified” in Windows with PowerShell

Tuesday, 11 November 2014 20:24
Tim Ramsey
0 Comments
I was doing some development locally and needed to change the file time on some files so I could delete certain files in a directory.  Below is the code I used to change the files modified time:
1
2
3
$a = Get-Item C:\file-in-question.txt
$b = Get-Date "11/10/2014 8:00 AM"
$a.LastWriteTime = $b
Hopefully you find this as useful as I did!

Couple of useful Powershell commands

Sunday, 10 August 2014 18:01
Tim Ramsey
0 Comments
Write all contents of folder to a .txt file.  Helpful if you have a folder of images and need a .txt list
1
Get-ChildItem C:\img | ForEach-Object { $_.Name } > C:\img\ims.txt
Recursive find query.  Super helpful to find code snippets within a local project
1
Get-ChildItem "C:\inetpub\tlwchurch" -recurse | Select-String -pattern "navigation->child_link" | group path | select name
 

Suspicious process running under user

Wednesday, 30 July 2014 04:56
Tim Ramsey
0 Comments
I was tired of getting WHM email for processes that I was very much aware that were running.  You can add these to the ignore file to relieve the excessive emails.  Mine happened to be a php program so the syntax is as follows.  Open up the file
1
/etc/csf/csf.pignore
and add:
1
cmd:/usr/bin/php /home/<user>/public_html/<yourfile>.php
then you just need to restart the service for your changes to take effect.
1
service lfd restart
 

How to Install SSL from SSH

Thursday, 13 February 2014 19:21
Tim Ramsey
0 Comments
This is more of a reference for myself to come back to, but if anyone else needs the details here they are. This was for ubuntu so structure may be different depending on setup. Ensure SSL is enabled
1
sudo a2enmod ssl
Generate CSR Request (Which will create private keys and csr) in etc/ssl/private
1
openssl req -new -newkey rsa:2048 -nodes -out www_yoururl_com.csr -keyout www_yoururl_com.key -subj "/C=Your Country/ST=Your State/L=Your City/O=Your Company/CN=www.yoururl.com"
Move CSR to Certs Folder
1
mv www_yoururl_com.csr /etc/ssl/certs
Secure Copy Certificates from Desktop to server
1
2
pscp.exe C:\\yourcert.crt root@192.168.1.1:/etc/ssl/certs
pscp.exe C:\\yourbundle.crt root@192.168.1.1:/etc/ssl/certs
If you need to bundle the certs use
1
cat yourdomain.crt yourdomain.ca-bundle > ssl-bundle.crt
Edit VHosts for Port 443
1
vi /etc/apache2/sites-enabled/yoururlcom
1
2
3
4
5
6
7
<VirtualHost *:443>
DocumentRoot /var/www/
SSLEngine on
SSLCertificateFile /path/to/your_domain_name.crt
SSLCertificateKeyFile /path/to/your_private.key
SSLCertificateChainFile /path/to/DigiCertCA.crt
</VirtualHost>
Check vhosts config
1
apachectl configtest (sometimes apache2ctl configtest) or service nginx configtest
Restart Apache
1
/etc/init.d/apache2 restart or nginx -s reload
Verify it worked http://www.sslshopper.com/ssl-checker.html#hostname=www.yoururl.com

Page 13 of 15

  • Previous
  • 1
  • …
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • Next

Categories

  • CMS
    • Magento
    • Shopify
    • Yahoo! Store
  • Programming
    • API
      • Google
    • Javascript
    • Php
    • Server
    • SVN
  • VOIP

Recent Posts

  • How to write to Google Sheet with API in PHP
  • How to Migrate FreePBX server to a new server
  • Unifi Controller Java CPU 100%
  • Update Unifi Controller on Linux
  • Code Signing Desktop App