quarta-feira, 10 de junho de 2020

TurnOff wacom touchpad in linux

just write down this command in the terminal : xsetwacom --set `xsetwacom --list | grep TOUCH | sed -r "s/.*id: *([0-9]*).*/\1/"` touch off

domingo, 26 de abril de 2020

ffmpeg convert utility to h264 mp4

ffmpeg convert utility to h264 mp4 !!WIP--> dependence "ffmpeg"



Code :
       


#include <stdlib.h>
#include <math.h>
#include <iostream>
#include <string>



int main(int argc , char* argv[])
{
	std::cout << "chrysl666 Instagram video converter STARTING" << std::endl;
	
	if(argc < 3 )
	{
		std::cout << "need in and out names" << std::endl;
		return 0 ;
	}

	std::cout << "number of arguments: "<< argc << std::endl;
	
	std::string in = argv[1];
	std::cout << "input file: "<< in << std::endl;
	std::string out = argv[2];
	std::cout << "output file: "<< out << std::endl;


	std::string startMsg = "ffmpeg -i ";
	std::string midMsg = " -vcodec libx264 -acodec aac ";

	std::string finalCommand = startMsg + in + midMsg + out +".mp4" ;

	std::cout << "convert command using ffmpeg: " << finalCommand << std::endl;
	const char *systemchar = finalCommand.c_str() ;

	std::cout << systemchar << std::endl;
	system(systemchar);
	
	
	return 0;


}



       
 






sexta-feira, 13 de dezembro de 2019

system manager tools

SYSTEM-MANAGER-tools!!WIP--> dependence "HTOP" "NVIDIA-SMI
compile with : g++ watchNV.cpp -o watchNV



Code :
       


#include <stdlib.h>
#include <math.h>
#include <iostream>



int main(int argc , char* argv[])
{
        std::cout << "watch system START" << std::endl;
        system("gnome-terminal --geometry='85x25+0+8000' -e 'watch -n 1 nvidia-smi' ");
        system("gnome-terminal --geometry='85x25+0+0' -e 'htop' ");
        std::cout << "watch system OVER" << std::endl;

        return 0;


}



       
 






sexta-feira, 6 de setembro de 2019

Archive tool

ARCHIVE WIP !!WIP



Code :
       




import os
import hou



#Get HIP
hipdir = hou.expandString("$HIP")
#Get frame range 
totalFrameRange = 50000

# check if it is in Project Path
def isInProjectPath(projPath , filePath ):
    absProject = os.path.abspath(projPath)
    absFilePath = os.path.abspath(filePath)    
    return os.path.commonprefix([absProject,absFilePath])==absProject



# run my custom prefligth
def chrysl666_PF():
    
    #empty list
    compressList = []
    messages = ""
    
    # list all parm and paths
    for parm , path in hou.fileReferences():
        
        #expand path to absolute paths in all frames
        for i in range(totalFrameRange):
            try:
                filePath = parm.evalAsStringAtFrame(i)
            
                
                #check if file  is inside Main Project
                if not isInProjectPath(hipdir, filePath):
                    messages += (  "---->filePath = "+filePath + " is not in $HIP\n" )
                    
                    break
                
                #check if exists in disk
                if(os.path.exists(filePath) == True ):
                    # if True add into the list
                    compressList.append(filePath)
            except:
                pass
                
    # remove duplicate paths from list
    compressList = list(dict.fromkeys(compressList))
    # sort
    compressList.sort()
    
    #not used 
    #for each in  compressList:
    #    print each + "\n"
    
    if(messages>1):
        hou.ui.displayMessage( messages , title ="NOT IN THE PROJECT PATH")
    return  compressList
    

    
    # ARCHIVE FUNC
def archive(list):
    from zipfile import ZipFile
    import os
    
        # gets scene file
    scene = hou.expandString("$HIPFILE")
    sceneName = hou.expandString("$HIPNAME")
    
    # gets HIP Projct folder
    hipdir = hou.expandString("$HIP")
    
    zipNameAndPath = os.path.join(hipdir,sceneName)+".zip"
    
    # opens zip to write
    
    finalZip = ZipFile(zipNameAndPath,"w")
    
    
    # write dependence files
    finalZip.write(scene)
    for each in list:
        finalZip.write(each)
    
    # closes zip    
    finalZip.close()
    hou.ui.displayMessage(zipNameAndPath , title = "DONE")

    
archive(chrysl666_PF())