This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo apt-get update | |
sudo apt-get install linux-image-extra-$(uname -r) linux-image-extra-virtual | |
sudo apt-get install apt-transport-https ca-certificates curl software-properties-common | |
sudo apt-key fingerprint 0EBFCD88 | |
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | |
sudo apt-get update | |
sudo apt-get install docker-ce | |
wget -P /tmp https://github.com/NVIDIA/nvidia-docker/releases/download/v1.0.1/nvidia-docker_1.0.1-1_amd64.deb | |
sudo dpkg -i /tmp/nvidia-docker*.deb && rm /tmp/nvidia-docker*.deb | |
sudo apt-get install nvidia-modprobe |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
import time | |
import json | |
token = '' | |
#Delete files older than this: | |
ts_to = int(time.time()) - 30 * 24 * 60 * 60 | |
def list_files(): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(':file').change(function(){ | |
var file = this.files[0]; | |
var name = file.name; | |
var size = file.size; | |
var type = file.type; | |
console.log(name, size, type, file); | |
var myVideoPlayer = document.createElement('video'); | |
myVideoPlayer.src = URL.createObjectURL(file); | |
myVideoPlayer.addEventListener('loadedmetadata', function() { | |
console.log(myVideoPlayer.duration); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"log" | |
"net/http" | |
"os" | |
"database/sql" | |
_ "github.com/lib/pq" | |
"fmt" | |
"encoding/json" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"http" | |
"io/ioutil" | |
"os" | |
) | |
func main() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
alias lol='(cd /home/peter/tools/WebStorm-141.1550/bin/ && ./webstorm.sh &) && (cd /home/peter/tools/smartgit/bin/ && ./smartgit.sh &) && fg' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
SAVEIFS=$IFS | |
#вырезаю первые 47 секунд https://blog.dbrgn.ch/2013/1/29/cut-video-from-bash-with-ffmpeg/ | |
# IFS это сепаратор http://www.cyberciti.biz/tips/handling-filenames-with-spaces-in-bash.html | |
IFS=$(echo -en "\n\b") | |
for f in * | |
do | |
NAME=${f%\ Salman*} # separator \ Salman* | |
ffmpeg -ss 00:00:47.0 -i $f -acodec copy -vcodec copy -async 1 $NAME.mp4 | |
rm $f |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
phoneHome = '+7(43243)2-34-43'.split(''); | |
var num, num1, flag ; | |
for(var i = 0; i < phoneHome.length + 1; i++) { | |
console.log(phoneHome.length ); | |
if(i === 7) { | |
flag = true; | |
num = phoneHome[i]; | |
phoneHome[i] = ')'; | |
continue; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function mixer(arr){ | |
for ( var i = arr.length; i-->0; ) { | |
var t = arr[i], | |
j = Math.floor(i*Math.random()); | |
arr[i] = arr[j]; | |
arr[j] = t; | |
} | |
return arr; | |
} |