#Using dos2unix Replacing the original file:
dos2unix filename
Creating a .bak copy of the original:
dos2unix -b filename
#Using tr command
| #user nobody; | |
| #Defines which Linux system user will own and run the Nginx server | |
| worker_processes 1; | |
| #Referes to single threaded process. Generally set to be equal to the number of CPUs or cores. | |
| #error_log logs/error.log; #error_log logs/error.log notice; | |
| #Specifies the file where server logs. |
| import math | |
| def convertSize(size): | |
| size_name = ("B","KB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB") | |
| i = int(math.floor(math.log(size,1024))) | |
| p = math.pow(1024,i) | |
| s = round(size/p,2) | |
| if (s > 0): | |
| return '%s %s' % (s,size_name[i]) | |
| else: |
| <? | |
| function aes128_cbc_encrypt($key, $data, $iv) { | |
| if(16 !== strlen($key)) $key = hash('MD5', $key, true); | |
| if(16 !== strlen($iv)) $iv = hash('MD5', $iv, true); | |
| $padding = 16 - (strlen($data) % 16); | |
| $data .= str_repeat(chr($padding), $padding); | |
| return mcrypt_encrypt(MCRYPT_RIJNDAEL_128, $key, $data, MCRYPT_MODE_CBC, $iv); | |
| } |
#Using dos2unix Replacing the original file:
dos2unix filename
Creating a .bak copy of the original:
dos2unix -b filename
#Using tr command
| # Add it to your ~/.zshrc | |
| encrypt () { openssl des3 -in $1 -out $1.encrypted } | |
| decrypt () { FILENAME=$(echo $1|sed -e 's/\.encrypted$//g'); openssl des3 -d -in $1 -out $FILENAME } |
| class XmlUtils | |
| { | |
| function removeChildren(&$node) | |
| { | |
| while ($node->firstChild) | |
| { | |
| while ($node->firstChild->firstChild) | |
| { | |
| XmlUtils::removeChildren($node->firstChild); | |
| } |
| ### Aliases | |
| # Open specified files in Sublime Text | |
| # "s ." will open the current directory in Sublime | |
| alias s='open -a "Sublime Text"' | |
| alias d='cd /Volumes/SECUNDARIO' | |
| alias gd='cd Volumes/SECUNDARIO/MIO/Google\ Drive/' | |
| #alias ogc='open -a Google\ Chrome --args --disable-web-security' | |
| alias ogc='open -a Google\ Chrome' |
| for i in *.CR2; do sips -s format jpeg $i --out "${i%.*}.jpg"; done |
| 1 - Oculus Rift CV1, Oculus VR | |
| displayId: 1 | |
| displayName: Oculus Rift CV1, Oculus VR | |
| isConnected: true | |
| isPresenting: false | |
| capabilities: | |
| hasOrientation: true | |
| hasPosition: true | |
| hasExternalDisplay: true |
| BrushInterface.prototype = { | |
| addPoint: function (position, orientation, pointerPosition, pressure, timestamp) {}, | |
| tick: function (timeoffset, delta) {} | |
| } |