Skip to content

Instantly share code, notes, and snippets.

@canabady
canabady / openldap-modify-acl
Last active July 13, 2022 15:22
To modify openldap ACL
########################
# To modify openldap ACL
########################
# delete the existing ACL
# delete-acl.ldif
dn: olcDatabase={1}hdb,cn=config
changetype: modify
delete: olcAccess
@canabady
canabady / rename_with_increment
Last active March 6, 2018 04:26
To bulk rename files with increment or decrement
To bulk rename files with increment or decrement
================================================
e.g.
song_002.mp3
song_003.mp3
...
song_011.mp3
To rename above file list to:
@canabady
canabady / import_issues_from_github_to_taiga.ruby
Created December 19, 2017 09:53 — forked from roalcantara/import_issues_from_github_to_taiga.ruby
Importing issues from github to taiga via API
require 'json'
require 'rest-client'
puts 'Creating User Stories from github issutes.. STARTED!'
#getting github's token: https://help.github.com/articles/creating-an-access-token-for-command-line-use
github_token = "token foo"
#github params
github = {:url => 'https://api.github.com/repos/foo/foo/issues', :token => github_token}
@canabady
canabady / vimtips.txt
Created December 12, 2017 06:14 — forked from kenorb/vimtips.txt
Vim Tips
__BEGIN__
*vimtips.txt* For Vim version 7.3.
------------------------------------------------------------------------------
" new items marked [N] , corrected items marked [C]
" *best-searching*
/joe/e : cursor set to End of match
3/joe/e+1 : find 3rd joe cursor set to End of match plus 1 [C]
/joe/s-2 : cursor set to Start of match minus 2
/joe/+3 : find joe move cursor 3 lines down
/^joe.*fred.*bill/ : find joe AND fred AND Bill (Joe at start of line)
@canabady
canabady / Linking Parent-Component-FormGroup-with-Child-Component-FormControlName
Last active May 24, 2023 00:15
Connecting parent component 'formGroup' with child component 'formControlName'
Connecting parent component 'formGroup' with child component 'formControlName'
In the Parent component template
================================
<form [formGroup]="recipeForm">
<app-recipe-name [parent]="recipeForm"></app-recipe-name>
</form>
@canabady
canabady / Angular[2-5] formControl
Last active November 27, 2017 13:45
Angular formControl issue with input
Can't bind to 'formControl' since it isn't a known property of 'input' - angular[2-5] material Autocomplete issue
-----------------------------------------------------------------------------------------------------------------
While using formControl, you have to import ReactiveFormsModule to your imports array.
example:
import {FormsModule, ReactiveFormsModule} from '@angular/forms';
@NgModule({
imports: [
@canabady
canabady / Test.py
Created November 17, 2017 14:29 — forked from tuxmartin/Test.py
Python ORM example (Python + SQLAlchemy + SQlite/MySQL)
from sqlalchemy.ext.declarative import declarative_base
#from sqlalchemy import *
#from sqlalchemy.orm import *
# Pro entity v podadresari. Podaresar *musi* obsahovat prazdny soubor __init__.py !
#from entity.User import User
'''
Zavislosti:
# apt-get install python-sqlalchemy
======================================
sqlite3 preview in Ranger file Manager
======================================
To preview every *.db, *.sqlite file in Ranger File Manager,
You can add the following to the
case "$extension" in
in Your scope.sh:
@canabady
canabady / basel-init-cmd-error
Last active September 27, 2017 12:25
Fixing error in basel-init cmd
executing:
basel-init myApp result on this message error:
env: node\r: No such file or directory
It seems there is a none unix return somewhere x(
I fix it using:
sudo find /usr/local/lib/node_modules/basel -type f -exec perl -pi -e 's/\r\n|\n|\r/\n/g' {} \;
@canabady
canabady / ng-bootstrap - Installation
Created August 29, 2017 12:32
ng-bootstrap for Various components including ngbDropdown
The only required dependencies are:
Angular (requires Angular version 4 or higher, tested with 4.0.3)
Bootstrap CSS (tested with 4.0.0-beta)
Installation
After installing the above dependencies, install ng-bootstrap via:
npm install --save @ng-bootstrap/ng-bootstrap