Skip to content

Instantly share code, notes, and snippets.

View ijash's full-sized avatar
🍔
Royale with Cheese

Jastria Rahmat ijash

🍔
Royale with Cheese
View GitHub Profile
@ijash
ijash / virtualenv.md
Last active October 1, 2019 08:28
Python Virtual environment Guide for Debian based Linux

Python Virtual environment Guide

For Debian based GNU/Linux

Vitrualenv

What does virtualenv do?

A lot of built in programs in Linux, OSX or POSIX compilant often rely on the system python, the executable to which, is in /usr/bin/python. Because a lot depend on it, it is not a good idea to mess with it, change it's version, or add new libraries into it.
The better way is to have the dependencies contained within it's own environment, so system python changes (due to upgrade) and other environment's changes don't affect the current project.
the steps below mostly compatible with Debian based GNU/Linux. however, it may possible on OSX and other linux distributions too. The main idea is just the same.

Steps:

@ijash
ijash / tldext.md
Last active September 22, 2018 15:53
ekstensi top level domain

gTLD merupakan salah satu TLD yang sifatnya general.
Adapun yang termasuk gTLD adalah,
.com : digunakan untuk keperluan komersial
.org : digunakan untuk keperluan organisasi
.net : digunakan untuk keperluan internet/ network
.biz : digunakan untuk keperluan bisnis
.com : digunakan untuk keperluan komensial
.edu : digunakan untuk keperluan pendidikan
.info : digunakan untuk keperluan informasi
.name : digunakan untuk keperluan web pribadi

@ijash
ijash / open_current_dir_in_nemo.nemo_action
Last active March 19, 2019 10:56
Open folder in Visual Studio Code with just a right click. Applicable in linux mint 19.1 cinnamon.
[Nemo Action]
#https://gist.github.com/ijash/bf00167506337d918b3070a7ce57b1a7
Name=Open %f folder in VS Code
Name[id]= Buka folder $f dalam VS Code
Comment=Open current folder in Visual Studio Code with just a right click.
Comment[id]=Membuka folder ini dengan Visual Studio Code hanya dengan klik kanan.
Icon-Name=code
Selection=none;
Extensions=dir
#Quote=double
@ijash
ijash / phpPermission.md
Last active December 15, 2018 09:23
How do I give PHP write access to a directory?

Simple 3-Step Solution

Abstract: You need to set the owner of the directory to the user that PHP uses (web server user).


Step 1: Determine PHP User

Create a PHP file containing the following:

@ijash
ijash / arduino_vscode_intellisense.md
Last active March 18, 2019 20:28
Arduino vscode setting intellisense

add this line to settings.json (file>preferences>settings):

"C_Cpp.intelliSenseEngine": "Tag Parser",
"C_Cpp.default.includePath": [
  "${env.HOME}/.arduino"
  ]

and add to auto-generated c_cpp_properties.json in .vscode folder:

/* YourDuino.com Example Software Sketch
20 character 4 line I2C Display
ANOTHER NEW TYPE Marked "LCM1602 IIC A0 A1 A2"
A0-A1-A2 are grounded so I2C Address is 0x20
[email protected] */
/*-----( Import needed libraries )-----*/
#include <Wire.h>
#include <LCD.h>
#include <LiquidCrystal_I2C.h> // F Malpartida's NewLiquidCrystal library
//Download: https://bitbucket.org/fmalpartida/new-liquidcrystal/downloads
@ijash
ijash / xampp-linux.md
Last active September 23, 2024 22:37
XAMPP/LAMPP desktop shortcut or menu icon for linux mint 19.1

XAMPP/LAMPP desktop shortcut or menu icon for linux mint 19.1

in terminal: xed admin:///usr/share/applications/xampp-control-panel.desktop then add:

#!/usr/bin/env xdg-open
[Desktop Entry]
Comment=Start or Stop XAMPP
@ijash
ijash / Disable bluetooth.desktop
Last active March 19, 2019 09:48
disable bluetooth at startup
[Desktop Entry]
Type=Application
Exec=rfkill block bluetooth
X-GNOME-Autostart-enabled=true
NoDisplay=false
Hidden=false
Name=Disable bluetooth
Comment=Turn bluetooth off during computer startup
X-GNOME-Autostart-Delay=10
Icon=bluetooth-disabled

Passwordless ssh or copy public key

Key based authentication in SSH is called public key authentication. The purpose of ssh-copy-id is to make setting up public key authentication easier.

Assuming:

  • OpenSSH in both client and server is installed accordingly.
  • Both computer/host using popular GNU/linux distribution which OpenSSH enabled by default.
  • C is known as Client or user's computer/host.
  • R is known as Remote or remote server/computer/host.

Share samba folder via CLI

  1. Open the terminal
  2. Install samba with the following command: sudo apt-get install samba smbfs
  3. Configure samba typing: sudo nano /etc/samba/smb.conf
  4. Set your workgroup (if necesary). Go down the bottom of the file :
  5. Set your share folders. Do something like this (change your path and comments)
# Shared Folder
[shared]