Skip to content

Instantly share code, notes, and snippets.

View matinrco's full-sized avatar
🤔
Thinkering... 😁

Matin matinrco

🤔
Thinkering... 😁
View GitHub Profile
@matinrco
matinrco / npm-global-without-sudo.md
Last active March 9, 2018 17:25
Install npm packages globally without sudo on macOS or Linux

Install npm packages globally without sudo on macOS or Linux

1. Create a directory for global packages
mkdir "${HOME}/.npm-packages"
2. Indicate to npm where to store globally installed packages. In your ~/.npmrc file add:
@matinrco
matinrco / VMWare3DEnabler.md
Created March 10, 2018 14:28
Enable 3D HW acceleration on VMWare Workstation on Linux host

Enable 3D HW acceleration on VMWare Workstation on Linux host


Add mks.gl.allowBlacklistedDrivers = "TRUE" to ~/.vmware/preferences

That's it :)

@matinrco
matinrco / meteor-alternate-windows-installation.md
Created March 29, 2018 20:14
Meteor alternate windows installation

On some network or machine setups Meteor's installer for Windows may fail. In such cases, follow these simple steps to install Meteor manually:

  1. Install 7-Zip or any other program that knows how to extract tar.gz files.
  2. Download the installation archive from : x86 : https://packages.meteor.com/bootstrap-link?arch=os.windows.x86_32 x64 : https://packages.meteor.com/bootstrap-link?arch=os.windows.x86_64
  3. In a command prompt, run echo %LocalAppData%\.meteor -- this is the directory in which Meteor should be installed.
  4. Extract the installation archive into the directory above.
  5. Add this directory to your PATH environment variable.
  6. You should now be able to open a new command prompt and run meteor. Some versions of Windows may require restarting your machine first.
@matinrco
matinrco / 12proxy
Created June 25, 2018 10:42
Debian apt http proxy - save this config in /etc/apt/apt.conf.d/
Acquire::http::proxy "http://127.0.0.1:8118/";
Acquire::https::proxy "https://127.0.0.1:8118/";
@matinrco
matinrco / curlSocksProxy
Created June 25, 2018 11:27
curl socks proxy
#inline socks usage with curl E.g :
curl --socks5-hostname 192.X.X.X:9050 -sSL https://example.com
#you can create .curlrc with following content :
socks5-hostname 192.X.X.X:9050
@matinrco
matinrco / dockerHttpProxyOnLinux.md
Last active June 25, 2018 12:58
docker http proxy on linux

create a systemd drop-in directory for the docker service:

mkdir /etc/systemd/system/docker.service.d

Now create a file called /etc/systemd/system/docker.service.d/http-proxy.conf that adds the HTTP_PROXY environment variable: [Service] Environment="HTTP_PROXY=http://proxy.example.com:80/"

@matinrco
matinrco / letsencryptHowTo-DNSValidation.sh
Created July 3, 2018 09:48
Let’s Encrypt - issue certificates with certbot-auto and renew how to - with DNS TXT domain validation
#this file is not ready for execution
#go to /opt to download certbot-auto
cd /opt
wget https://dl.eff.org/certbot-auto
#correct permissions
chmod a+x certbot-auto
@matinrco
matinrco / nginx-cloudflare.conf
Created July 7, 2018 11:42
Sample nginx configuration when using cloudflare with ssl & nginx proxy pass
server {
listen 80;
server_name example.com;
if ($http_x_forwarded_proto = "http") {
return 301 https://$server_name$request_uri;
}
location / {
@matinrco
matinrco / fixPermissions.sh
Created July 12, 2018 07:49
Fix file & folders permissions - git repo , e.g.
# For directories :
find . -type d -exec chmod 755 {} \;
# For files :
find . -type f -exec chmod 644 {} \;