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

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

How to change file permissions after SVN UPDATE

Tuesday, 12 November 2013 22:15
Tim Ramsey
0 Comments
I was frustrated because SVN takes umask to assign file permissions for the user and I had one file that needed different permissions to run. After researching for a while at the best approach, I decided to create a 3 line bash script to do change the file permissions afters the svn update.

1
2
3
4
#!/bin/sh
cd public_html
svn update
chmod 644 index.php


I named the file svnupdate.sh so running bash svnupdate.sh from shell changes the directory to public_html, updates the files, and then changes the permissions of the index.php file.

This is not meant to be an elaborate solution, but hopefully will point someone to a direction quicker that it took me.

Page 11 of 13

  • Previous
  • 1
  • …
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • Next

Categories

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

Recent Posts

  • Github permission denied from cPanel
  • Magento 2 Remove version signing static files
  • Composer Memory Limit Issues when updating/installing
  • Installing WHM/Cpanel on Digital Ocean
  • Setup of AWS RTMP Server with EFS