Skip to content

Instantly share code, notes, and snippets.

View salamann's full-sized avatar
💭
Enjoying life

salamann

💭
Enjoying life
View GitHub Profile
@salamann
salamann / stop_pfu.ps1
Last active January 11, 2024 04:06
Scansnap Homeを強制終了する方法(Windows)
# PowerShell -ExecutionPolicy RemoteSigned .\test.ps1
# Stop All Scansnap processes
Get-Process -Name Pfu* | Stop-Process
Get-Process -Name Ssh* | Stop-Process
# Wait until all the processes stop
while ((Get-Process -Name Pfu*).count -gt 0)
{
Start-Sleep -m 200
@salamann
salamann / ocr_pdf.py
Created October 23, 2019 00:38
Convert a pdf file to refined text so that Google Play Books can read out
from __future__ import print_function
import httplib2
import os
import io
from apiclient import discovery
from oauth2client import client
from oauth2client import tools
from oauth2client.file import Storage
from apiclient.http import MediaFileUpload, MediaIoBaseDownload
@salamann
salamann / imposition.py
Created October 16, 2019 06:16
Impose pdf
import math
import PyPDF2
def imposition(input_file, output_file, numreqd=4):
pdf_file = open(input_file,'rb')
pdf_reader = PyPDF2.PdfFileReader(pdf_file)
pdf_writer = PyPDF2.PdfFileWriter()
numpages = pdf_reader.numPages