Time Wasters

Because you can’t be productive all the time


Fix no wifi on linux mint for old HP laptop

My old HP laptop had a very old wifi card that wasn’t supported out of the box by linux mint, but I was able to install the necessary drivers with the following code

1
2
3
4
5
6
7
sudo apt update
sudo update-pciids
sudo apt install bcmwl-kernel-source 
sudo apt install broadcom-sta-dkms
sudo apt-get install broadcom-sta-dkms
 
"/cygdrive/p/Programs/VirtualBox/VboxManage.exe" clonehd 'F:/Documents/Virtualbox/2019 Mint/2019 Mint.vdi' 'F:/Documents/Virtualbox/2019_Mint.iso' --format RAW

Permalink » No comments

SSH copy files

the first folder is the from directory, then the next is the

1
cp -R /share/Multimedia/Videos/ /share/USBDisk2/Backup-3_2019/Multimedia/

Then, fix the permissions:

1
chmod -R 777 /share/USBDisk2/-Backup-3_2019/

Permalink » No comments

Picking ionic back up

If you’re on a fresh macOS install, you’ll need to first install the necessary components

  1. download NPM installer from their website
  2. sudo npm install -f @ionic/cli
  3. sudo npm i -g cordova
  4. sudo gem install cocoapods

OK, so it’s been a while and you have to pick back up from where you last left off with your ionic app. He’s how to go about that on Mac with Git.

  1. Pull from Git
  2. Run “npm install” to get all the modules
  3. Run “ionic cordova platform add ios”
  4. Run “ionic cordova prepare” to install plugins
  5. Run “sudo npm i –unsafe-perm -g cordova-res” and “ionic cordova resources” to generate splash and icons

If you need to redo your signing, you can follow these steps

  1. Select a development team
    https://stackoverflow.com/questions/39524148/requires-a-development-team-select-a-development-team-in-the-project-editor-cod
  2. If you invalid errors, make sure your system clock has the correct date

Hopefully that did the trick and you’re ready to go, I’ll add any errors and fixes I come across to the end of the article, but here’s how to go about testing.

Emulator testing:

  1. Just run ‘ ionic cordova emulate ios  -l — –buildFlag=”-UseModernBuildSystem=0″ ‘ to start it up in the emulator

Ad hoc Device testing:

  1. Open Xcode
  2. Open the iOS project, probably something like “~/Documents/app/platform/ios/App.xcworkspace”
  3. Login to developer account under Xcode>settings>accounts
  4. Select “Generic iOS Device” as device
  5. Choose Product->Build For->Testing
  6. Product->Archive
  7. Click the “Export…” button and choose Development and choose where to export the IPA
  8. Upload the IPA to diawi.com, then install on device

 

To fix “‘xcodebuild’ requires Xcode” errors

  • Run Xcode from applications directory (make sure to drag and drop the application into the directory)
  • xcode-select –install # Install Command Line Tools if you haven’t already.
  • sudo xcode-select –switch /Library/Developer/CommandLineTools # Enable command line tools
  • sudo xcode-select -s /Applications/Xcode.app/Contents/Developer

Permalink » No comments

Transfer files to FTP via Rails console

First require Net::FTP so the functions will be available

1
require 'net/ftp'

Create FTP connection, with a custom port

1
2
3
4
ftp = Net::FTP.new
ftp.connect('url', port) 
ftp.login('username', 'password')
ftp.passive = true

Move to the folder you want to upload the file into

1
ftp.chdir('folder/')

Get URL of paperclip file

1
url = 'public'+paperclip.photo.url.gsub(/\?.*/, '')

Upload to server

1
ftp.putbinaryfile(url)

Close connection

1
ftp.quit()

Permalink » No comments

Fastest way to search an object

Same deal as my previous post, I want to pin down the fastest method to use to search the parameter values of an object in Javascript using https://jsperf.com.  I found 4 different ways to receive the same result, this isn’t an exhaustive list but features some of the most common methods used for searching objects.

Between multiple tests findIndex and find did the best, but find was faster more often then findIndex.

obj_search

 

 

Permalink » No comments