Skip to content

Instantly share code, notes, and snippets.

@mr-nit
mr-nit / port_scanner.php
Created February 26, 2024 09:55 — forked from akalongman/port_scanner.php
Port scanner on PHP
<?php
ini_set('max_execution_time', 0);
ini_set('memory_limit', -1);
$host = 'google.com';
$ports = array(21, 25, 80, 81, 110, 143, 443, 587, 2525, 3306);
foreach ($ports as $port)
{
$connection = @fsockopen($host, $port, $errno, $errstr, 2);
@mr-nit
mr-nit / meganz-link-generator.php
Created January 11, 2024 12:14 — forked from adithsureshbabu/meganz-link-generator.php
MEGA.NZ Direct Link Generator - download data non decrypted
@mr-nit
mr-nit / cleanupHomeboy.gs
Created May 6, 2023 03:46 — forked from mbierman/cleanupHomeboy.gs
Google App script to remove files created more than 90 days from multiple directories
function DeleteOldFiles() {
var Folders = new Array(
'insert dir ID', //Entry
'insert dir ID', //Garage
'insert dir ID' //Kitchen
);
var Files;
Logger.clear();
@mr-nit
mr-nit / list-files-in-folders.gs
Created April 29, 2023 14:45 — forked from sparkalow/list-files-in-folders.gs
Google Apps Script to recursively list files in a folder
/*
Recusrsively add a list of files from a named foler to a sheet
*/
function onOpen() {
var ss = SpreadsheetApp.getActiveSpreadsheet();
var searchMenuEntries = [{
name: "Create List from Folder",
functionName: "start"
}];
@mr-nit
mr-nit / GAS Move or Copy file.js
Last active April 27, 2023 03:50 — forked from wchiquito/gist:5932870
[Google Apps Script] Move files
/* CODE FOR DEMONSTRATION PURPOSES */
function getFileById_(idFile) {
return DocsList.getFileById(idFile);
}
function getFolderById_(idFolder) {
return DocsList.getFolderById(idFolder);
}
@mr-nit
mr-nit / moveAllFiles.gs
Created April 27, 2023 03:45 — forked from ttsukagoshi/moveAllFiles.gs
Google App Script (Javascript) to move all files in a particular Google Drive folder to another folder
/**
* Function to move all files in a particular Google Drive folder to another folder
* @param {string} moveFromFolderId - the original Google Drive folder ID from which you want to move the files
* @param {string} moveToFolderId - the Google Drive folder ID to which you want to move the files
*/
function moveAllFiles(moveFromFolderId, moveToFolderId) {
var moveFrom = DriveApp.getFolderById(moveFromFolderId);
var moveTo = DriveApp.getFolderById(moveToFolderId);
var files = moveFrom.getFiles();
Upload files to Google Drive using Google Apps Script Web Apps and save records in Google Sheets.
@mr-nit
mr-nit / submit.md
Created April 22, 2023 15:10 — forked from tanaikech/submit.md
Selecting Files in Google Drive using Select Box for Google Apps Script

This is a sample script for selecting files in Google Drive using HTML select box for Google Apps Script.

Feature

Feature of this sample.

  • It is a simple and space saving.
  • When the folder is selected, the files in the folder are shown.
  • When the file is selected, the ID of file is retrieved. Users can use this ID at GAS.
  • When a folder is opened, all files in the folder are cached. By this, the second access of the folder is faster.
  • It doesn't retrieve all files in Google Drive at once, so the read of files from Google Drive becomes the minimum necessary.
@mr-nit
mr-nit / filecount.gs
Created April 22, 2023 15:08 — forked from doofusdavid/filecount.gs
Google Script to get file counts.
/**
* Google Apps Script - List all files & folders in a Google Drive folder, & write into a speadsheet.
* - Main function 1: List all folders
* - Main function 2: List all files & folders
*
* Hint: Set your folder ID first! You may copy the folder ID from the browser's address field.
* The folder ID is everything after the 'folders/' portion of the URL.
*
* @version 1.0
* @see https://github.com/mesgarpour
@mr-nit
mr-nit / appsScript_ListFilesFolders_ver.2.js
Created April 27, 2021 15:57 — forked from mesgarpour/appsScript_ListFilesFolders_ver.2.js
[Google Apps Script] List all files & folders in a Google Drive folder, & write into a speadsheet
/*
* Copyright 2017 Mohsen Mesgarpour
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software